Fix refund supplier invoice to have the same journal
bzr revid: ced-56ae7c13ee54a4a7776147ad025c86254dfd8d09
This commit is contained in:
@@ -632,7 +632,7 @@ class account_invoice(osv.osv):
|
||||
return map(lambda x: (0,0,x), lines)
|
||||
|
||||
def refund(self, cr, uid, ids):
|
||||
invoices = self.read(cr, uid, ids, ['name', 'type', 'number', 'reference', 'comment', 'date_due', 'partner_id', 'address_contact_id', 'address_invoice_id', 'partner_contact', 'partner_insite', 'partner_ref', 'payment_term', 'account_id', 'currency_id', 'invoice_line', 'tax_line'])
|
||||
invoices = self.read(cr, uid, ids, ['name', 'type', 'number', 'reference', 'comment', 'date_due', 'partner_id', 'address_contact_id', 'address_invoice_id', 'partner_contact', 'partner_insite', 'partner_ref', 'payment_term', 'account_id', 'currency_id', 'invoice_line', 'tax_line', 'journal_id'])
|
||||
|
||||
new_ids = []
|
||||
for invoice in invoices:
|
||||
@@ -664,7 +664,7 @@ class account_invoice(osv.osv):
|
||||
|
||||
# take the id part of the tuple returned for many2one fields
|
||||
for field in ('address_contact_id', 'address_invoice_id', 'partner_id',
|
||||
'account_id', 'currency_id', 'payment_term'):
|
||||
'account_id', 'currency_id', 'payment_term', 'journal_id'):
|
||||
invoice[field] = invoice[field] and invoice[field][0]
|
||||
|
||||
# create the new invoice
|
||||
|
||||
Reference in New Issue
Block a user