Ernesto Tejeda
4 years ago
committed by
Omar (Comunitea)
7 changed files with 94 additions and 109 deletions
-
31base_global_discount/__manifest__.py
-
42base_global_discount/models/global_discount.py
-
22base_global_discount/models/res_partner.py
-
18base_global_discount/security/security.xml
-
28base_global_discount/tests/test_global_discount.py
-
34base_global_discount/views/global_discount_views.xml
-
28base_global_discount/views/res_partner_views.xml
@ -1,16 +1,16 @@ |
|||
<?xml version="1.0"?> |
|||
<?xml version="1.0" ?> |
|||
<!-- Copyright 2019 Tecnativa - David Vidal |
|||
License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). --> |
|||
<odoo> |
|||
|
|||
<record model="ir.rule" id="global_discount_comp_rule"> |
|||
<field name="name">Global Discount multi-company</field> |
|||
<field name="model_id" ref="base_global_discount.model_global_discount"/> |
|||
<field name="domain_force">['|',('company_id','=',False),('company_id','child_of',[user.company_id.id])]</field> |
|||
<field name="perm_read" eval="1"/> |
|||
<field name="perm_create" eval="1"/> |
|||
<field name="perm_write" eval="1"/> |
|||
<field name="perm_unlink" eval="1"/> |
|||
<field name="model_id" ref="base_global_discount.model_global_discount" /> |
|||
<field |
|||
name="domain_force" |
|||
>['|',('company_id','=',False),('company_id','child_of',[user.company_id.id])]</field> |
|||
<field name="perm_read" eval="1" /> |
|||
<field name="perm_create" eval="1" /> |
|||
<field name="perm_write" eval="1" /> |
|||
<field name="perm_unlink" eval="1" /> |
|||
</record> |
|||
|
|||
</odoo> |
@ -1,21 +1,25 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<?xml version="1.0" encoding="utf-8" ?> |
|||
<!-- Copyright 2019 Tecnativa - David Vidal |
|||
License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). --> |
|||
<odoo> |
|||
|
|||
<record model="ir.ui.view" id="res_partner_form_view"> |
|||
<field name="model">res.partner</field> |
|||
<field name="inherit_id" ref="base.view_partner_form"/> |
|||
<field name="arch" type="xml"> |
|||
<field name="model">res.partner</field> |
|||
<field name="inherit_id" ref="base.view_partner_form" /> |
|||
<field name="arch" type="xml"> |
|||
<group name="sale" position="inside"> |
|||
<field name="customer_global_discount_ids" widget="many2many_tags" |
|||
attrs="{'invisible': [('customer', '=', False), ('is_company', '=', False), ('parent_id', '!=', False)]}"/> |
|||
<field |
|||
name="customer_global_discount_ids" |
|||
widget="many2many_tags" |
|||
attrs="{'invisible': [('customer', '=', False), ('is_company', '=', False), ('parent_id', '!=', False)]}" |
|||
/> |
|||
</group> |
|||
<group name="purchase" position="inside"> |
|||
<field name="supplier_global_discount_ids" widget="many2many_tags" |
|||
attrs="{'invisible': [('supplier', '=', False), ('is_company', '=', False), ('parent_id', '!=', False)]}"/> |
|||
<field |
|||
name="supplier_global_discount_ids" |
|||
widget="many2many_tags" |
|||
attrs="{'invisible': [('supplier', '=', False), ('is_company', '=', False), ('parent_id', '!=', False)]}" |
|||
/> |
|||
</group> |
|||
</field> |
|||
</record> |
|||
|
|||
</field> |
|||
</record> |
|||
</odoo> |
Write
Preview
Loading…
Cancel
Save
Reference in new issue