Skip to content

Commit

Permalink
[MIG] sale_layout_multi_company: Migration to 10.0
Browse files Browse the repository at this point in the history
  • Loading branch information
SimoRubi committed Mar 26, 2018
1 parent 66be459 commit 3690fee
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 40 deletions.
2 changes: 1 addition & 1 deletion sale_layout_multi_company/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Usage

.. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas
:alt: Try me on Runbot
:target: https://runbot.odoo-community.org/runbot/133/8.0
:target: https://runbot.odoo-community.org/runbot/133/10.0

Bug Tracker
===========
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@
{
"name": "Sale Layout - Multi company",
"summary": "Multi company features for sale_layout",
"version": "8.0.1.0.0",
"version": "10.0.1.0.0",
"category": "Sales Management",
"website": "https://www.agilebg.com",
"author": "Agile Business Group, Odoo Community Association (OCA)",
"license": "AGPL-3",
"application": False,
"installable": True,
"depends": [
"sale_layout",
"sale"
],
"data": [
"views/sale_layout_view.xml",
Expand Down
9 changes: 4 additions & 5 deletions sale_layout_multi_company/models/sale_layout.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,16 @@
# Copyright 2016 Lorenzo Battistini - 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, fields, api


class SaleLayoutCategory(models.Model):
_inherit = 'sale_layout.category'
_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'))
return self.env['res.company']. \
_company_default_get('sale.layout_category')

company_id = fields.Many2one(
'res.company', string='Company', change_default=True,
Expand Down
20 changes: 10 additions & 10 deletions sale_layout_multi_company/security/record_rules.xml
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="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>
</odoo>
43 changes: 21 additions & 22 deletions sale_layout_multi_company/views/sale_layout_view.xml
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>

0 comments on commit 3690fee

Please sign in to comment.