From 1da3a8b353315b0836b02d4581d54c8b8ac641de Mon Sep 17 00:00:00 2001 From: Goffin Simon Date: Wed, 27 May 2015 11:09:19 +0200 Subject: [PATCH] [FIX] stock_account: description for extra moves The extra moves must take into account the field description_sale or description_purchase and the field default_code set on the product. opw:640387 --- addons/stock/stock.py | 4 +++- addons/stock_account/stock.py | 3 +++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/addons/stock/stock.py b/addons/stock/stock.py index 33adf192dca..f945a1ca0b9 100644 --- a/addons/stock/stock.py +++ b/addons/stock/stock.py @@ -1343,6 +1343,8 @@ class stock_picking(osv.osv): #HALF-UP rounding as only rounding errors will be because of propagation of error from default UoM qty = uom_obj._compute_qty_obj(cr, uid, product.uom_id, remaining_qty, op.product_uom_id, rounding_method='HALF-UP') picking = op.picking_id + ref = product.default_code + name = '[' + ref + ']' + ' ' + product.name if ref else product.name res = { 'picking_id': picking.id, 'location_id': picking.location_id.id, @@ -1350,7 +1352,7 @@ class stock_picking(osv.osv): 'product_id': product.id, 'product_uom': uom_id, 'product_uom_qty': qty, - 'name': _('Extra Move: ') + product.name, + 'name': _('Extra Move: ') + name, 'state': 'draft', } return res diff --git a/addons/stock_account/stock.py b/addons/stock_account/stock.py index 657cffb8bbc..b6d932a82dd 100644 --- a/addons/stock_account/stock.py +++ b/addons/stock_account/stock.py @@ -323,6 +323,9 @@ class stock_picking(osv.osv): if is_extra_move[move.id] and invoice_line_vals['product_id'] in product_price_unit: invoice_line_vals['price_unit'] = product_price_unit[invoice_line_vals['product_id']] if is_extra_move[move.id]: + desc = (inv_type == 'out_invoice' and move.product_id.product_tmpl_id.description_sale) or \ + (inv_type == 'in_invoice' and move.product_id.product_tmpl_id.description_purchase) + invoice_line_vals['name'] += ' ' + desc if desc else '' if extra_move_tax[move.picking_id, move.product_id]: invoice_line_vals['invoice_line_tax_id'] = extra_move_tax[move.picking_id, move.product_id] #the default product taxes