From f9f666ba20d61d9c4316f31b94597793c6da24cb Mon Sep 17 00:00:00 2001 From: Gabriela Mogollon Date: Wed, 20 Jun 2018 18:03:36 +0000 Subject: [PATCH] [MIG] document_page: Migration to 11.0 continue migration --- document_page/README.rst | 2 +- document_page/models/document_page.py | 16 +--------------- .../tests/test_document_page_show_diff.py | 8 ++------ .../wizard/document_page_create_menu.py | 1 - 4 files changed, 4 insertions(+), 23 deletions(-) diff --git a/document_page/README.rst b/document_page/README.rst index b5f12436..978b2f71 100644 --- a/document_page/README.rst +++ b/document_page/README.rst @@ -30,7 +30,7 @@ To use this module, you need to: .. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas :alt: Try me on Runbot - :target: https://runbot.odoo-community.org/runbot/118/10.0 + :target: https://runbot.odoo-community.org/runbot/118/11.0 Known issues / Roadmap ====================== diff --git a/document_page/models/document_page.py b/document_page/models/document_page.py index 483ac526..24524210 100644 --- a/document_page/models/document_page.py +++ b/document_page/models/document_page.py @@ -54,13 +54,6 @@ class DocumentPage(models.Model): "for all new page of this category.", ) - # deprecated - should be removed on 11.0 - # left here because some modules might still need it - display_content = fields.Text( - string='Displayed Content', - compute='_compute_display_content' - ) - history_head = fields.Many2one( 'document.page.history', 'HEAD', @@ -116,14 +109,7 @@ class DocumentPage(models.Model): return r @api.multi - @api.depends('content') - def _compute_display_content(self): - # @deprecated, simply use content - for rec in self: - rec.display_content = rec.content - - @api.multi - @api.depends('history_head', 'history_ids') + @api.depends('history_head') def _compute_content(self): for rec in self: if rec.type == 'category': diff --git a/document_page/tests/test_document_page_show_diff.py b/document_page/tests/test_document_page_show_diff.py index 68f75b30..5044c443 100644 --- a/document_page/tests/test_document_page_show_diff.py +++ b/document_page/tests/test_document_page_show_diff.py @@ -1,6 +1,5 @@ - +from odoo.exceptions import UserError from odoo.tests import common -from odoo import _ class TestDocumentPageShowDiff(common.TransactionCase): @@ -26,10 +25,7 @@ class TestDocumentPageShowDiff(common.TransactionCase): history_pages = history_document.search([('page_id', '=', page.id)]) - with self.assertRaises(Exception) as context: + with self.assertRaises(UserError): show_diff_object.with_context( active_ids=[i.id for i in history_pages] )._get_diff() - - self.assertTrue(_("Select one or maximum two history revisions!") - in context.exception) diff --git a/document_page/wizard/document_page_create_menu.py b/document_page/wizard/document_page_create_menu.py index f9b9d1ce..b150ef85 100644 --- a/document_page/wizard/document_page_create_menu.py +++ b/document_page/wizard/document_page_create_menu.py @@ -64,7 +64,6 @@ class DocumentPageCreateMenu(models.TransientModel): menu_id = obj_menu.sudo().create({ 'name': data.menu_name, 'parent_id': data.menu_parent_id.id, - 'icon': 'STOCK_DIALOG_QUESTION', 'action': 'ir.actions.act_window,' + str(action_id.id), }) page.write({'menu_id': menu_id.id})