#!/usr/bin/env python3
import sys
from pathlib import Path
ODOO_PATH = Path('/root/skeen-odoo')
sys.path.insert(0, str(ODOO_PATH))
import odoo
from odoo import api, SUPERUSER_ID
odoo.tools.config.parse_config(['-c', '/root/skeen-odoo/odoo.conf'])
db = odoo.sql_db.db_connect('skeen_odoo')
with db.cursor() as cr:
    env = api.Environment(cr, SUPERUSER_ID, {})
    env['skeen.cita'].sudo().search([]).unlink()
    env['skeen.venta'].sudo().search([]).unlink()
    env['skeen.pago'].sudo().search([]).unlink()
    env['skeen.monedero'].sudo().search([]).unlink()
    env['res.partner'].sudo().search([('is_patient', '=', True)]).unlink()
    cr.commit()
    print('Datos reseteados')
