[MIG] document_page: Migration to 18.0

This commit is contained in:
Justine Doutreloux
2024-11-07 17:14:58 +01:00
parent adbf5ac757
commit a5aa3c86bc
7 changed files with 36 additions and 43 deletions

View File

@@ -3,7 +3,7 @@
import difflib
from odoo import _, api, fields, models
from odoo import api, fields, models
class DocumentPageHistory(models.Model):
@@ -55,7 +55,7 @@ class DocumentPageHistory(models.Model):
line1 = text1.splitlines(True)
line2 = text2.splitlines(True)
if line1 == line2:
return _("There are no changes in revisions.")
return self.env._("There are no changes in revisions.")
else:
diff = difflib.HtmlDiff()
return diff.make_table(
@@ -66,10 +66,6 @@ class DocumentPageHistory(models.Model):
context=True,
)
# TODO: Replace for _compute_display_name
def name_get(self):
return [(rec.id, "%s #%i" % (rec.page_id.name, rec.id)) for rec in self]
@api.depends("page_id")
def _compute_display_name(self):
for rec in self: