[FIX]:in the purchase journal when refence is not avalible use the invoice number...
authorksa (OpenERP) <ksa@tinyerp.com>
Wed, 15 Feb 2012 10:17:04 +0000 (15:47 +0530)
committerksa (OpenERP) <ksa@tinyerp.com>
Wed, 15 Feb 2012 10:17:04 +0000 (15:47 +0530)
bzr revid: ksa@tinyerp.com-20120215101704-wuwkrdf1olsyfi15

addons/account/invoice.py

index 696e75d..fc4e5fb 100644 (file)
@@ -752,7 +752,10 @@ class account_invoice(osv.osv):
                     raise osv.except_osv(_('Warning !'), _('There is no active invoice sequence defined for the journal !'))
 
                 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)
                 cr.execute('UPDATE account_invoice SET number=%s ' \