[REF] stock: domain on packages fields on move line

The user can only chose packages from the same location as the move line
as a source package.

The user can only chose packages
  - of the same destination location as the move ine
  - without location (meaning, empty)
  - of the same id as the source location
as a destination location.
This commit is contained in:
Simon Lejeune
2017-10-31 17:12:55 +01:00
parent 498bbb3fe7
commit f4866ab7f9
2 changed files with 4 additions and 4 deletions
+2 -2
View File
@@ -187,8 +187,8 @@
<field name="location_dest_id" invisible="not context.get('show_destination_location')" domain="[('id', 'child_of', parent.location_dest_id)]" groups="stock.group_stock_multi_locations"/>
<field name="lot_id" invisible="not context.get('show_lots_m2o')" domain="[('product_id', '=', parent.product_id)]" groups="stock.group_production_lot" context="{'default_product_id': parent.product_id, 'active_picking_id': picking_id}"/>
<field name="lot_name" invisible="not context.get('show_lots_text')" groups="stock.group_production_lot"/>
<field name="package_id" invisible="not context.get('show_package')" groups="stock.group_tracking_lot"/>
<field name="result_package_id" groups="stock.group_tracking_lot"/>
<field name="package_id" invisible="not context.get('show_package')" groups="stock.group_tracking_lot" domain="[('location_id', '=', location_id)]"/>
<field name="result_package_id" groups="stock.group_tracking_lot" domain="['|', '|', ('location_id', '=', False), ('location_id', '=', location_dest_id), ('id', '=', package_id)]"/>
<field name="owner_id" groups="stock.group_tracking_owner"/>
<field name="is_initial_demand_editable" invisible="1"/>
<field name="product_uom_qty" invisible="not context.get('show_reserved_quantity')" readonly="1"/>
+2 -2
View File
@@ -260,10 +260,10 @@
<tree editable="bottom" decoration-muted="result_package_id or (state == 'done' and is_locked == True)" decoration-danger="qty_done&gt;product_uom_qty and state!='done'" decoration-success="qty_done==product_uom_qty and state!='done' and not result_package_id">
<field name="product_id" required="1"/>
<field name="product_uom_id" force_save="1" attrs="{'readonly': [('state', '!=', 'draft')]}" groups="product.group_uom"/>
<field name="package_id" groups="stock.group_tracking_lot"/>
<field name="package_id" groups="stock.group_tracking_lot" domain="[('location_id', '=', location_id)]"/>
<field name="location_id" groups="stock.group_stock_multi_locations,stock.group_tracking_lot" domain="[('id', 'child_of', parent.location_id)]"/>
<field name="location_dest_id" groups="stock.group_stock_multi_locations,stock.group_tracking_lot" domain="[('id', 'child_of', parent.location_dest_id)]"/>
<field name="result_package_id" groups="stock.group_tracking_lot"/>
<field name="result_package_id" groups="stock.group_tracking_lot" domain="['|', '|', ('location_id', '=', False), ('location_id', '=', location_dest_id), ('id', '=', package_id)]"/>
<field name="lots_visible" invisible="1"/>
<field name="owner_id" groups="stock.group_tracking_owner"/>
<field name="state" invisible="1"/>