From 89da593cdc0adfb051f711f48179176d5377de8f Mon Sep 17 00:00:00 2001 From: "mra (Open ERP)" Date: Wed, 12 May 2010 19:02:20 +0530 Subject: [PATCH] [IMP] account: Change currency wizard bzr revid: mra@tinyerp.com-20100512133220-be5drrwi22mohoot --- addons/account/wizard/account_change_currency.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/addons/account/wizard/account_change_currency.py b/addons/account/wizard/account_change_currency.py index 1e23b793d27..eee754435cd 100644 --- a/addons/account/wizard/account_change_currency.py +++ b/addons/account/wizard/account_change_currency.py @@ -42,6 +42,7 @@ class account_change_currency(osv.osv_memory): obj_inv = self.pool.get('account.invoice') obj_inv_line = self.pool.get('account.invoice.line') obj_currency = self.pool.get('res.currency') + invoice_ids = [] if context is None: context = {} data = self.read(cr, uid, ids)[0] @@ -66,7 +67,8 @@ class account_change_currency(osv.osv_memory): new_price = (line.price_unit / old_rate ) * rate obj_inv_line.write(cr, uid, [line.id], {'price_unit' : new_price}) - obj_inv.write(cr, uid, [invoice.id], {'currency_id' : new_currency}) + invoice_ids.append(invoice.id) + obj_inv.write(cr, uid, invoice_ids, {'currency_id' : new_currency}, context=context) return {} account_change_currency()