mirror of
https://github.com/OCA/manufacture.git
synced 2025-01-28 16:37:15 +02:00
add support for multi-company
This commit is contained in:
committed by
JasminSForgeFlow
parent
d750aae31b
commit
529f39f86c
@@ -16,6 +16,11 @@ class MrpArea(models.Model):
|
||||
comodel_name='stock.warehouse', string='Warehouse',
|
||||
required=True,
|
||||
)
|
||||
company_id = fields.Many2one(
|
||||
comodel_name='res.company',
|
||||
related='warehouse_id.company_id',
|
||||
store=True,
|
||||
)
|
||||
location_id = fields.Many2one(
|
||||
comodel_name='stock.location', string='Location',
|
||||
required=True,
|
||||
|
||||
@@ -28,6 +28,11 @@ class MrpInventory(models.Model):
|
||||
index=True,
|
||||
required=True,
|
||||
)
|
||||
company_id = fields.Many2one(
|
||||
comodel_name='res.company',
|
||||
related='product_mrp_area_id.mrp_area_id.warehouse_id.company_id',
|
||||
store=True,
|
||||
)
|
||||
product_id = fields.Many2one(
|
||||
comodel_name='product.product',
|
||||
related='product_mrp_area_id.product_id',
|
||||
|
||||
@@ -25,6 +25,11 @@ class MrpMove(models.Model):
|
||||
store=True,
|
||||
index=True,
|
||||
)
|
||||
company_id = fields.Many2one(
|
||||
comodel_name='res.company',
|
||||
related='product_mrp_area_id.mrp_area_id.warehouse_id.company_id',
|
||||
store=True,
|
||||
)
|
||||
product_id = fields.Many2one(
|
||||
comodel_name='product.product',
|
||||
related='product_mrp_area_id.product_id',
|
||||
|
||||
@@ -25,6 +25,11 @@ class MrpPlannedOrder(models.Model):
|
||||
index=True,
|
||||
readonly=True,
|
||||
)
|
||||
company_id = fields.Many2one(
|
||||
comodel_name='res.company',
|
||||
related='product_mrp_area_id.mrp_area_id.warehouse_id.company_id',
|
||||
store=True,
|
||||
)
|
||||
product_id = fields.Many2one(
|
||||
comodel_name="product.product",
|
||||
related="product_mrp_area_id.product_id",
|
||||
|
||||
@@ -19,6 +19,11 @@ class ProductMRPArea(models.Model):
|
||||
comodel_name='mrp.area',
|
||||
required=True,
|
||||
)
|
||||
company_id = fields.Many2one(
|
||||
comodel_name='res.company',
|
||||
related='mrp_area_id.warehouse_id.company_id',
|
||||
store=True,
|
||||
)
|
||||
product_id = fields.Many2one(
|
||||
comodel_name='product.product',
|
||||
required=True,
|
||||
|
||||
@@ -7,4 +7,39 @@
|
||||
<field name="category_id" ref="base.module_category_hidden"/>
|
||||
</record>
|
||||
|
||||
<record id="mrp_area_comp_rule" model="ir.rule">
|
||||
<field name="name">MRP Area multi-company rule</field>
|
||||
<field name="model_id" ref="model_mrp_area"/>
|
||||
<field name="global" eval="True"/>
|
||||
<field name="domain_force">['|',('company_id','=',False),('company_id','child_of',[user.company_id.id])]</field>
|
||||
</record>
|
||||
|
||||
<record id="mrp_product_mrp_area_comp_rule" model="ir.rule">
|
||||
<field name="name">Product MRP Area multi-company rule</field>
|
||||
<field name="model_id" ref="model_product_mrp_area"/>
|
||||
<field name="global" eval="True"/>
|
||||
<field name="domain_force">['|',('company_id','=',False),('company_id','child_of',[user.company_id.id])]</field>
|
||||
</record>
|
||||
|
||||
<record id="mrp_inventory_comp_rule" model="ir.rule">
|
||||
<field name="name">MRP Inventory multi-company rule</field>
|
||||
<field name="model_id" ref="model_mrp_inventory"/>
|
||||
<field name="global" eval="True"/>
|
||||
<field name="domain_force">['|',('company_id','=',False),('company_id','child_of',[user.company_id.id])]</field>
|
||||
</record>
|
||||
|
||||
<record id="mrp_move_comp_rule" model="ir.rule">
|
||||
<field name="name">MRP Move multi-company rule</field>
|
||||
<field name="model_id" ref="model_mrp_move"/>
|
||||
<field name="global" eval="True"/>
|
||||
<field name="domain_force">['|',('company_id','=',False),('company_id','child_of',[user.company_id.id])]</field>
|
||||
</record>
|
||||
|
||||
<record id="mrp_planned_order_comp_rule" model="ir.rule">
|
||||
<field name="name">MRP Planned Order multi-company rule</field>
|
||||
<field name="model_id" ref="model_mrp_planned_order"/>
|
||||
<field name="global" eval="True"/>
|
||||
<field name="domain_force">['|',('company_id','=',False),('company_id','child_of',[user.company_id.id])]</field>
|
||||
</record>
|
||||
|
||||
</odoo>
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
<tree string="MRP Area">
|
||||
<field name="name"/>
|
||||
<field name="warehouse_id"/>
|
||||
<field name="company_id" groups="base.group_multi_company"/>
|
||||
<field name="location_id"/>
|
||||
<field name="calendar_id"/>
|
||||
</tree>
|
||||
@@ -35,6 +36,7 @@
|
||||
<group>
|
||||
<field name="warehouse_id"/>
|
||||
<field name="location_id"/>
|
||||
<field name="company_id" groups="base.group_multi_company"/>
|
||||
</group>
|
||||
<group name="settings">
|
||||
<field name="calendar_id"/>
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
<group>
|
||||
<group>
|
||||
<field name="mrp_area_id"/>
|
||||
<field name="company_id" groups="base.group_multi_company"/>
|
||||
<field name="product_id"/>
|
||||
<field name="product_mrp_area_id"/>
|
||||
<field name="date"/>
|
||||
@@ -36,6 +37,7 @@
|
||||
<field name="arch" type="xml">
|
||||
<tree string="MRP Inventory" create="false">
|
||||
<field name="mrp_area_id"/>
|
||||
<field name="company_id" groups="base.group_multi_company"/>
|
||||
<field name="product_id"/>
|
||||
<field name="date"/>
|
||||
<field name="uom_id" groups="uom.group_uom"/>
|
||||
@@ -85,6 +87,7 @@
|
||||
<field name="type">search</field>
|
||||
<field name="arch" type="xml">
|
||||
<search string="MRP Inventory">
|
||||
<field name="company_id" groups="base.group_multi_company"/>
|
||||
<group name="select" expand="0" string="Selection...">
|
||||
<field name="product_id"/>
|
||||
<field name="mrp_area_id"/>
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
<field name="arch" type="xml">
|
||||
<tree string="Product MRP Area parameters">
|
||||
<field name="mrp_area_id"/>
|
||||
<field name="company_id" groups="base.group_multi_company"/>
|
||||
<field name="product_tmpl_id"/>
|
||||
<field name="product_id" groups="product.group_product_variant"/>
|
||||
<field name="mrp_exclude"/>
|
||||
@@ -42,6 +43,7 @@
|
||||
<group colspan="4" col="2">
|
||||
<group>
|
||||
<field name="mrp_area_id"/>
|
||||
<field name="company_id" groups="base.group_multi_company"/>
|
||||
<field name="product_tmpl_id" invisible="1"/>
|
||||
<field name="product_id"/>
|
||||
<field name="location_id" invisible="1"/>
|
||||
|
||||
Reference in New Issue
Block a user