[MIG] document_page_access_group: Migration to 18.0

This commit is contained in:
Bhavesh Heliconia
2025-02-17 16:41:17 +05:30
parent f37e9e1720
commit 893d3bd8a5
10 changed files with 40 additions and 48 deletions

View File

@@ -2,7 +2,7 @@
# Copyright 2024 Tecnativa - Víctor Martínez
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
from odoo import _, api, fields, models
from odoo import api, fields, models
from odoo.exceptions import UserError
@@ -15,5 +15,7 @@ class DocumentPage(models.Model):
@api.constrains("groups_id", "user_ids")
def check_document_page_groups_users(self):
for _item in self.filtered(lambda x: x.groups_id and x.user_ids):
raise UserError(_("You cannot set groups and users at the same time."))
raise UserError(
self.env._("You cannot set groups and users at the same time.")
)
return True