summaryrefslogtreecommitdiff
path: root/addons/stock/security
diff options
context:
space:
mode:
authorSimon Lejeune <sle@openerp.com>2019-12-16 10:40:05 +0000
committerSimon Lejeune <sle@openerp.com>2019-12-21 10:43:00 +0000
commit4f0b6d6ce51bf7e2bf403e80425a8b2afe439573 (patch)
tree9e7cadeaa381ef12f8bdeceeb2869b70054253a7 /addons/stock/security
parent26fac9a8346b6b78e89645978bd66308ef08c587 (diff)
[FIX] stock: wrong security rule
rev[0] aimed to fix an intercompany reservation issue by allowing the intercompany moves to be seen, however the new domain was too soft and also allows the visibility of any moves going to a location without company, for example now outgoing moves to customer from all companies are visible. We strengthen the domain to only allow intercompany moves, ie we add the transit constraint in the domain. We also fix the same issue for the move line model (see [1]) Now that this one is fixed, the next move is automatically reserved during _action_done. This didn't work either, so we carefully sudo and force_company on the destination move. [0] 3c4bb080c3ab71b63cf90a6b49ffebb3ea1e5545 [1] f9461c7096a65565a05136a4c6c42ddfa6881926 task-2157248 closes odoo/odoo#42270 X-original-commit: 9a237d1af79519665d0895a30c9ce55a1d835918 Signed-off-by: Simon Lejeune (sle) <sle@openerp.com>
Diffstat (limited to 'addons/stock/security')
-rw-r--r--addons/stock/security/stock_security.xml4
1 files changed, 2 insertions, 2 deletions
diff --git a/addons/stock/security/stock_security.xml b/addons/stock/security/stock_security.xml
index 3ffaa1cc9ab..bbf0a2714f5 100644
--- a/addons/stock/security/stock_security.xml
+++ b/addons/stock/security/stock_security.xml
@@ -116,14 +116,14 @@
<field name="name">stock_move multi-company</field>
<field name="model_id" search="[('model','=','stock.move')]" model="ir.model"/>
<field name="global" eval="True"/>
- <field name="domain_force">['|', ('company_id', 'in', company_ids), ('location_dest_id.company_id', '=', False)]</field>
+ <field name="domain_force">['|', ('company_id', 'in', company_ids), '&amp;', ('location_dest_id.company_id', '=', False), ('location_dest_id.usage', '=', 'transit')]</field>
</record>
<record model="ir.rule" id="stock_move_line_rule">
<field name="name">stock_move_line multi-company</field>
<field name="model_id" search="[('model','=','stock.move.line')]" model="ir.model"/>
<field name="global" eval="True"/>
- <field name="domain_force">['|','|',('company_id','=',False),('company_id', 'in', company_ids),('location_dest_id.company_id', '=', False)]</field>
+ <field name="domain_force">['|','|',('company_id','=',False),('company_id', 'in', company_ids),'&amp;',('location_dest_id.company_id', '=', False), ('location_dest_id.usage', '=', 'transit')]</field>
</record>
<record model="ir.rule" id="stock_quant_rule">