[16.0][MIG] document_page_approval: Migration to 16.0

This commit is contained in:
FernandoRomera 2022-12-13 13:01:55 +01:00
parent 1b4724e0b1
commit 2231710de5
7 changed files with 27 additions and 13 deletions

View File

@ -3,7 +3,7 @@
{
"name": "Document Page Approval",
"version": "15.0.1.0.0",
"version": "16.0.1.0.0",
"author": "Savoir-faire Linux, Odoo Community Association (OCA)",
"website": "https://github.com/OCA/knowledge",
"license": "AGPL-3",

View File

@ -1,4 +1,4 @@
<?xml version="1.0" ?>
<?xml version="1.0" encoding="UTF-8" ?>
<odoo>
<!-- If user wants to make upgrade-proof customizations to email templates, he should edit ir.model.data and check noupdate himself -->
<record id="email_template_new_draft_need_approval" model="mail.template">

View File

@ -2,7 +2,7 @@
<odoo>
<record id="group_document_approver_user" model="res.groups">
<field name="name">Approver</field>
<field name="category_id" ref="knowledge.module_category_knowledge" />
<field name="category_id" ref="document_knowledge.module_category_knowledge" />
<field
name="implied_ids"
eval="[(4, ref('document_page.group_document_editor'))]"
@ -14,7 +14,10 @@
<record model="ir.rule" id="rule_change_request_global">
<field name="name">Change Request Global</field>
<field name="model_id" ref="model_document_page_history" />
<field name="groups" eval="[(6, 0, [ref('knowledge.group_document_user')])]" />
<field
name="groups"
eval="[(6, 0, [ref('document_knowledge.group_document_user')])]"
/>
<field
name="domain_force"
>['|',('state','=','approved'),('create_uid','=',user.id)]</field>

View File

@ -46,7 +46,7 @@ class TestDocumentPageApproval(common.TransactionCase):
self.assertEqual(chreq.state, "to approve")
# Needed to compute calculated fields
page.refresh()
page.invalidate_model()
self.assertNotEqual(chreq.content, page.content)
# who_am_i
@ -61,7 +61,7 @@ class TestDocumentPageApproval(common.TransactionCase):
# new changes should create change requests
page.write({"content": "New content"})
# Needed to compute calculated fields
page.refresh()
page.invalidate_model()
self.assertNotEqual(page.content, "New content")
chreq = self.history_obj.search(
[("page_id", "=", page.id), ("state", "!=", "approved")]

View File

@ -1,4 +1,4 @@
<?xml version="1.0" ?>
<?xml version="1.0" encoding="UTF-8" ?>
<odoo>
<!-- History Form View -->
<record id="wiki_history_form_inherit" model="ir.ui.view">
@ -112,16 +112,20 @@
<field name="name">document.page.history.form</field>
<field name="model">document.page.history</field>
<field name="inherit_id" ref="wiki_history_form_inherit" />
<field
name="groups_id"
eval="[(6, 0, [ref('document_page.group_document_manager')])]"
/>
<field name="arch" type="xml">
<!-- Readonly fields -->
<field name="name" position="attributes">
<field
name="name"
position="attributes"
groups="document_page.group_document_manager"
>
<attribute name="attrs">{'readonly': False}</attribute>
</field>
<field name="summary" position="attributes">
<field
name="summary"
position="attributes"
groups="document_page.group_document_manager"
>
<attribute name="attrs">{'readonly': False}</attribute>
</field>
</field>

View File

@ -0,0 +1 @@
../../../../document_page_approval

View File

@ -0,0 +1,6 @@
import setuptools
setuptools.setup(
setup_requires=['setuptools-odoo'],
odoo_addon=True,
)