mirror of
https://github.com/OCA/knowledge.git
synced 2025-07-14 01:41:26 -06:00
Updated from template
This commit is contained in:
parent
e7c562205e
commit
8ef3f40ee4
@ -106,7 +106,7 @@ class DocumentPage(models.Model):
|
||||
action = parent.menu_id.action
|
||||
parent = parent.parent_id
|
||||
if action:
|
||||
url += "&action={}".format(action.id)
|
||||
url += f"&action={action.id}"
|
||||
rec.backend_url = url
|
||||
|
||||
@api.constrains("parent_id")
|
||||
@ -122,7 +122,7 @@ class DocumentPage(models.Model):
|
||||
]
|
||||
r = ""
|
||||
if link:
|
||||
r = '<a href="{}">{}</a>'.format(self.backend_url, self.name)
|
||||
r = f'<a href="{self.backend_url}">{self.name}</a>'
|
||||
if index:
|
||||
r += "<ul>" + "".join(index) + "</ul>"
|
||||
return r
|
||||
|
@ -61,8 +61,8 @@ class DocumentPageHistory(models.Model):
|
||||
return diff.make_table(
|
||||
line1,
|
||||
line2,
|
||||
"Revision-{}".format(v1),
|
||||
"Revision-{}".format(v2),
|
||||
f"Revision-{v1}",
|
||||
f"Revision-{v2}",
|
||||
context=True,
|
||||
)
|
||||
|
||||
|
@ -39,7 +39,7 @@ class TestDocumentPage(common.TransactionCase):
|
||||
page = self.page_obj.create({"name": "Test Page 3", "content": "Test content"})
|
||||
self.assertEqual(
|
||||
page.backend_url,
|
||||
"/web#id={}&model=document.page&view_type=form".format(page.id),
|
||||
f"/web#id={page.id}&model=document.page&view_type=form",
|
||||
)
|
||||
menu = self.env.ref("document_knowledge.menu_document")
|
||||
page.menu_id = menu
|
||||
|
Loading…
Reference in New Issue
Block a user