From 7fc05f47d1d224be45adbc971951d147d6aa14d8 Mon Sep 17 00:00:00 2001 From: "VRA(OpenERP)" <> Date: Thu, 19 Nov 2009 12:39:17 +0530 Subject: [PATCH] [FIX] Sale : Passing customer ref. of picking to invoice lp bug: https://launchpad.net/bugs/443132 fixed bzr revid: jvo@tinyerp.com-20091119070917-b8p0hzgki08pyhij --- addons/sale/stock.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/addons/sale/stock.py b/addons/sale/stock.py index 9e3cd377f03..af1bfb2aa69 100644 --- a/addons/sale/stock.py +++ b/addons/sale/stock.py @@ -131,13 +131,19 @@ class stock_picking(osv.osv): for invoice in invoice_obj.browse(cursor, user, invoice_ids, context=context): invoices[invoice.id] = invoice - + for picking in picking_obj.browse(cursor, user, picking_ids, context=context): if not picking.sale_id: continue sale_lines = picking.sale_id.order_line + invoice_created = invoices[result[picking.id]] + + 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 group: