[MIG] document_page_project: Migration to 13.0

This commit is contained in:
Joan Sisquella 2020-01-15 12:40:00 +01:00
parent c8897ae4c9
commit cc9da35526
8 changed files with 52 additions and 35 deletions

View File

@ -1,14 +1,13 @@
# Copyright 2019 Eficent Business and IT Consulting Services S.L. # Copyright 2019 ForgeFlow S.L. (https://www.forgeflow.com) - Lois Rilo
# (http://www.eficent.com) - Lois Rilo
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
{ {
"name": "Document Page Project", "name": "Document Page Project",
"summary": "This module links document pages to projects", "summary": "This module links document pages to projects",
"version": "12.0.1.0.0", "version": "13.0.1.0.0",
"development_status": "Beta", "development_status": "Production/Stable",
"category": "Project", "category": "Project",
"author": "Eficent, " "Odoo Community Association (OCA)", "author": "ForgeFlow, Odoo Community Association (OCA)",
"website": "https://github.com/OCA/knowledge", "website": "https://github.com/OCA/knowledge",
"license": "AGPL-3", "license": "AGPL-3",
"depends": ["project", "document_page"], "depends": ["project", "document_page"],

View File

@ -1,5 +1,4 @@
# Copyright 2019 Eficent Business and IT Consulting Services S.L. # Copyright 2019 ForgeFlow S.L. (https://www.forgeflow.com)
# (http://www.eficent.com)
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
from odoo import fields, models from odoo import fields, models

View File

@ -1,8 +1,7 @@
# Copyright 2019 Eficent Business and IT Consulting Services S.L. # Copyright 2019 ForgeFlow S.L. (https://www.forgeflow.com)
# (http://www.eficent.com)
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
from odoo import api, fields, models from odoo import fields, models
class ProjectProject(models.Model): class ProjectProject(models.Model):
@ -13,7 +12,6 @@ class ProjectProject(models.Model):
) )
document_page_count = fields.Integer(compute="_compute_document_page_count") document_page_count = fields.Integer(compute="_compute_document_page_count")
@api.multi
def _compute_document_page_count(self): def _compute_document_page_count(self):
for rec in self: for rec in self:
rec.document_page_count = len(rec.document_page_ids) rec.document_page_count = len(rec.document_page_ids)

View File

@ -1,3 +1,3 @@
* `Eficent <https://www.eficent.com>`_: * `Forgeflow <https://www.forgeflow.com>`_:
* Lois Rilo <lois.rilo@eficent.com> * Lois Rilo <lois.rilo@forgeflow.com>

View File

@ -1,35 +1,36 @@
<?xml version="1.0"?> <?xml version="1.0" ?>
<odoo> <odoo>
<record id="view_wiki_form" model="ir.ui.view"> <record id="view_wiki_form" model="ir.ui.view">
<field name="name">document.page.form - document_page_project</field> <field name="name">document.page.form - document_page_project</field>
<field name="model">document.page</field> <field name="model">document.page</field>
<field name="inherit_id" ref="document_page.view_wiki_form"/> <field name="inherit_id" ref="document_page.view_wiki_form" />
<field name="arch" type="xml"> <field name="arch" type="xml">
<field name="parent_id" position="after"> <field name="parent_id" position="after">
<field name="project_id"/> <field name="project_id" />
</field> </field>
</field> </field>
</record> </record>
<record id="action_document_page_projects" model="ir.actions.act_window"> <record id="action_document_page_projects" model="ir.actions.act_window">
<field name="name">Project Wiki</field> <field name="name">Project Wiki</field>
<field name="res_model">document.page</field> <field name="res_model">document.page</field>
<field name="domain">[('type','=','content'), ('project_id', '=', active_id)]</field> <field
name="domain"
>[('type','=','content'), ('project_id', '=', active_id)]</field>
<field name="context">{ <field name="context">{
'default_type': 'content', 'default_type': 'content',
'default_project_id': active_id}</field> 'default_project_id': active_id}</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field> <field name="view_mode">tree,form</field>
<field name="view_ids" eval="[(5,0,0), <field
name="view_ids"
eval="[(5,0,0),
(0,0,{'view_mode':'tree', 'view_id': ref('document_page.view_wiki_tree')}), (0,0,{'view_mode':'tree', 'view_id': ref('document_page.view_wiki_tree')}),
(0,0,{'view_mode':'form', 'view_id': ref('document_page.view_wiki_form')})]"/> (0,0,{'view_mode':'form', 'view_id': ref('document_page.view_wiki_form')})]"
<field name="search_view_id" ref="document_page.view_wiki_filter"/> />
<field name="search_view_id" ref="document_page.view_wiki_filter" />
<field name="help" type="html"> <field name="help" type="html">
<p class="oe_view_nocontent_create"> <p class="oe_view_nocontent_create">
Click to create a new web page. Click to create a new web page.
</p> </p>
</field> </field>
</record> </record>
</odoo> </odoo>

View File

@ -1,15 +1,22 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8" ?>
<odoo> <odoo>
<record id="view_project_kanban" model="ir.ui.view"> <record id="view_project_kanban" model="ir.ui.view">
<field name="model">project.project</field> <field name="model">project.project</field>
<field name="inherit_id" ref="project.view_project_kanban"/> <field name="inherit_id" ref="project.view_project_kanban" />
<field name="arch" type="xml"> <field name="arch" type="xml">
<xpath expr="//div[hasclass('o_project_kanban_boxes')]" position="inside"> <xpath expr="//div[hasclass('o_project_kanban_boxes')]" position="inside">
<a class="o_project_kanban_box" name="%(action_document_page_projects)d" type="action"> <a
class="o_project_kanban_box"
name="%(action_document_page_projects)d"
type="action"
>
<div> <div>
<b> <b>
<field name="document_page_count" nolabel="1" class="o_value"/> <field
name="document_page_count"
nolabel="1"
class="o_value"
/>
</b> </b>
<span class="o_label">Wiki Pages</span> <span class="o_label">Wiki Pages</span>
</div> </div>
@ -17,19 +24,25 @@
</xpath> </xpath>
</field> </field>
</record> </record>
<record id="edit_project" model="ir.ui.view"> <record id="edit_project" model="ir.ui.view">
<field name="name">project.project.form - document_page_project</field> <field name="name">project.project.form - document_page_project</field>
<field name="model">project.project</field> <field name="model">project.project</field>
<field name="inherit_id" ref="project.edit_project"/> <field name="inherit_id" ref="project.edit_project" />
<field name="arch" type="xml"> <field name="arch" type="xml">
<div name="button_box" position="inside"> <div name="button_box" position="inside">
<button class="oe_stat_button" type="action" <button
name="%(action_document_page_projects)d" icon="fa-book"> class="oe_stat_button"
<field string="Wiki Pages" name="document_page_count" widget="statinfo"/> type="action"
name="%(action_document_page_projects)d"
icon="fa-book"
>
<field
string="Wiki Pages"
name="document_page_count"
widget="statinfo"
/>
</button> </button>
</div> </div>
</field> </field>
</record> </record>
</odoo> </odoo>

View File

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

View File

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