[IMP]SOL contain service duplicate on invoice

lp bug: https://launchpad.net/bugs/907211 fixed

bzr revid: hpa@tinyerp.com-20111226102146-ncss7v7bmw0oc7bm
This commit is contained in:
Hemendra Paregi (Open ERP)
2011-12-26 15:51:46 +05:30
parent 99ae0048d0
commit afb6030523
+4 -3
View File
@@ -135,18 +135,19 @@ class stock_picking(osv.osv):
for picking in picking_obj.browse(cursor, user, picking_ids,
context=context):
if not picking.sale_id:
if not picking.sale_id or picking.backorder_id:
continue
sale_lines = picking.sale_id.order_line
invoice_created = invoices[result[picking.id]]
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)
for sale_line in sale_lines:
if sale_line.product_id.type == 'service' and sale_line.invoiced == False:
if not type:
@@ -195,4 +196,4 @@ class stock_picking(osv.osv):
})
return result
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: