[FIX] account: Refund wizard was giving error with modify option
bzr revid: psi@tinyerp.co.in-20101025112540-wao88mnmornmqmxd
This commit is contained in:
parent
03361fc0fb
commit
6bc2e55c1f
|
@ -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:
|
Loading…
Reference in New Issue