mirror of
https://github.com/OCA/knowledge.git
synced 2025-12-19 03:42:19 -06:00
[document_page] FIX creating history when there are no changes made. Add history name field, to name revisions. Modified views to allow setting this field.
[document_page] FIX BUG: UI hanging when editing content. This was due to the api.depends on _compute_diff. Removing it because it's not really necessary since the field is not stored. [document_page] page_id should be readonly. Improve active field [document_page] Update version number [UPD] Update document_page.pot [MIG] document_page_multi_company (#188) * [MIG] document_page_multi_company Added this feature from the old module directly in document_page
This commit is contained in:
committed by
Justine Doutreloux
parent
3241e9ae54
commit
f534207697
@@ -14,12 +14,22 @@ class DocumentPageHistory(models.Model):
|
||||
_order = 'id DESC'
|
||||
|
||||
page_id = fields.Many2one('document.page', 'Page', ondelete='cascade')
|
||||
summary = fields.Char('Summary', index=True)
|
||||
content = fields.Text("Content")
|
||||
name = fields.Char(index=True)
|
||||
summary = fields.Char(index=True)
|
||||
content = fields.Text()
|
||||
diff = fields.Text(compute='_compute_diff')
|
||||
|
||||
company_id = fields.Many2one(
|
||||
'res.company',
|
||||
'Company',
|
||||
help='If set, page is accessible only from this company',
|
||||
related='page_id.company_id',
|
||||
store=True,
|
||||
index=True,
|
||||
readonly=True,
|
||||
)
|
||||
|
||||
@api.multi
|
||||
@api.depends('content', 'page_id.history_ids')
|
||||
def _compute_diff(self):
|
||||
"""Shows a diff between this version and the previous version"""
|
||||
history = self.env['document.page.history']
|
||||
|
||||
Reference in New Issue
Block a user