From 8add10403c5d9277ae93b84db9928f7a04035f35 Mon Sep 17 00:00:00 2001 From: vth Date: Thu, 21 Oct 2010 12:28:57 +0530 Subject: [PATCH] [FIX] account: supplier invoice bzr revid: vth@tinyerp.com-20101021065857-cn9j5h2lpzppwm4e --- addons/account/invoice.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/addons/account/invoice.py b/addons/account/invoice.py index 4b09f6fbad1..0552701f28e 100644 --- a/addons/account/invoice.py +++ b/addons/account/invoice.py @@ -970,12 +970,15 @@ class account_invoice(osv.osv): invtype = obj_inv.type number = obj_inv.number move_id = obj_inv.move_id and obj_inv.move_id.id or False - reference = obj_inv.reference or number or '' + reference = obj_inv.reference or '' self.write(cr, uid, ids, {'internal_number':number}) if invtype in ('in_invoice', 'in_refund'): - ref = reference + if not reference: + ref = self._convert_ref(cr, uid, number) + else: + ref = reference else: ref = self._convert_ref(cr, uid, number)