[MERGE] BUG 1096061: account: fix traceback on refund type 'modify'
Add docstring to account.invoice _refund_cleanup_lines() to make explicit that a want ``lines`` as list of browse_record. lp bug: https://launchpad.net/bugs/1096061 fixed bzr revid: xal@openerp.com-20130215092727-mkff1tfjmi0qv72k
This commit is contained in:
commit
5cdb8efab6
|
@ -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 = {}
|
||||
|
|
|
@ -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,
|
||||
|
|
Loading…
Reference in New Issue