mirror of
https://github.com/OCA/pms.git
synced 2025-01-29 00:17:45 +02:00
[ADD]pms_api_rest: basic reports services
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
from . import pms_property
|
||||
from . import res_users
|
||||
from . import account_payment
|
||||
from . import sql_export
|
||||
|
||||
15
pms_api_rest/models/sql_export.py
Normal file
15
pms_api_rest/models/sql_export.py
Normal 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()
|
||||
Reference in New Issue
Block a user