From 560e5eec1523ded60e5bd748bd0ce1325dadad3b Mon Sep 17 00:00:00 2001 From: Nicolas Martinelli Date: Wed, 9 Mar 2016 15:57:00 +0100 Subject: [PATCH] [FIX] purchase: duplicate origin in PO When a "Drop Shipping" route is used on a product, the origin document is duplicated on the PO created. This is because in this case, po_rec.origin and procurement.origin are the same. opw-671039 --- addons/purchase/purchase.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/purchase/purchase.py b/addons/purchase/purchase.py index 10218dba4d7..63131ec104d 100644 --- a/addons/purchase/purchase.py +++ b/addons/purchase/purchase.py @@ -1517,7 +1517,7 @@ class procurement_order(osv.osv): po_id = available_draft_po_ids[0] po_rec = po_obj.browse(cr, uid, po_id, context=context) - po_to_update = {'origin': ', '.join(filter(None, [po_rec.origin, procurement.origin]))} + po_to_update = {'origin': ', '.join(filter(None, set([po_rec.origin, procurement.origin])))} #if the product has to be ordered earlier those in the existing PO, we replace the purchase date on the order to avoid ordering it too late if datetime.strptime(po_rec.date_order, DEFAULT_SERVER_DATETIME_FORMAT) > purchase_date: po_to_update.update({'date_order': purchase_date.strftime(DEFAULT_SERVER_DATETIME_FORMAT)})