[MIG] document_page_approval: Migration to 18.0

This commit is contained in:
Bhavesh Heliconia
2025-03-28 16:27:39 +05:30
parent d45dd7ff54
commit a8346c25f3
7 changed files with 212 additions and 84 deletions

View File

@@ -1,6 +1,7 @@
# Copyright (C) 2013 Savoir-faire Linux (<http://www.savoirfairelinux.com>).
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo import fields, models
from odoo.exceptions import UserError
from odoo.tools.translate import _
@@ -93,12 +94,14 @@ class DocumentPageHistory(models.Model):
raise UserError(
_(
"You are not authorized to do this.\r\n"
"Only approvers with these groups can approve this: "
)
% ", ".join(
[g.display_name for g in rec.page_id.approver_group_ids]
"Only approvers with these groups can approve this: {}"
).format(
", ".join(
[g.display_name for g in rec.page_id.approver_group_ids]
)
)
)
# Update state
rec.write(
{