[IMP]:improve code and remove the loop for invoice
bzr revid: ksa@tinyerp.com-20111111054021-b2sv5f6jegyjs403
This commit is contained in:
parent
545cfadbc7
commit
4bfa2880b1
|
@ -142,9 +142,8 @@ class stock_picking(osv.osv):
|
|||
invoice_created = invoices[result[picking.id]]
|
||||
invoice_obj.write(cursor, user, [invoice_created.id], {'user_id': picking.sale_id and picking.sale_id.user_id and picking.sale_id.user_id.id or False}, context=context)
|
||||
|
||||
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 not invoice_created.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)
|
||||
|
|
Loading…
Reference in New Issue