From d84a6c57579c96ef1fc9c9ab3b6c711152ee22ea Mon Sep 17 00:00:00 2001 From: Olivier Dony Date: Fri, 11 Nov 2011 01:31:27 +0100 Subject: [PATCH] [FIX] purchase: correct remaining error in last merge action_picking_create() must only return one picking ID, to be used to bind that picking's subflow in the PO's workflow. bzr revid: odo@openerp.com-20111111003127-gweu0vkcdgwi4tqd --- addons/purchase/purchase.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/addons/purchase/purchase.py b/addons/purchase/purchase.py index 7a074c9f679..83b20833c5f 100644 --- a/addons/purchase/purchase.py +++ b/addons/purchase/purchase.py @@ -500,7 +500,12 @@ class purchase_order(osv.osv): picking_ids = [] for order in self.browse(cr, uid, ids): picking_ids.extend(self._create_pickings(cr, uid, order, order.order_line, None, *args)) - return picking_ids + + # Must return one unique picking ID: the one to connect in the subflow of the purchase order. + # In case of multiple (split) pickings, we should return the ID of the critical one, i.e. the + # one that should trigger the advancement of the purchase workflow. + # By default we will consider the first one as most important, but this behavior can be overridden. + return picking_ids[0] if picking_ids else False def copy(self, cr, uid, id, default=None, context=None): if not default: