Skip to content

Commit

Permalink
[MIG] document_page: Migration to 11.0
Browse files Browse the repository at this point in the history
continue migration
  • Loading branch information
Gabriela Mogollon committed Jun 27, 2018
1 parent d0cc7ef commit 2fc70bc
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 23 deletions.
2 changes: 1 addition & 1 deletion document_page/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
======================
Expand Down
16 changes: 1 addition & 15 deletions document_page/models/document_page.py
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down Expand Up @@ -116,14 +109,7 @@ def _get_page_index(self, link=True):
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':
Expand Down
8 changes: 2 additions & 6 deletions document_page/tests/test_document_page_show_diff.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@

from odoo.exceptions import UserError
from odoo.tests import common
from odoo import _


class TestDocumentPageShowDiff(common.TransactionCase):
Expand All @@ -26,10 +25,7 @@ def test_show_demo_page1_diff(self):

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)
1 change: 0 additions & 1 deletion document_page/wizard/document_page_create_menu.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ def document_page_menu_create(self):
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})
Expand Down

0 comments on commit 2fc70bc

Please sign in to comment.