Bharat Devnani (Open ERP) has proposed merging
lp:~openerp-dev/openobject-addons/trunk-bug-710533-bde into
lp:openobject-addons.
Requested reviews:
OpenERP Core Team (openerp)
Related bugs:
Bug #710533 in OpenERP Addons: "account invoice model translation problem
with no context param"
https://bugs.launchpad.net/openobject-addons/+bug/710533
For more details, see:
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-bug-710533-bde/+merge/85293
Hello Sir,
I have passed context agruments in some methods of account/account_invoice.py.
Thanks & Regards,
Devnani Bharat R.
--
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-bug-710533-bde/+merge/85293
Your team OpenERP R&D Team is subscribed to branch
lp:~openerp-dev/openobject-addons/trunk-bug-710533-bde.
=== modified file 'account/account_invoice.py'
--- account/account_invoice.py 2011-12-06 10:13:54 +0000
+++ account/account_invoice.py 2011-12-12 07:22:26 +0000
@@ -811,12 +811,12 @@
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
+ 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)
+ iml = self._get_analytic_lines(cr, uid, inv.id, context=ctx)
# check if taxes are all computed
- ctx = context.copy()
- ctx.update({'lang': inv.partner_id.lang})
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 @@
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 @@
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():
_______________________________________________
Mailing list: https://launchpad.net/~openerp-dev-gtk
Post to : [email protected]
Unsubscribe : https://launchpad.net/~openerp-dev-gtk
More help : https://help.launchpad.net/ListHelp