diff --git a/.travis.yml b/.travis.yml index 96d6c780e70..187571898b1 100644 --- a/.travis.yml +++ b/.travis.yml @@ -20,8 +20,8 @@ env: - secure: "k8/ebCIiOPGEIcL4Pzji2tanrjAzP5bqY0dSOmZwdNVNfncCrQREYbQgPhuTJHKuEX5E76kCuJJE70x0PEFhtaJt6K8KLvIF3B7/FJNUdXy6cjOKgBNfJuBSJRmkRM8mfxS2K+mqi4R3OEy4R2v4X/syK6F7vKxNhcRmindDfY8=" matrix: - - LINT_CHECK="1" - - TRANSIFEX="1" + - LINT_CHECK="1" + - TRANSIFEX="1" - TESTS="1" ODOO_REPO="OCA/OCB" - TESTS="1" ODOO_REPO="odoo/odoo" diff --git a/attachment_preview/i18n/tr.po b/attachment_preview/i18n/tr.po new file mode 100644 index 00000000000..1abf07fa884 --- /dev/null +++ b/attachment_preview/i18n/tr.po @@ -0,0 +1,30 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * attachment_preview +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 12.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2022-01-06 16:40+0000\n" +"Last-Translator: Yavuz Avci \n" +"Language-Team: none\n" +"Language: tr\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=2; plural=n != 1;\n" +"X-Generator: Weblate 4.3.2\n" + +#. module: attachment_preview +#: model:ir.model,name:attachment_preview.model_ir_attachment +msgid "Attachment" +msgstr "Ek" + +#. module: attachment_preview +#. openerp-web +#: code:addons/attachment_preview/static/src/js/attachment_preview.js:188 +#: code:addons/attachment_preview/static/src/js/attachment_preview.js:216 +#, python-format +msgid "Preview %s" +msgstr "%s Önizle" diff --git a/document_page/__manifest__.py b/document_page/__manifest__.py index 12fc41e6661..47bc367db11 100644 --- a/document_page/__manifest__.py +++ b/document_page/__manifest__.py @@ -3,36 +3,31 @@ { - 'name': 'Document Page', - 'version': '12.0.1.2.0', - 'category': 'Knowledge Management', - 'author': 'OpenERP SA, Odoo Community Association (OCA)', - 'images': [ - 'images/category_list.png', - 'images/create_category.png', - 'images/page_list.png', - 'images/create_page.png', - 'images/customer_invoice.jpeg', - 'images/page_history.png', + "name": "Documentation Page", + "version": "12.0.1.4.0", + "category": "Knowledge Management", + "author": "OpenERP SA, Odoo Community Association (OCA)", + "images": [ + "images/category_list.png", + "images/create_category.png", + "images/page_list.png", + "images/create_page.png", + "images/customer_invoice.jpeg", + "images/page_history.png", ], - 'website': 'https://github.com/OCA/knowledge', - 'license': 'AGPL-3', - 'depends': [ - 'mail', - 'knowledge', - ], - 'data': [ - 'security/document_page_security.xml', - 'security/ir.model.access.csv', - 'wizard/document_page_create_menu.xml', - 'wizard/document_page_show_diff.xml', - 'views/document_page.xml', - 'views/document_page_category.xml', - 'views/document_page_history.xml', - 'views/document_page_assets.xml', - 'views/report_document_page.xml', - ], - 'demo': [ - 'demo/document_page.xml' + "website": "https://github.com/OCA/knowledge", + "license": "AGPL-3", + "depends": ["mail", "knowledge"], + "data": [ + "security/document_page_security.xml", + "security/ir.model.access.csv", + "wizard/document_page_create_menu.xml", + "wizard/document_page_show_diff.xml", + "views/document_page.xml", + "views/document_page_category.xml", + "views/document_page_history.xml", + "views/document_page_assets.xml", + "views/report_document_page.xml", ], + "demo": ["demo/document_page.xml"], } diff --git a/document_page/demo/document_page.xml b/document_page/demo/document_page.xml index a45a115731e..f3c959b3eb3 100644 --- a/document_page/demo/document_page.xml +++ b/document_page/demo/document_page.xml @@ -1,9 +1,11 @@ - + - + @@ -11,7 +13,7 @@ 1.0 Init category - + Summary of the feature Long explanation @@ -25,7 +27,7 @@ Additional ressources OpenERP 6.1. Functional Demo - + 1.0 Init @@ -56,7 +58,7 @@ company, with your clients and implement it now for your business.
Personalise Dashboards - + 1.0 Init @@ -99,7 +101,7 @@ you change your mind there is a reset button to return to the default view.
Touchscreen Point of Sale - + 1.0 Init diff --git a/document_page/models/document_page.py b/document_page/models/document_page.py index 84cb012c6bc..56582c3d0e8 100644 --- a/document_page/models/document_page.py +++ b/document_page/models/document_page.py @@ -1,7 +1,7 @@ # Copyright (C) 2004-2010 Tiny SPRL (). # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -from odoo import api, fields, models, _ +from odoo import _, api, fields, models from odoo.exceptions import ValidationError @@ -9,49 +9,46 @@ class DocumentPage(models.Model): """This class is use to manage Document.""" _name = "document.page" - _inherit = ['mail.thread', 'mail.activity.mixin'] + _inherit = ["mail.thread", "mail.activity.mixin"] _description = "Document Page" - _order = 'name' + _parent_name = "parent_id" + _parent_store = True + _rec_name = "complete_name" + _order = "type, sequence, complete_name" - name = fields.Char('Title', required=True) + name = fields.Char("Title", required=True) type = fields.Selection( - [('content', 'Content'), ('category', 'Category')], - 'Type', + [("content", "Content"), ("category", "Category")], + "Type", help="Page type", - default="content" + default="content", ) active = fields.Boolean(default=True) parent_id = fields.Many2one( - 'document.page', - 'Category', - domain=[('type', '=', 'category')] - ) - child_ids = fields.One2many( - 'document.page', - 'parent_id', - 'Children' + "document.page", "Category", domain=[("type", "=", "category")] ) + child_ids = fields.One2many("document.page", "parent_id", "Children") content = fields.Text( "Content", - compute='_compute_content', - inverse='_inverse_content', - search='_search_content', + compute="_compute_content", + inverse="_inverse_content", + search="_search_content", required=True, copy=True, ) # no-op computed field draft_name = fields.Char( - string='Name', - help='Name for the changes made', + string="Name", + help="Name for the changes made", compute=lambda x: x, inverse=lambda x: x, ) # no-op computed field draft_summary = fields.Char( - string='Summary', - help='Describe the changes made', + string="Summary", + help="Describe the changes made", compute=lambda x: x, inverse=lambda x: x, ) @@ -59,58 +56,88 @@ class DocumentPage(models.Model): template = fields.Html( "Template", help="Template that will be used as a content template " - "for all new page of this category.", + "for all new page of this category.", ) history_head = fields.Many2one( - 'document.page.history', - 'HEAD', - compute='_compute_history_head', + "document.page.history", + "HEAD", + compute="_compute_history_head", store=True, auto_join=True, ) history_ids = fields.One2many( - 'document.page.history', - 'page_id', - 'History', - order='create_date DESC', - readonly=True, - ) - menu_id = fields.Many2one( - 'ir.ui.menu', - "Menu", + "document.page.history", + "page_id", + "History", + order="create_date DESC", readonly=True, ) + menu_id = fields.Many2one("ir.ui.menu", "Menu", readonly=True,) content_date = fields.Datetime( - 'Last Contribution Date', - related='history_head.create_date', + "Last Contribution Date", + related="history_head.create_date", store=True, index=True, readonly=True, ) content_uid = fields.Many2one( - 'res.users', - 'Last Contributor', - related='history_head.create_uid', + "res.users", + "Last Contributor", + related="history_head.create_uid", store=True, index=True, readonly=True, ) company_id = fields.Many2one( - 'res.company', - 'Company', - help='If set, page is accessible only from this company', + "res.company", + "Company", + help="If set, page is accessible only from this company", index=True, - ondelete='cascade', + ondelete="cascade", ) backend_url = fields.Char( - string='Backend URL', - help='Use it to link resources univocally', - compute='_compute_backend_url', + string="Backend URL", + help="Use it to link resources univocally", + compute="_compute_backend_url", + ) + + sequence = fields.Integer( + string="Sequence", default=10, help="Used to organise the category." + ) + + parent_path = fields.Char(index=True) + complete_name = fields.Char( + "Complete Name", compute="_compute_complete_name", store=True ) - @api.depends('menu_id', 'parent_id.menu_id') + image = fields.Binary("Image", attachment=True,) + + color = fields.Integer(string="Color Index") + + @api.multi + def write(self, vals): + child_ids = self + if vals.get("color", False) and len(vals) == 1: + child_ids = self.search( + [("type", "=", "category"), + ("parent_id", "child_of", self.ids)] + ) + res = super(DocumentPage, child_ids).write(vals) + return res + + @api.depends("name", "parent_id.complete_name") + def _compute_complete_name(self): + for category in self: + if category.parent_id: + category.complete_name = "{} / {}".format( + category.parent_id.complete_name, category.name, + ) + else: + category.complete_name = category.name + + @api.depends("menu_id", "parent_id.menu_id") def _compute_backend_url(self): - tmpl = '/web#id={}&model=document.page&view_type=form' + tmpl = "/web#id={}&model=document.page&view_type=form" for rec in self: url = tmpl.format(rec.id) # retrieve action @@ -120,13 +147,13 @@ def _compute_backend_url(self): action = parent.menu_id.action parent = parent.parent_id if action: - url += '&action={}'.format(action.id) + url += "&action={}".format(action.id) rec.backend_url = url - @api.constrains('parent_id') + @api.constrains("parent_id") def _check_parent_id(self): if not self._check_recursion(): - raise ValidationError(_('You cannot create recursive categories.')) + raise ValidationError(_("You cannot create recursive categories.")) @api.multi def _get_page_index(self, link=True): @@ -135,7 +162,7 @@ def _get_page_index(self, link=True): index = [] for subpage in self.child_ids: index += ["
  • " + subpage._get_page_index() + "
  • "] - r = '' + r = "" if link: r = '{}'.format(self.backend_url, self.name) if index: @@ -143,35 +170,37 @@ def _get_page_index(self, link=True): return r @api.multi - @api.depends('history_head') + @api.depends("history_head") def _compute_content(self): for rec in self: - if rec.type == 'category': + if rec.type == "category": rec.content = rec._get_page_index(link=False) else: if rec.history_head: rec.content = rec.history_head.content else: # html widget's default, so it doesn't trigger ghost save - rec.content = '


    ' + rec.content = "


    " @api.multi def _inverse_content(self): for rec in self: - if rec.type == 'content' and \ - rec.content != rec.history_head.content: - rec._create_history({ - 'name': rec.draft_name, - 'summary': rec.draft_summary, - 'content': rec.content, - }) + if rec.type == "content" \ + and rec.content != rec.history_head.content: + rec._create_history( + { + "name": rec.draft_name, + "summary": rec.draft_summary, + "content": rec.content, + } + ) @api.multi def _search_content(self, operator, value): - return [('history_head.content', operator, value)] + return [("history_head.content", operator, value)] @api.multi - @api.depends('history_ids') + @api.depends("history_ids") def _compute_history_head(self): for rec in self: if rec.history_ids: @@ -180,20 +209,20 @@ def _compute_history_head(self): @api.multi def _create_history(self, vals): self.ensure_one() - history = self.env['document.page.history'] - vals['page_id'] = self.id + history = self.env["document.page.history"] + vals["page_id"] = self.id return history.create(vals) @api.onchange("parent_id") def _onchange_parent_id(self): """We Set it the right content to the new parent.""" - if not self.content or self.content == '


    ': + if not self.content or self.content == "


    ": if self.parent_id and self.parent_id.type == "category": - self.content = self.parent_id.template + self.content = self.parent_id.template @api.multi def unlink(self): - menus = self.mapped('menu_id') + menus = self.mapped("menu_id") res = super().unlink() menus.unlink() return res diff --git a/document_page/models/document_page_history.py b/document_page/models/document_page_history.py index 7467cf05afa..bb27a2042ec 100644 --- a/document_page/models/document_page_history.py +++ b/document_page/models/document_page_history.py @@ -2,6 +2,7 @@ # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). import difflib + from odoo import api, fields, models from odoo.tools.translate import _ @@ -11,19 +12,19 @@ class DocumentPageHistory(models.Model): _name = "document.page.history" _description = "Document Page History" - _order = 'id DESC' + _order = "id DESC" - page_id = fields.Many2one('document.page', 'Page', ondelete='cascade') + page_id = fields.Many2one("document.page", "Page", ondelete="cascade") name = fields.Char(index=True) summary = fields.Char(index=True) content = fields.Text() - diff = fields.Text(compute='_compute_diff') + 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', + "res.company", + "Company", + help="If set, page is accessible only from this company", + related="page_id.company_id", store=True, index=True, readonly=True, @@ -32,13 +33,16 @@ class DocumentPageHistory(models.Model): @api.multi def _compute_diff(self): """Shows a diff between this version and the previous version""" - history = self.env['document.page.history'] + history = self.env["document.page.history"] for rec in self: - prev = history.search([ - ('page_id', '=', rec.page_id.id), - ('create_date', '<', rec.create_date)], + prev = history.search( + [ + ("page_id", "=", rec.page_id.id), + ("create_date", "<", rec.create_date), + ], limit=1, - order='create_date DESC') + order="create_date DESC", + ) if prev: rec.diff = self._get_diff(prev.id, rec.id) else: @@ -47,23 +51,24 @@ def _compute_diff(self): @api.model def _get_diff(self, v1, v2): """Return the difference between two version of document version.""" - text1 = v1 and self.browse(v1).content or '' - text2 = v2 and self.browse(v2).content or '' + text1 = v1 and self.browse(v1).content or "" + text2 = v2 and self.browse(v2).content or "" # Include line breaks to make it more readable # TODO: consider using a beautify library directly on the content - text1 = text1.replace('

    ', '

    \r\n

    ') - text2 = text2.replace('

    ', '

    \r\n

    ') + text1 = text1.replace("

    ", "

    \r\n

    ") + text2 = text2.replace("

    ", "

    \r\n

    ") line1 = text1.splitlines(True) line2 = text2.splitlines(True) if line1 == line2: - return _('There are no changes in revisions.') + return _("There are no changes in revisions.") else: diff = difflib.HtmlDiff() return diff.make_table( - line1, line2, + line1, + line2, "Revision-{}".format(v1), "Revision-{}".format(v2), - context=True + context=True, ) @api.multi diff --git a/document_page/readme/CONTRIBUTORS.rst b/document_page/readme/CONTRIBUTORS.rst index f8ecb21033a..53394afd83c 100644 --- a/document_page/readme/CONTRIBUTORS.rst +++ b/document_page/readme/CONTRIBUTORS.rst @@ -8,3 +8,7 @@ * `Tecnativa `_: * Víctor Martínez + +* Mind And Go : + + * Florent THOMAS diff --git a/document_page/readme/USAGE.rst b/document_page/readme/USAGE.rst index 8576f8fc582..2362027f636 100644 --- a/document_page/readme/USAGE.rst +++ b/document_page/readme/USAGE.rst @@ -1,5 +1,5 @@ To use this module, you need to: * Go to Knowledge menu -* Click on Categories to create the document's category you need with the template +* Click on Categories to create the documentation's category you need with the template * Click on Pages to create pages and select the previous category to use the template diff --git a/document_page/security/document_page_security.xml b/document_page/security/document_page_security.xml index e05a28118f1..331c92b4089 100644 --- a/document_page/security/document_page_security.xml +++ b/document_page/security/document_page_security.xml @@ -1,31 +1,38 @@ - + Editor - - + + Manager - - - + + + document_page multi-company - - - ['|',('company_id','=',False),('company_id','child_of',[user.company_id.id])] + + + ['|',('company_id','=',False),('company_id','child_of',[user.company_id.id])] document_page_history multi-company - - - ['|',('company_id','=',False),('company_id','child_of',[user.company_id.id])] + + + ['|',('company_id','=',False),('company_id','child_of',[user.company_id.id])] diff --git a/document_page/static/src/css/document_page.css b/document_page/static/src/css/document_page.css index 00a6336c226..7216ecd7e0c 100644 --- a/document_page/static/src/css/document_page.css +++ b/document_page/static/src/css/document_page.css @@ -1,29 +1,28 @@ table.diff { - font-family: Courier; - border: medium; + font-family: Courier; + border: medium; } table.diff .diff_header { - background-color: #e0e0e0 + background-color: #e0e0e0; } table.diff td.diff_header { - text-align: right + text-align: right; } table.diff .diff_next { - background-color:#c0c0c0 + background-color: #c0c0c0; } table.diff .diff_add { - background-color:#aaffaa + background-color: #aaffaa; } table.diff .diff_chg { - background-color:#ffff77 + background-color: #ffff77; } table.diff .diff_sub { - background-color:#ffaaaa + background-color: #ffaaaa; } - diff --git a/document_page/static/src/js/document_page_kanban.js b/document_page/static/src/js/document_page_kanban.js new file mode 100644 index 00000000000..18af8b414da --- /dev/null +++ b/document_page/static/src/js/document_page_kanban.js @@ -0,0 +1,28 @@ +odoo.define("document_page.update_kanban", function(require) { + "use strict"; + + var KanbanRecord = require("web.KanbanRecord"); + + KanbanRecord.include({ + // -------------------------------------------------------------------------- + // Private + // -------------------------------------------------------------------------- + + /** + * @override + * @private + */ + _openRecord: function() { + if ( + this.modelName === "document.page" && + this.$(".o_document_page_kanban_boxes a").length + ) { + this.$(".o_document_page_kanban_boxes a") + .first() + .click(); + } else { + this._super.apply(this, arguments); + } + } + }); +}); diff --git a/document_page/tests/test_document_page.py b/document_page/tests/test_document_page.py index 3a67f08eaca..1689d74d85b 100644 --- a/document_page/tests/test_document_page.py +++ b/document_page/tests/test_document_page.py @@ -3,55 +3,53 @@ class TestDocumentPage(common.TransactionCase): - def setUp(self): super(TestDocumentPage, self).setUp() - self.page_obj = self.env['document.page'] - self.history_obj = self.env['document.page.history'] - self.category1 = self.env.ref('document_page.demo_category1') - self.page1 = self.env.ref('document_page.demo_page1') + self.page_obj = self.env["document.page"] + self.history_obj = self.env["document.page.history"] + self.category1 = self.env.ref("document_page.demo_category1") + self.page1 = self.env.ref("document_page.demo_page1") def test_page_creation(self): - page = self.page_obj.create({ - 'name': 'Test Page 1', - 'parent_id': self.category1.id, - 'content': 'Test content' - }) - self.assertEqual(page.content, 'Test content') + page = self.page_obj.create( + { + "name": "Test Page 1", + "parent_id": self.category1.id, + "content": "Test content", + } + ) + self.assertEqual(page.content, "Test content") self.assertEqual(len(page.history_ids), 1) - page.content = 'New content for Demo Page' + page.content = "New content for Demo Page" self.assertEqual(len(page.history_ids), 2) def test_category_template(self): - page = self.page_obj.create({ - 'name': 'Test Page 2', - 'parent_id': self.category1.id, - }) + page = self.page_obj.create( + {"name": "Test Page 2", "parent_id": self.category1.id} + ) page._onchange_parent_id() self.assertEqual(page.content, self.category1.template) def test_page_history_diff(self): page = self.page_obj.create({ - 'name': 'Test Page 3', - 'content': 'Test content' - }) - page.content = 'New content' + "name": "Test Page 3", + "content": "Test content"}) + page.content = "New content" self.assertIsNotNone(page.history_ids[0].diff) def test_page_link(self): page = self.page_obj.create({ - 'name': 'Test Page 3', - 'content': 'Test content' - }) + "name": "Test Page 3", + "content": "Test content"}) self.assertEqual( page.backend_url, - '/web#id={}&model=document.page&view_type=form'.format(page.id) + "/web#id={}&model=document.page&view_type=form".format(page.id), ) - menu = self.env.ref('knowledge.menu_document') + menu = self.env.ref("knowledge.menu_document") page.menu_id = menu self.assertEqual( page.backend_url, - '/web#id={}&model=document.page&view_type=form&action={}'.format( + "/web#id={}&model=document.page&view_type=form&action={}".format( page.id, menu.action.id - ) + ), ) diff --git a/document_page/tests/test_document_page_create_menu.py b/document_page/tests/test_document_page_create_menu.py index 96c21e24934..82dbf378311 100644 --- a/document_page/tests/test_document_page_create_menu.py +++ b/document_page/tests/test_document_page_create_menu.py @@ -7,23 +7,23 @@ class TestDocumentPageCreateMenu(common.TransactionCase): def test_page_menu_creation(self): """Test page menu creation.""" - menu_parent = self.env.ref('knowledge.menu_document') + menu_parent = self.env.ref("knowledge.menu_document") - menu_created = self.env['document.page.create.menu'].create( - {'menu_name': 'Wiki Test menu', 'menu_parent_id': menu_parent.id} + menu_created = self.env["document.page.create.menu"].create( + {"menu_name": "Wiki Test menu", "menu_parent_id": menu_parent.id} ) - menu = self.env['document.page.create.menu'].search( - [('id', '=', menu_created.id)] + menu = self.env["document.page.create.menu"].search( + [("id", "=", menu_created.id)] ) menu.with_context( - active_id=[self.ref('document_page.demo_page1')] + active_id=[self.ref("document_page.demo_page1")] ).document_page_menu_create() fields_list = ["menu_name", "menu_name"] res = menu.with_context( - active_id=[self.ref('document_page.demo_page1')] + active_id=[self.ref("document_page.demo_page1")] ).default_get(fields_list) - self.assertEqual(res['menu_name'], 'OpenERP 6.1. Functional Demo') + self.assertEqual(res["menu_name"], "OpenERP 6.1. Functional Demo") diff --git a/document_page/tests/test_document_page_history.py b/document_page/tests/test_document_page_history.py index a80f4cc4964..856be77f783 100644 --- a/document_page/tests/test_document_page_history.py +++ b/document_page/tests/test_document_page_history.py @@ -1,4 +1,3 @@ - from odoo.tests import common @@ -7,14 +6,14 @@ class TestDocumentPageHistory(common.TransactionCase): def test_page_history_demo_page1(self): """Test page history demo page1.""" - page = self.env.ref('document_page.demo_page1') - page.content = 'Test content updated' - history_document = self.env['document.page.history'] - history_pages = history_document.search([('page_id', '=', page.id)]) + page = self.env.ref("document_page.demo_page1") + page.content = "Test content updated" + history_document = self.env["document.page.history"] + history_pages = history_document.search([("page_id", "=", page.id)]) active_ids = [i.id for i in history_pages] result = history_document._get_diff(active_ids[0], active_ids[0]) - self.assertEqual(result, 'There are no changes in revisions.') + self.assertEqual(result, "There are no changes in revisions.") result = history_document._get_diff(active_ids[0], active_ids[1]) - self.assertNotEqual(result, 'There are no changes in revisions.') + self.assertNotEqual(result, "There are no changes in revisions.") diff --git a/document_page/tests/test_document_page_show_diff.py b/document_page/tests/test_document_page_show_diff.py index 34bc16f7045..811c35e7cde 100644 --- a/document_page/tests/test_document_page_show_diff.py +++ b/document_page/tests/test_document_page_show_diff.py @@ -8,12 +8,12 @@ class TestDocumentPageShowDiff(common.TransactionCase): def test_show_demo_page1_diff(self): """Show test page history difference.""" - page = self.env.ref('document_page.demo_page1') + page = self.env.ref("document_page.demo_page1") - show_diff_object = self.env['wizard.document.page.history.show_diff'] + show_diff_object = self.env["wizard.document.page.history.show_diff"] - history_document = self.env['document.page.history'] - history_pages = history_document.search([('page_id', '=', page.id)]) + history_document = self.env["document.page.history"] + history_pages = history_document.search([("page_id", "=", page.id)]) self.assertTrue( show_diff_object.with_context( @@ -21,10 +21,10 @@ def test_show_demo_page1_diff(self): )._get_diff() ) - page.write({'content': 'Text content updated'}) - page.write({'content': 'Text updated'}) + page.write({"content": "Text content updated"}) + page.write({"content": "Text updated"}) - history_pages = history_document.search([('page_id', '=', page.id)]) + history_pages = history_document.search([("page_id", "=", page.id)]) with self.assertRaises(UserError): show_diff_object.with_context( diff --git a/document_page/views/document_page.xml b/document_page/views/document_page.xml index d30d419e3f0..bb81201deda 100644 --- a/document_page/views/document_page.xml +++ b/document_page/views/document_page.xml @@ -1,4 +1,4 @@ - + @@ -9,9 +9,9 @@ 100 - - - + + + @@ -22,12 +22,12 @@ document.page - - - - - - + + + + + + @@ -41,27 +41,27 @@

    - +

    - +

    - +
    - - - - - + + + + + @@ -72,20 +72,20 @@ - - - - - + + + + +
    - - - + + +
    @@ -96,11 +96,11 @@ document.page
    - +

    - +

    - +
    @@ -111,15 +111,14 @@ document.page - - - - + + + + - - - + + + @@ -134,8 +133,8 @@ {'default_type': 'content'} form tree,form - - + +

    Click to create a new web page. @@ -144,40 +143,26 @@ - + tree - - + + - + form - - + + - + - + - + diff --git a/document_page/views/document_page_assets.xml b/document_page/views/document_page_assets.xml index b85b0e06fbc..a192ea4ddee 100644 --- a/document_page/views/document_page_assets.xml +++ b/document_page/views/document_page_assets.xml @@ -1,9 +1,20 @@ - + -