[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
This commit is contained in:
parent
fff4215933
commit
1da3a8b353
|
@ -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
|
#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')
|
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
|
picking = op.picking_id
|
||||||
|
ref = product.default_code
|
||||||
|
name = '[' + ref + ']' + ' ' + product.name if ref else product.name
|
||||||
res = {
|
res = {
|
||||||
'picking_id': picking.id,
|
'picking_id': picking.id,
|
||||||
'location_id': picking.location_id.id,
|
'location_id': picking.location_id.id,
|
||||||
|
@ -1350,7 +1352,7 @@ class stock_picking(osv.osv):
|
||||||
'product_id': product.id,
|
'product_id': product.id,
|
||||||
'product_uom': uom_id,
|
'product_uom': uom_id,
|
||||||
'product_uom_qty': qty,
|
'product_uom_qty': qty,
|
||||||
'name': _('Extra Move: ') + product.name,
|
'name': _('Extra Move: ') + name,
|
||||||
'state': 'draft',
|
'state': 'draft',
|
||||||
}
|
}
|
||||||
return res
|
return res
|
||||||
|
|
|
@ -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:
|
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']]
|
invoice_line_vals['price_unit'] = product_price_unit[invoice_line_vals['product_id']]
|
||||||
if is_extra_move[move.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]:
|
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]
|
invoice_line_vals['invoice_line_tax_id'] = extra_move_tax[move.picking_id, move.product_id]
|
||||||
#the default product taxes
|
#the default product taxes
|
||||||
|
|
Loading…
Reference in New Issue