[FIX] stock: intermediate calculation remaining qty for backorder check: 0 qty should not take all of pack operation

[IMP] Put in pack below everything
This commit is contained in:
Josse Colpaert
2015-06-25 14:56:29 +02:00
parent 50e86689a1
commit 16cee3522e
2 changed files with 3 additions and 3 deletions
+2 -2
View File
@@ -1283,7 +1283,7 @@ class stock_picking(models.Model):
for ops in operations:
#for each operation, create the links with the stock move by seeking on the matching reserved quants,
#and deffer the operation if there is some ambiguity on the move to select
if ops.package_id and not ops.product_id and (not done_qtys or ops.product_qty):
if ops.package_id and not ops.product_id and (not done_qtys or ops.qty_done):
#entire package
quant_ids = package_obj.get_content(cr, uid, [ops.package_id.id], context=context)
for quant in quant_obj.browse(cr, uid, quant_ids, context=context):
@@ -1298,7 +1298,7 @@ class stock_picking(models.Model):
need_rereserve = True
elif ops.product_id.id:
#Check moves with same product
product_qty = done_qtys and ops.qty_done or ops.product_qty
product_qty = ops.qty_done if done_qtys else ops.product_qty
qty_to_assign = uom_obj._compute_qty_obj(cr, uid, ops.product_uom_id, product_qty, ops.product_id.uom_id, context=context)
for move_dict in prod2move_ids.get(ops.product_id.id, []):
move = move_dict['move']
+1 -1
View File
@@ -753,7 +753,6 @@
states="confirmed,assigned,waiting,partially_available"/>
</tree>
</field>
<button class="oe_link oe_right" name="put_in_pack" type="object" string="&#8627;Put in Pack" attrs="{'invisible': [('state', 'in', ('done', 'cancel'))]}" groups="stock.group_tracking_lot"/>
<field name="picking_type_entire_packs" invisible="1"/>
<field name="pack_operation_pack_ids" attrs="{'invisible': [('pack_operation_pack_ids', '=', []), ('picking_type_entire_packs', '=', False)]}" context="{'default_picking_id': id, 'default_location_id': location_id, 'default_location_dest_id': location_dest_id, 'default_picking_id': id}" groups="stock.group_tracking_lot">
<tree editable="bottom" colors="grey:qty_done&gt;0;">
@@ -771,6 +770,7 @@
states="confirmed,assigned,waiting,partially_available"/>
</tree>
</field>
<button class="oe_link oe_right" name="put_in_pack" type="object" string="&#8627;Put in Pack" attrs="{'invisible': [('state', 'in', ('done', 'cancel'))]}" groups="stock.group_tracking_lot"/>
</page>
<page string="Initial Demand" attrs="{'invisible': [('state', 'not in', ('draft', 'confirmed', 'waiting'))]}">
<field name="move_lines" context="{'address_in_id': partner_id, 'form_view_ref':'stock.view_move_picking_form', 'tree_view_ref':'stock.view_move_picking_tree', 'default_picking_type_id': picking_type_id, 'default_location_id': location_id, 'default_location_dest_id': location_dest_id}">