mirror of
https://github.com/OCA/knowledge.git
synced 2025-07-16 12:12:57 -06:00
Merge 06d6817a58
into 996711d2f9
This commit is contained in:
commit
d38dac855f
@ -36,15 +36,15 @@ class DocumentPage(models.Model):
|
|||||||
draft_name = fields.Char(
|
draft_name = fields.Char(
|
||||||
string="Name",
|
string="Name",
|
||||||
help="Name for the changes made",
|
help="Name for the changes made",
|
||||||
related="history_head.name",
|
compute="_compute_content",
|
||||||
readonly=False,
|
inverse="_inverse_content",
|
||||||
)
|
)
|
||||||
|
|
||||||
draft_summary = fields.Char(
|
draft_summary = fields.Char(
|
||||||
string="Summary",
|
string="Summary",
|
||||||
help="Describe the changes made",
|
help="Describe the changes made",
|
||||||
related="history_head.summary",
|
compute="_compute_content",
|
||||||
readonly=False,
|
inverse="_inverse_content",
|
||||||
)
|
)
|
||||||
|
|
||||||
template = fields.Html(
|
template = fields.Html(
|
||||||
@ -132,12 +132,18 @@ class DocumentPage(models.Model):
|
|||||||
for rec in self:
|
for rec in self:
|
||||||
if rec.type == "category":
|
if rec.type == "category":
|
||||||
rec.content = rec._get_page_index(link=False)
|
rec.content = rec._get_page_index(link=False)
|
||||||
|
rec.draft_name = False
|
||||||
|
rec.draft_summary = False
|
||||||
else:
|
else:
|
||||||
if rec.history_head:
|
if rec.history_head:
|
||||||
rec.content = rec.history_head.content
|
rec.content = rec.history_head.content
|
||||||
|
rec.draft_name = rec.history_head.name
|
||||||
|
rec.draft_summary = rec.history_head.summary
|
||||||
else:
|
else:
|
||||||
# html widget's default, so it doesn't trigger ghost save
|
# html widget's default, so it doesn't trigger ghost save
|
||||||
rec.content = self._HTML_WIDGET_DEFAULT_VALUE
|
rec.content = self._HTML_WIDGET_DEFAULT_VALUE
|
||||||
|
rec.draft_name = False
|
||||||
|
rec.draft_summary = False
|
||||||
|
|
||||||
def _inverse_content(self):
|
def _inverse_content(self):
|
||||||
for rec in self:
|
for rec in self:
|
||||||
|
Loading…
Reference in New Issue
Block a user