From f7f18ba5b1bf601ba89c50738c05ce4b98af91bf Mon Sep 17 00:00:00 2001 From: Goffin Simon Date: Thu, 20 Aug 2015 09:21:58 +0200 Subject: [PATCH] [FIX] purchase: description of a product When a move is creating from a purchase order line and the destination of the order("location_id") is "customer", the description of the created move must be the name of the product. To avoid that the supplier description of the product appears on the customer invoice because in "drop shipping", the customer invoice line is created with this created move by the function "_get_invoice_line_vals". opw:647628 --- addons/purchase/purchase.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/addons/purchase/purchase.py b/addons/purchase/purchase.py index 95d4da6fe1b..d1ac4694628 100644 --- a/addons/purchase/purchase.py +++ b/addons/purchase/purchase.py @@ -746,8 +746,12 @@ class purchase_order(osv.osv): #we don't round the price_unit, as we may want to store the standard price with more digits than allowed by the currency price_unit = self.pool.get('res.currency').compute(cr, uid, order.currency_id.id, order.company_id.currency_id.id, price_unit, round=False, context=context) res = [] + if order.location_id.usage == 'customer': + name = order_line.product_id.name + else: + name = order_line.name or '' move_template = { - 'name': order_line.name or '', + 'name': name, 'product_id': order_line.product_id.id, 'product_uom': order_line.product_uom.id, 'product_uos': order_line.product_uom.id,