mirror of
https://github.com/OCA/rma.git
synced 2025-02-16 17:11:47 +02:00
[FIX] fix refund creation from invoice
This commit is contained in:
@@ -26,7 +26,7 @@ from osv import fields, osv
|
||||
class account_invoice(osv.osv):
|
||||
|
||||
_inherit = "account.invoice"
|
||||
|
||||
|
||||
|
||||
_columns = {
|
||||
'claim_id': fields.many2one('crm.claim', 'Claim'),
|
||||
@@ -40,6 +40,7 @@ class account_invoice(osv.osv):
|
||||
invoice_line_info = self.pool.get('account.invoice.line').read(cr, uid, claim_info['invoice_line_id'][0], context=context)
|
||||
invoice_line_info['quantity'] = claim_info['product_returned_quantity']
|
||||
new_lines.append(invoice_line_info)
|
||||
return super(account_invoice, self)._refund_cleanup_lines(cr, uid, new_lines, context=context)
|
||||
lines = new_lines
|
||||
return super(account_invoice, self)._refund_cleanup_lines(cr, uid, lines, context=context)
|
||||
|
||||
account_invoice()
|
||||
|
||||
@@ -24,7 +24,9 @@ class account_invoice_refund(osv.osv_memory):
|
||||
_inherit = "account.invoice.refund"
|
||||
|
||||
def compute_refund(self, cr, uid, ids, mode='refund', context=None):
|
||||
context['active_ids'] = context['invoice_ids']
|
||||
if context is None: context={}
|
||||
if context.get('invoice_ids'):
|
||||
context['active_ids'] = context.get('invoice_ids')
|
||||
return super(account_invoice_refund, self).compute_refund(cr, uid, ids, mode='refund', context=context)
|
||||
|
||||
account_invoice_refund()
|
||||
|
||||
Reference in New Issue
Block a user