From 4481eb2a4cd79cb7d9eb7dadf482890a56bae534 Mon Sep 17 00:00:00 2001 From: Josse Colpaert Date: Wed, 15 Jan 2014 11:41:20 +0100 Subject: [PATCH] [IMP] Write done/cancel a little bit different and default_restrict_lot on scrap bzr revid: jco@openerp.com-20140115104120-p1gp95n5kqa8mu8x --- addons/stock/stock.py | 5 ++--- addons/stock/wizard/stock_move_view.xml | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/addons/stock/stock.py b/addons/stock/stock.py index de9917f453d..7c64cdab2d7 100644 --- a/addons/stock/stock.py +++ b/addons/stock/stock.py @@ -977,9 +977,8 @@ class stock_picking(osv.osv): def do_recompute_remaining_quantities(self, cr, uid, picking_ids, context=None): def _create_link_for_product(product_id, qty): qty_to_assign = qty - active_lines = [x for x in picking.move_lines if x.state not in ['done', 'cancel']] - for move in active_lines: - if move.product_id.id == product_id: + for move in picking.move_lines: + if move.product_id.id == product_id and move.state not in ['done', 'cancel']: qty_on_link = min(move.remaining_qty, qty_to_assign) link_obj.create(cr, uid, {'move_id': move.id, 'operation_id': op.id, 'qty': qty_on_link}, context=context) qty_to_assign -= qty_on_link diff --git a/addons/stock/wizard/stock_move_view.xml b/addons/stock/wizard/stock_move_view.xml index a47782414c0..f8121a89ee9 100644 --- a/addons/stock/wizard/stock_move_view.xml +++ b/addons/stock/wizard/stock_move_view.xml @@ -50,7 +50,7 @@ + context="{'default_product_id': product_id}"/>