Permalink
Browse files

[FIX] stock: location company

Force the location and destination location's company to match with the
picking and picking type company. This is to prevent users to move
products between companies without using a transit location.

opw-1893276
  • Loading branch information...
nim-odoo committed Feb 8, 2019
1 parent be689c5 commit 7ebcc538dbb992f8f9089f107f1a1361ed61a9eb
Showing with 4 additions and 4 deletions.
  1. +4 −4 addons/stock/views/stock_picking_views.xml
@@ -55,8 +55,8 @@
<field name="use_existing_lots" groups="stock.group_production_lot"/>
</group>
<group string="Locations">
<field name="default_location_src_id" attrs="{'required': [('code', '=', 'internal')]}"/>
<field name="default_location_dest_id" attrs="{'required': [('code', 'in', ('internal', 'incoming'))]}"/>
<field name="default_location_src_id" attrs="{'required': [('code', '=', 'internal')]}" domain="['|', ('company_id', '=', company_id), ('company_id', '=', False)]"/>
<field name="default_location_dest_id" attrs="{'required': [('code', 'in', ('internal', 'incoming'))]}" domain="['|', ('company_id', '=', company_id), ('company_id', '=', False)]"/>
</group>
</group>
</sheet>
@@ -229,8 +229,8 @@
<group>
<group>
<field name="partner_id" attrs="{'invisible': [('picking_type_code', '=', 'internal')]}"/>
<field name="location_id" groups="stock.group_stock_multi_locations" attrs="{'invisible': [('picking_type_code', '=', 'outgoing')]}"/>
<field name="location_dest_id" groups="stock.group_stock_multi_locations" attrs="{'invisible': [('picking_type_code', '=', 'incoming')]}"/>
<field name="location_id" groups="stock.group_stock_multi_locations" attrs="{'invisible': [('picking_type_code', '=', 'outgoing')]}" domain="['|', ('company_id', '=', company_id), ('company_id', '=', False)]"/>
<field name="location_dest_id" groups="stock.group_stock_multi_locations" attrs="{'invisible': [('picking_type_code', '=', 'incoming')]}" domain="['|', ('company_id', '=', company_id), ('company_id', '=', False)]"/>
<field name="backorder_id" readonly="1" attrs="{'invisible': [('backorder_id','=',False)]}"/>
</group>
<group>

0 comments on commit 7ebcc53

Please sign in to comment.