[FIX] Stock :Invoice created from manual picking might miss UoS.
lp bug: https://launchpad.net/bugs/487091 fixed bzr revid: jvo@tinyerp.com-20091124125328-mrsw98pqp5cprzkx
This commit is contained in:
parent
fc75b394c7
commit
459b4639a8
|
@ -743,13 +743,18 @@ class stock_picking(osv.osv):
|
|||
tax_ids = self._get_taxes_invoice(cursor, user, move_line, type)
|
||||
account_analytic_id = self._get_account_analytic_invoice(cursor,
|
||||
user, picking, move_line)
|
||||
|
||||
#set UoS if it's a sale and the picking doesn't have one
|
||||
uos_id = move_line.product_uos and move_line.product_uos.id or False
|
||||
if not uos_id and type in ('out_invoice', 'out_refund'):
|
||||
uos_id = move_line.product_uom.id
|
||||
|
||||
account_id = self.pool.get('account.fiscal.position').map_account(cursor, user, partner.property_account_position, account_id)
|
||||
invoice_line_id = invoice_line_obj.create(cursor, user, {
|
||||
'name': name,
|
||||
'origin': origin,
|
||||
'invoice_id': invoice_id,
|
||||
'uos_id': move_line.product_uos.id,
|
||||
'uos_id': uos_id,
|
||||
'product_id': move_line.product_id.id,
|
||||
'account_id': account_id,
|
||||
'price_unit': price_unit,
|
||||
|
|
Loading…
Reference in New Issue