[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
This commit is contained in:
Goffin Simon 2015-08-20 09:21:58 +02:00
parent 0ea89c10b6
commit f7f18ba5b1
1 changed files with 5 additions and 1 deletions

View File

@ -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,