mirror of
https://github.com/OCA/knowledge.git
synced 2025-07-15 19:52:56 -06:00
[MIG] document_page: Migration to 11.0
continue migration
This commit is contained in:
parent
0c214239fe
commit
612e1235b7
@ -30,7 +30,7 @@ To use this module, you need to:
|
|||||||
|
|
||||||
.. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas
|
.. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas
|
||||||
:alt: Try me on Runbot
|
: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
|
Known issues / Roadmap
|
||||||
======================
|
======================
|
||||||
|
@ -54,13 +54,6 @@ class DocumentPage(models.Model):
|
|||||||
"for all new page of this category.",
|
"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(
|
history_head = fields.Many2one(
|
||||||
'document.page.history',
|
'document.page.history',
|
||||||
'HEAD',
|
'HEAD',
|
||||||
@ -116,14 +109,7 @@ class DocumentPage(models.Model):
|
|||||||
return r
|
return r
|
||||||
|
|
||||||
@api.multi
|
@api.multi
|
||||||
@api.depends('content')
|
@api.depends('history_head')
|
||||||
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')
|
|
||||||
def _compute_content(self):
|
def _compute_content(self):
|
||||||
for rec in self:
|
for rec in self:
|
||||||
if rec.type == 'category':
|
if rec.type == 'category':
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
|
from odoo.exceptions import UserError
|
||||||
from odoo.tests import common
|
from odoo.tests import common
|
||||||
from odoo import _
|
|
||||||
|
|
||||||
|
|
||||||
class TestDocumentPageShowDiff(common.TransactionCase):
|
class TestDocumentPageShowDiff(common.TransactionCase):
|
||||||
@ -26,10 +25,7 @@ class TestDocumentPageShowDiff(common.TransactionCase):
|
|||||||
|
|
||||||
history_pages = history_document.search([('page_id', '=', page.id)])
|
history_pages = history_document.search([('page_id', '=', page.id)])
|
||||||
|
|
||||||
with self.assertRaises(Exception) as context:
|
with self.assertRaises(UserError):
|
||||||
show_diff_object.with_context(
|
show_diff_object.with_context(
|
||||||
active_ids=[i.id for i in history_pages]
|
active_ids=[i.id for i in history_pages]
|
||||||
)._get_diff()
|
)._get_diff()
|
||||||
|
|
||||||
self.assertTrue(_("Select one or maximum two history revisions!")
|
|
||||||
in context.exception)
|
|
||||||
|
@ -64,7 +64,6 @@ class DocumentPageCreateMenu(models.TransientModel):
|
|||||||
menu_id = obj_menu.sudo().create({
|
menu_id = obj_menu.sudo().create({
|
||||||
'name': data.menu_name,
|
'name': data.menu_name,
|
||||||
'parent_id': data.menu_parent_id.id,
|
'parent_id': data.menu_parent_id.id,
|
||||||
'icon': 'STOCK_DIALOG_QUESTION',
|
|
||||||
'action': 'ir.actions.act_window,' + str(action_id.id),
|
'action': 'ir.actions.act_window,' + str(action_id.id),
|
||||||
})
|
})
|
||||||
page.write({'menu_id': menu_id.id})
|
page.write({'menu_id': menu_id.id})
|
||||||
|
Loading…
Reference in New Issue
Block a user