From a6bac8c19f647fe12d5767507e687373446085b4 Mon Sep 17 00:00:00 2001 From: Mustufa Rangwala Date: Wed, 25 Aug 2010 11:54:27 +0530 Subject: [PATCH] [IMP] Account: refund invoice wizard: if there is no refund journal defined (if that field is empty), it should use the journal defined on the current invoice for the refund invoice bzr revid: mra@mra-laptop-20100825062427-1jpd3ocg7mklytyj --- addons/account/wizard/account_invoice_refund.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/addons/account/wizard/account_invoice_refund.py b/addons/account/wizard/account_invoice_refund.py index 6b496670701..22f9ec63789 100644 --- a/addons/account/wizard/account_invoice_refund.py +++ b/addons/account/wizard/account_invoice_refund.py @@ -80,6 +80,7 @@ class account_invoice_refund(osv.osv_memory): period = False description = False company = self.pool.get('res.users').browse(cr, uid, uid).company_id + journal_id = form.get('journal_id', False) for inv in inv_obj.browse(cr, uid, context.get('active_ids'), context=context): if inv.state in ['draft', 'proforma2', 'cancel']: raise osv.except_osv(_('Error !'), _('Can not %s draft/proforma/cancel invoice.') % (mode)) @@ -88,7 +89,8 @@ class account_invoice_refund(osv.osv_memory): else: period = inv.period_id and inv.period_id.id or False - journal_id = form.get('journal_id', False) + if not journal_id: + journal_id = inv.journal_id.id if form['date'] : date = form['date']