-
-
Notifications
You must be signed in to change notification settings - Fork 277
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[MIG] sale_layout_multi_company: Migration to 10.0
- Loading branch information
Showing
5 changed files
with
39 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,11 @@ | ||
# -*- coding: utf-8 -*- | ||
# Copyright 2016 Lorenzo Battistini - Agile Business Group | ||
# Copyright 2018 Simone Rubino - Agile Business Group | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). | ||
|
||
from openerp import models, fields, api | ||
from odoo import models | ||
|
||
|
||
class SaleLayoutCategory(models.Model): | ||
_inherit = 'sale_layout.category' | ||
|
||
@api.model | ||
def _default_company_id(self): | ||
company = self.env['res.company'] | ||
return company.browse(company._company_default_get( | ||
'sale_layout.category')) | ||
|
||
company_id = fields.Many2one( | ||
'res.company', string='Company', change_default=True, | ||
default=_default_company_id) | ||
_inherit = ['multi.company.abstract', 'sale.layout_category'] | ||
_name = 'sale.layout_category' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<openerp> | ||
<data noupdate="1"> | ||
<record id="account_move_comp_rule" model="ir.rule"> | ||
<field name="name">Sale layout multi company</field> | ||
<field name="model_id" ref="model_sale_layout_category"/> | ||
<field name="global" eval="True"/> | ||
<field name="domain_force">['|',('company_id','=',False),('company_id','child_of',[user.company_id.id])]</field> | ||
</record> | ||
</data> | ||
</openerp> | ||
<odoo> | ||
<data noupdate="1"> | ||
<record id="sale_layout_category_comp_rule" model="ir.rule"> | ||
<field name="name">Sale layout category multi company</field> | ||
<field name="model_id" ref="model_sale_layout_category"/> | ||
<field name="global" eval="True"/> | ||
<field name="domain_force">['|', ('company_ids', 'in', user.company_id.ids), ('company_id', '=', False)]</field> | ||
</record> | ||
</data> | ||
</odoo> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,24 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<openerp> | ||
<data> | ||
<record id="report_configuration_form_view_company" model="ir.ui.view"> | ||
<field name="name">report_configuration_form_view_company</field> | ||
<field name="model">sale_layout.category</field> | ||
<field name="inherit_id" ref="sale_layout.report_configuration_form_view"></field> | ||
<field name="arch" type="xml"> | ||
<field name="sequence" position="after"> | ||
<field name="company_id" groups="base.group_multi_company" widget="selection"></field> | ||
</field> | ||
<odoo> | ||
<record id="report_configuration_form_view_company" model="ir.ui.view"> | ||
<field name="name">report_configuration_form_view_company</field> | ||
<field name="model">sale.layout_category</field> | ||
<field name="inherit_id" ref="sale.report_configuration_form_view"/> | ||
<field name="arch" type="xml"> | ||
<field name="sequence" position="after"> | ||
<field name="company_id" groups="base.group_multi_company" widget="selection"/> | ||
</field> | ||
</record> | ||
<record id="report_configuration_tree_view_company" model="ir.ui.view"> | ||
<field name="name">report_configuration_tree_view_company</field> | ||
<field name="model">sale_layout.category</field> | ||
<field name="inherit_id" ref="sale_layout.report_configuration_tree_view"></field> | ||
<field name="arch" type="xml"> | ||
<field name="sequence" position="after"> | ||
<field name="company_id" groups="base.group_multi_company"></field> | ||
</field> | ||
</field> | ||
</record> | ||
|
||
<record id="report_configuration_tree_view_company" model="ir.ui.view"> | ||
<field name="name">report_configuration_tree_view_company</field> | ||
<field name="model">sale.layout_category</field> | ||
<field name="inherit_id" ref="sale.report_configuration_tree_view"/> | ||
<field name="arch" type="xml"> | ||
<field name="sequence" position="after"> | ||
<field name="company_id" groups="base.group_multi_company"/> | ||
</field> | ||
</record> | ||
</data> | ||
</openerp> | ||
</field> | ||
</record> | ||
</odoo> |