From 94fbc9dabb932ce2c71a980220eb07b6d5085307 Mon Sep 17 00:00:00 2001 From: "Guewen Baconnier @ Camptocamp" Date: Thu, 23 Feb 2012 15:46:52 +0100 Subject: [PATCH] [MRG] from 6.1 c2c-financial-addons (lp:c2c-addons/6.1 rev 19.1.1) --- currency_rate_update/__openerp__.py | 4 +--- currency_rate_update/currency_rate_update.py | 11 ++++++----- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/currency_rate_update/__openerp__.py b/currency_rate_update/__openerp__.py index cc4b54b90..1cce4f384 100755 --- a/currency_rate_update/__openerp__.py +++ b/currency_rate_update/__openerp__.py @@ -74,9 +74,7 @@ A function field let you know your currency configuration. If in multi-company mode, the base currency will be the first company's currency found in database. -Thanks to main contributors : Grzegorz Grzelak - - +Thanks to main contributors : Grzegorz Grzelak, Alexis de Lattre """, "depends" : ["base", "account"], #Added to ensure account security groups are present diff --git a/currency_rate_update/currency_rate_update.py b/currency_rate_update/currency_rate_update.py index ad216f43d..1ad031a28 100755 --- a/currency_rate_update/currency_rate_update.py +++ b/currency_rate_update/currency_rate_update.py @@ -98,11 +98,12 @@ class Currency_rate_update_service(osv.osv): ] def _check_max_delta_days(self, cr, uid, ids): - for i in ids: - value_to_check = self.read(cr, uid, i, ['max_delta_days'])['max_delta_days'] - if value_to_check >= 0: - return True - else: return False + for company in self.read(cr, uid, ids, ['max_delta_days']): + if company['max_delta_days'] >= 0: + continue + else: + return False + return True _constraints = [ (_check_max_delta_days, "'Max delta days' must be >= 0", ['max_delta_days']),