diff --git a/addons/account/account_invoice.py b/addons/account/account_invoice.py index 2c59fe26bf0..f255b6788ee 100644 --- a/addons/account/account_invoice.py +++ b/addons/account/account_invoice.py @@ -1145,6 +1145,11 @@ class account_invoice(osv.osv): return self.name_get(cr, user, ids, context) def _refund_cleanup_lines(self, cr, uid, lines, context=None): + """Convert records to dict of values suitable for one2many line creation + + :param list(browse_record) lines: records to convert + :return: list of command tuple for one2many line creation [(0, 0, dict of valueis), ...] + """ clean_lines = [] for line in lines: clean_line = {} diff --git a/addons/account/wizard/account_invoice_refund.py b/addons/account/wizard/account_invoice_refund.py index 54d6c38a353..2d95687ff2d 100644 --- a/addons/account/wizard/account_invoice_refund.py +++ b/addons/account/wizard/account_invoice_refund.py @@ -183,9 +183,9 @@ class account_invoice_refund(osv.osv_memory): 'journal_id', 'period_id'], context=context) invoice = invoice[0] del invoice['id'] - invoice_lines = inv_line_obj.read(cr, uid, invoice['invoice_line'], context=context) + invoice_lines = inv_line_obj.browse(cr, uid, invoice['invoice_line'], context=context) 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_tax_obj.browse(cr, uid, invoice['tax_line'], context=context) tax_lines = inv_obj._refund_cleanup_lines(cr, uid, tax_lines) invoice.update({ 'type': inv.type,