[FIX] pms: permission error

This commit is contained in:
Eric Antones
2021-02-18 13:51:46 +01:00
parent 4b680c8fdc
commit 5bb47e1e35
2 changed files with 30 additions and 21 deletions

View File

@@ -31,6 +31,15 @@ class ResUsers(models.Model):
)
company_id = fields.Many2one(domain="[('id','in',company_ids)]")
active_property_ids = fields.Many2many(
comodel_name="pms.property", compute="_compute_active_property_ids", store=True
)
@api.depends("pms_property_ids")
def _compute_active_property_ids(self):
for rec in self:
rec.active_property_ids = [(6, 0, rec.get_active_property_ids())]
@api.model
def get_active_property_ids(self):
# TODO: Require performance test and security (dont allow any property id)