[FIX]: Multi branch improvement.

This commit is contained in:
Kunjal 2018-01-22 18:58:04 +05:30 committed by Haresh Chavda
parent 15446271be
commit c2c2f9e4fc
5 changed files with 47 additions and 11 deletions

View File

@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<flectra noupdate="1"> <flectra>
<record id="branch_comp_rule" model="ir.rule"> <record id="branch_comp_rule" model="ir.rule">
<field name="name">Branch</field> <field name="name">Branch</field>
<field name="model_id" ref="model_res_branch"/> <field name="model_id" ref="model_res_branch"/>
@ -17,4 +16,8 @@
<field name="global" eval="True"/> <field name="global" eval="True"/>
</record> </record>
<record model="res.groups" id="group_multi_branch">
<field name="name">Multi Branch</field>
<field name="category_id" ref="base.module_category_usability"/>
</record>
</flectra> </flectra>

View File

@ -4,7 +4,7 @@
<field name="name">res.branch.form</field> <field name="name">res.branch.form</field>
<field name="model">res.branch</field> <field name="model">res.branch</field>
<field name="arch" type="xml"> <field name="arch" type="xml">
<form string="Branch"> <form string="Branch" create="false">
<sheet> <sheet>
<div class="oe_button_box" name="button_box"> <div class="oe_button_box" name="button_box">
<button name="toggle_active" type="object" <button name="toggle_active" type="object"
@ -47,7 +47,7 @@
<field name="name">res.branch.tree</field> <field name="name">res.branch.tree</field>
<field name="model">res.branch</field> <field name="model">res.branch</field>
<field name="arch" type="xml"> <field name="arch" type="xml">
<tree string="Branch"> <tree string="Branch" create="false">
<field name="code"/> <field name="code"/>
<field name="name"/> <field name="name"/>
<field name="company_id" groups="base.group_multi_company"/> <field name="company_id" groups="base.group_multi_company"/>
@ -99,4 +99,29 @@
</field> </field>
</record> </record>
<record id="view_res_branch_form_editable" model="ir.ui.view">
<field name="name">res.branch.form.editable</field>
<field name="model">res.branch</field>
<field name="inherit_id" ref="base_branch_company.view_res_branch_form"/>
<field name="groups_id" eval="[(4, ref('base_branch_company.group_multi_branch'))]"/>
<field name="arch" type="xml">
<xpath expr="//form" position="attributes">
<attribute name="create">true</attribute>
</xpath>
</field>
</record>
<record id="stock_warehouse_view_tree_editable" model="ir.ui.view">
<field name="name">res.branch.tree.editable</field>
<field name="model">res.branch</field>
<field name="inherit_id" ref="base_branch_company.view_res_branch_tree"/>
<field name="groups_id" eval="[(4, ref('base_branch_company.group_multi_branch'))]"/>
<field name="arch" type="xml">
<xpath expr="//tree" position="attributes">
<attribute name="create">true</attribute>
</xpath>
</field>
</record>
</flectra> </flectra>

View File

@ -4,3 +4,10 @@ from . import models
from . import wizard from . import wizard
from . import controllers from . import controllers
from .tests import test_mail_model from .tests import test_mail_model
def post_init(cr, registry):
from flectra import api, SUPERUSER_ID
env = api.Environment(cr, SUPERUSER_ID, {})
env['publisher_warranty.contract'].update_notification()

View File

@ -44,6 +44,7 @@
], ],
'installable': True, 'installable': True,
'application': True, 'application': True,
'post_init_hook': 'post_init',
'qweb': [ 'qweb': [
'static/src/xml/activity.xml', 'static/src/xml/activity.xml',
'static/src/xml/client_action.xml', 'static/src/xml/client_action.xml',

View File

@ -166,13 +166,13 @@
</field> </field>
</record> </record>
<!--<record id="picking_type_multi_branch_rule" model="ir.rule">--> <record id="picking_type_multi_branch_rule" model="ir.rule">
<!--<field name="name">Picking type multi-branch</field>--> <field name="name">Picking type multi-branch</field>
<!--<field name="model_id" ref="model_stock_picking_type"/>--> <field name="model_id" ref="model_stock_picking_type"/>
<!--<field name="global" eval="True"/>--> <field name="global" eval="True"/>
<!--<field name="domain_force">['|',('warehouse_id.branch_id','=',False),('warehouse_id.branch_id','in',[branch for branch in user.branch_ids.ids])]--> <field name="domain_force">['|',('warehouse_id.branch_id','=',False), '|', ('warehouse_id.branch_id','in',[branch for branch in user.branch_ids.ids]), ('warehouse_id.branch_id','=', user.default_branch_id.id)]
<!--</field>--> </field>
<!--</record>--> </record>
<record id="warehouse_multi_branch_rule" model="ir.rule"> <record id="warehouse_multi_branch_rule" model="ir.rule">
<field name="name">Warehouse multi-branch</field> <field name="name">Warehouse multi-branch</field>