[FIX] account : passed context parameter in arguments in account_invoice.py

lp bug: https://launchpad.net/bugs/710533 fixed

bzr revid: bde@tinyerp.com-20111212070403-6vmv02hz9qi6ibxc
This commit is contained in:
Bharat (OpenERP) 2011-12-12 12:34:03 +05:30
parent dce7b0bb00
commit f699ba12d9
1 changed files with 6 additions and 6 deletions

View File

@ -811,12 +811,12 @@ class account_invoice(osv.osv):
if not inv.date_invoice:
self.write(cr, uid, [inv.id], {'date_invoice':time.strftime('%Y-%m-%d')})
company_currency = inv.company_id.currency_id.id
# create the analytical lines
# one move line per invoice line
iml = self._get_analytic_lines(cr, uid, inv.id)
# check if taxes are all computed
ctx = context.copy()
ctx.update({'lang': inv.partner_id.lang})
# create the analytical lines
# one move line per invoice line
iml = self._get_analytic_lines(cr, uid, inv.id, context=ctx)
# check if taxes are all computed
compute_taxes = ait_obj.compute(cr, uid, inv.id, context=ctx)
self.check_tax_lines(cr, uid, inv, compute_taxes, ait_obj)
@ -835,7 +835,7 @@ class account_invoice(osv.osv):
raise osv.except_osv(_('Error !'), _("Can not create the invoice !\nThe related payment term is probably misconfigured as it gives a computed amount greater than the total invoiced amount."))
# one move line per tax line
iml += ait_obj.move_line_get(cr, uid, inv.id)
iml += ait_obj.move_line_get(cr, uid, inv.id, context=ctx)
entry_type = ''
if inv.type in ('in_invoice', 'in_refund'):
@ -1611,7 +1611,7 @@ class account_invoice_tax(osv.osv):
t['tax_amount'] = cur_obj.round(cr, uid, cur, t['tax_amount'])
return tax_grouped
def move_line_get(self, cr, uid, invoice_id):
def move_line_get(self, cr, uid, invoice_id, context=None):
res = []
cr.execute('SELECT * FROM account_invoice_tax WHERE invoice_id=%s', (invoice_id,))
for t in cr.dictfetchall():