From 6bc2e55c1f70f27f7f02ea2bb7eff4684ffc2780 Mon Sep 17 00:00:00 2001 From: "psi (Open ERP)" Date: Mon, 25 Oct 2010 16:55:40 +0530 Subject: [PATCH] [FIX] account: Refund wizard was giving error with modify option bzr revid: psi@tinyerp.co.in-20101025112540-wao88mnmornmqmxd --- addons/account/wizard/account_invoice_refund.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/addons/account/wizard/account_invoice_refund.py b/addons/account/wizard/account_invoice_refund.py index 638240664b4..4adc25a049d 100644 --- a/addons/account/wizard/account_invoice_refund.py +++ b/addons/account/wizard/account_invoice_refund.py @@ -179,7 +179,6 @@ class account_invoice_refund(osv.osv_memory): invoice_lines = inv_obj._refund_cleanup_lines(cr, uid, invoice_lines) tax_lines = inv_tax_obj.read(cr, uid, invoice['tax_line'], context=context) tax_lines = inv_obj._refund_cleanup_lines(cr, uid, tax_lines) - invoice.update({ 'type': inv.type, 'date_invoice': date, @@ -190,28 +189,24 @@ class account_invoice_refund(osv.osv_memory): 'period_id': period, 'name': description }) - for field in ('address_contact_id', 'address_invoice_id', 'partner_id', 'account_id', 'currency_id', 'payment_term', 'journal_id'): invoice[field] = invoice[field] and invoice[field][0] - inv_id = inv_obj.create(cr, uid, invoice, {}) if inv.payment_term.id: data = inv_obj.onchange_payment_term_date_invoice(cr, uid, [inv_id], inv.payment_term.id, date) if 'value' in data and data['value']: inv_obj.write(cr, uid, [inv_id], data['value']) created_inv.append(inv_id) - if inv.type in ('out_invoice', 'out_refund'): xml_id = 'action_invoice_tree3' else: xml_id = 'action_invoice_tree4' - result = mod_obj._get_id(cr, uid, 'account', xml_id) id = mod_obj.read(cr, uid, result, ['res_id'], context=context)['res_id'] result = act_obj.read(cr, uid, id, context=context) invoice_domain = eval(result['domain']) - invoice_domain.append(('id', '=', created_inv)) + invoice_domain.append(('id', 'in', created_inv)) result['domain'] = invoice_domain return result @@ -219,6 +214,7 @@ class account_invoice_refund(osv.osv_memory): data_refund = self.read(cr, uid, ids, [],context=context)[0]['filter_refund'] return self.compute_refund(cr, uid, ids, data_refund, context=context) + account_invoice_refund() # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file