[IMP] MO should pass warehouse + improvements on pack_operation_ids when someone would make it visible
This commit is contained in:
parent
7a69b329b1
commit
f06df3290a
|
@ -1097,6 +1097,7 @@ class mrp_production(osv.osv):
|
|||
|
||||
def _make_consume_line_from_data(self, cr, uid, production, product, uom_id, qty, uos_id, uos_qty, context=None):
|
||||
stock_move = self.pool.get('stock.move')
|
||||
loc_obj = self.pool.get('stock.location')
|
||||
# Internal shipment is created for Stockable and Consumer Products
|
||||
if product.type not in ('product', 'consu'):
|
||||
return False
|
||||
|
@ -1107,7 +1108,7 @@ class mrp_production(osv.osv):
|
|||
if production.bom_id.routing_id and production.bom_id.routing_id.location_id and production.bom_id.routing_id.location_id.id != source_location_id:
|
||||
source_location_id = production.bom_id.routing_id.location_id.id
|
||||
prev_move = True
|
||||
|
||||
|
||||
destination_location_id = production.product_id.property_stock_production.id
|
||||
move_id = stock_move.create(cr, uid, {
|
||||
'name': production.name,
|
||||
|
@ -1125,6 +1126,7 @@ class mrp_production(osv.osv):
|
|||
#this saves us a browse in create()
|
||||
'price_unit': product.standard_price,
|
||||
'origin': production.name,
|
||||
'warehouse_id': loc_obj.get_warehouse(cr, uid, production.location_src_id, context=context),
|
||||
}, context=context)
|
||||
|
||||
if prev_move:
|
||||
|
|
|
@ -687,18 +687,18 @@
|
|||
<field name="note" placeholder="Add an internal note..." class="oe_inline"/>
|
||||
</page>
|
||||
<page string="Operations" attrs="{'invisible': ['|', ('state','!=','done'), ('pack_operation_ids','=',[])]}">
|
||||
<field name="pack_operation_ids">
|
||||
<field name="pack_operation_ids" context="{'default_picking_id': active_id, 'default_location_id': location_id, 'default_location_dest_id': location_dest_id}">
|
||||
<tree editable="top">
|
||||
<field name="package_id" groups="stock.group_tracking_lot"/>
|
||||
<field name="product_id"/>
|
||||
<field name="product_id" on_change="product_id_change(product_id, product_uom_id, product_qty)"/>
|
||||
<field name="product_uom_id" groups="product.group_uom"/>
|
||||
<field name="lot_id" domain="[('product_id','=?', product_id)]" context="{'product_id': product_id}" groups="stock.group_production_lot"/>
|
||||
<field name="picking_id" invisible="1"/>
|
||||
<field name="owner_id" groups="stock.group_tracking_owner"/>
|
||||
<field name="product_qty" attrs="{'required': [('product_id', '!=', False)]}"/>
|
||||
<field name="location_id"/>
|
||||
<field name="location_dest_id"/>
|
||||
<field name="result_package_id" groups="stock.group_tracking_lot"/>
|
||||
<field name="location_id" domain="[('id', 'child_of', parent.location_id)]"/>
|
||||
<field name="location_dest_id" domain="[('id', 'child_of', parent.location_dest_id)]"/>
|
||||
<field name="result_package_id" groups="stock.group_tracking_lot" context="{'location_id': location_dest_id}"/>
|
||||
</tree>
|
||||
</field>
|
||||
<p class="oe_grey" groups="stock.group_tracking_lot">
|
||||
|
|
Loading…
Reference in New Issue