[ADD]pms_api_rest: basic reports services

This commit is contained in:
Darío Lodeiros
2022-11-19 12:52:28 +01:00
parent a2f061cd76
commit 2e09125202
7 changed files with 206 additions and 47 deletions

View File

@@ -1,3 +1,4 @@
from . import pms_property
from . import res_users
from . import account_payment
from . import sql_export

View File

@@ -0,0 +1,15 @@
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()