mirror of
https://github.com/OCA/knowledge.git
synced 2025-07-13 15:34:49 -06:00
[FIX] document_page_reference: assure content or content_parsed is visible
This commit is contained in:
parent
191b41a391
commit
8cef3f268b
@ -62,7 +62,14 @@ class DocumentPage(models.Model):
|
|||||||
@api.depends("history_head")
|
@api.depends("history_head")
|
||||||
def _compute_content_parsed(self):
|
def _compute_content_parsed(self):
|
||||||
for record in self:
|
for record in self:
|
||||||
record.content_parsed = record.get_content()
|
content = record.get_content()
|
||||||
|
if content == "<p>" and self.content != "<p>":
|
||||||
|
_logger.error(
|
||||||
|
"Template from page with id = %s cannot be processed correctly"
|
||||||
|
% self.id
|
||||||
|
)
|
||||||
|
content = self.content
|
||||||
|
record.content_parsed = content
|
||||||
|
|
||||||
@api.constrains("reference")
|
@api.constrains("reference")
|
||||||
def _check_reference(self):
|
def _check_reference(self):
|
||||||
@ -111,7 +118,9 @@ class DocumentPage(models.Model):
|
|||||||
template = mako_env.from_string(tools.ustr(content))
|
template = mako_env.from_string(tools.ustr(content))
|
||||||
return template.render(self._get_template_variables())
|
return template.render(self._get_template_variables())
|
||||||
except Exception:
|
except Exception:
|
||||||
_logger.error("Template from page %s cannot be processed" % self.id)
|
_logger.error(
|
||||||
|
"Template from page with id = %s cannot be processed" % self.id
|
||||||
|
)
|
||||||
return self.content
|
return self.content
|
||||||
|
|
||||||
def get_raw_content(self):
|
def get_raw_content(self):
|
||||||
|
@ -30,7 +30,7 @@
|
|||||||
<field name="inherit_id" ref="document_page.view_wiki_menu_form" />
|
<field name="inherit_id" ref="document_page.view_wiki_menu_form" />
|
||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<field name="content" position="attributes">
|
<field name="content" position="attributes">
|
||||||
<attribute name="invisible">1</attribute>
|
<attribute name="class">oe_edit_only</attribute>
|
||||||
</field>
|
</field>
|
||||||
<field name="content" position="before">
|
<field name="content" position="before">
|
||||||
<field
|
<field
|
||||||
|
Loading…
Reference in New Issue
Block a user