bzr revid: fp@tinyerp.com-20111111103533-x52h83i99u01q0tn
This commit is contained in:
Fabien Pinckaers 2011-11-11 11:35:33 +01:00
commit a5abffbc65
1 changed files with 5 additions and 3 deletions

View File

@ -140,9 +140,11 @@ class stock_picking(osv.osv):
continue
sale_lines = picking.sale_id.order_line
invoice_created = invoices[result[picking.id]]
for inv in invoice_obj.browse(cursor, user, [invoice_created.id], context=context):
if not inv.fiscal_position:
invoice_obj.write(cursor, user, [inv.id], {'fiscal_position': picking.sale_id.fiscal_position.id}, context=context)
if picking.sale_id.user_id:
invoice_obj.write(cursor, user, [invoice_created.id], {'user_id': picking.sale_id.user_id.id}, context=context)
if picking.sale_id.fiscal_position:
invoice_obj.write(cursor, user, [invoice_created.id], {'fiscal_position': picking.sale_id.fiscal_position.id}, context=context)
if picking.sale_id.client_order_ref:
inv_name = picking.sale_id.client_order_ref + " : " + invoice_created.name
invoice_obj.write(cursor, user, [invoice_created.id], {'name': inv_name}, context=context)