Skip to content

Commit

Permalink
[FIX] stock: multi-company rule for stock.quant.
Browse files Browse the repository at this point in the history
`stock.move` & `stock.product` have multi-company rules.
There is therefore no reason why `stock.quant` could not have one.

Besides, this could lead to access rights issues,
when a user went to the `Quants` list,
in Warehouse > Traceability > Quants,
while there were quants for products in a company different
than the user company.

opw-653188
  • Loading branch information
beledouxdenis committed Nov 25, 2015
1 parent 8e1a5ad commit 2fd14db
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions addons/stock/security/stock_security.xml
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,13 @@
<field name="domain_force">['|',('company_id','=',False),('company_id','child_of',[user.company_id.id])]</field>
</record>

<record model="ir.rule" id="stock_quant_rule">
<field name="name">stock_quant multi-company</field>
<field name="model_id" ref="model_stock_quant"/>
<field name="global" eval="True"/>
<field name="domain_force">['|',('company_id','=',False),('company_id','child_of',[user.company_id.id])]</field>
</record>

<record model="ir.rule" id="stock_inventory_line_comp_rule">
<field name="name">Inventory Line multi-company</field>
<field name="model_id" ref="model_stock_inventory_line"/>
Expand Down

0 comments on commit 2fd14db

Please sign in to comment.