[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:
Iván Todorovich
2018-04-20 10:42:10 -03:00
committed by Justine Doutreloux
parent 3241e9ae54
commit f534207697
7 changed files with 99 additions and 18 deletions

View File

@@ -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']