From 5ab64aae60c11ab9fdfdb4138c0554f2fdcc7a93 Mon Sep 17 00:00:00 2001 From: vth Date: Thu, 21 Oct 2010 16:32:12 +0530 Subject: [PATCH] [FIX] account: no value in ref field of account.move object in Sales receipt, Customer payment, supplier voucher and Vender payment bzr revid: vth@tinyerp.com-20101021110212-vi1atu6ryqu5ji00 --- addons/account_voucher/account_voucher.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/addons/account_voucher/account_voucher.py b/addons/account_voucher/account_voucher.py index 169a489bfa2..9dca6fdd9c6 100644 --- a/addons/account_voucher/account_voucher.py +++ b/addons/account_voucher/account_voucher.py @@ -584,13 +584,17 @@ class account_voucher(osv.osv): name = self.pool.get('ir.sequence').get_id(cr, uid, inv.journal_id.sequence_id.id) else: raise osv.except_osv(_('Error !'), _('Please define a sequence on the journal !')) + if not inv.reference: + ref = name.replace('/','') + else: + ref = inv.reference move = { 'name': name, 'journal_id': inv.journal_id.id, 'narration': inv.narration, - 'date':inv.date, - 'ref':inv.reference, + 'date': inv.date, + 'ref': ref, 'period_id': inv.period_id and inv.period_id.id or False } move_id = move_pool.create(cr, uid, move)