Files
pms/pms_api_rest/models/sql_export.py
2024-04-22 17:25:00 +02:00

16 lines
487 B
Python

from odoo import _, models
from odoo.exceptions import UserError
class SqlExport(models.Model):
_inherit = "sql.export"
def unlink(self):
if (
self.env.ref("pms_api_rest.sql_export_services") in self
or self.env.ref("pms_api_rest.sql_export_departures") in self
or self.env.ref("pms_api_rest.sql_export_arrivals") in self
):
raise UserError(_("You can not delete PMS SQL query"))
return super().unlink()