From bbad963f1b9c3cae478a75bb99abe13f9aeda9c6 Mon Sep 17 00:00:00 2001 From: "Jay (Open ERP)" Date: Mon, 26 Oct 2009 18:20:05 +0530 Subject: [PATCH 1/4] [FIX] Config : wrong calculation if cached_timeout comes from config file bzr revid: jvo@tinyerp.com-20091026125005-r8jbk8iqhpessa2c --- bin/tools/misc.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/tools/misc.py b/bin/tools/misc.py index d8bd58bfcbd..ca93a3936e2 100644 --- a/bin/tools/misc.py +++ b/bin/tools/misc.py @@ -662,9 +662,9 @@ class cache(object): self.fun_default_values = dict(zip(self.fun_arg_names[-len(argspec[3]):], argspec[3])) def cached_result(self2, cr, *args, **kwargs): - if time.time()-self.timeout > self.lasttime: + if time.time()-int(self.timeout) > self.lasttime: self.lasttime = time.time() - t = time.time()-self.timeout + t = time.time()-int(self.timeout) old_keys = [key for key in self.cache if self.cache[key][1] < t] for key in old_keys: del self.cache[key] From ab09c43edd6866b768943ddfd0b7e7f29fa41128 Mon Sep 17 00:00:00 2001 From: "Jay (Open ERP)" Date: Tue, 27 Oct 2009 11:24:19 +0530 Subject: [PATCH 2/4] [FIX] Ir_attachment : Context updation corrected on preview lp bug: https://launchpad.net/bugs/460560 fixed bzr revid: jvo@tinyerp.com-20091027055419-du965jjvgup05amh --- bin/addons/base/ir/ir_attachment.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/bin/addons/base/ir/ir_attachment.py b/bin/addons/base/ir/ir_attachment.py index 1339ea284a3..9c4ab915674 100644 --- a/bin/addons/base/ir/ir_attachment.py +++ b/bin/addons/base/ir/ir_attachment.py @@ -91,8 +91,9 @@ class ir_attachment(osv.osv): result = {} if context is None: context = {} - context['bin_size'] = False - for i in self.browse(cr, uid, ids, context=context): + ctx = context.copy() + ctx['bin_size'] = False + for i in self.browse(cr, uid, ids, context=ctx): result[i.id] = False for format in ('png','jpg','jpeg','gif','bmp'): if (i.datas_fname and i.datas_fname.lower() or '').endswith(format): From db8f833229f950c7bc7056cc650704f2b37d605e Mon Sep 17 00:00:00 2001 From: "UCO,JVO" <> Date: Tue, 27 Oct 2009 18:42:56 +0530 Subject: [PATCH 3/4] [FIX] Record rule : domain evaluation problem corrected lp bug: https://launchpad.net/bugs/410191 fixed bzr revid: jvo@tinyerp.com-20091027131256-7q2gl9vzf21jsuir --- bin/addons/base/ir/ir_rule.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/bin/addons/base/ir/ir_rule.py b/bin/addons/base/ir/ir_rule.py index a2d53b4de27..d8235403ce3 100644 --- a/bin/addons/base/ir/ir_rule.py +++ b/bin/addons/base/ir/ir_rule.py @@ -107,6 +107,11 @@ class ir_rule(osv.osv): for rule in self.browse(cr, uid, ids, context): eval_user_data = {'user': self.pool.get('res.users').browse(cr, 1, uid), 'time':time} + if rule.operand.startswith('user.') and rule.operand.count('.') > 1: + #Need to check user.field.field1.field2(if field is False,it will break the chain) + op = rule.operand[5:] + rule.operand = rule.operand[:5+len(op[:op.find('.')])] +' and '+ rule.operand + ' or False' + if rule.domain_force: res[rule.id] = eval(rule.domain_force, eval_user_data) else: From 97129738266d38ea98a0f9ed4e2bc785ea3b721b Mon Sep 17 00:00:00 2001 From: "Jay (Open ERP)" Date: Fri, 30 Oct 2009 17:41:06 +0530 Subject: [PATCH 4/4] [REF] Partner : copy() improved lp bug: https://launchpad.net/bugs/463415 fixed bzr revid: jvo@tinyerp.com-20091030121106-tyl0c5azlu1dll8k --- bin/addons/base/res/partner/partner.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/addons/base/res/partner/partner.py b/bin/addons/base/res/partner/partner.py index 2e5c23c7b6c..5adcbb7ea16 100644 --- a/bin/addons/base/res/partner/partner.py +++ b/bin/addons/base/res/partner/partner.py @@ -166,9 +166,9 @@ class res_partner(osv.osv): 'customer': lambda *a: 1, 'category_id': _default_category, } - def copy(self, cr, uid, id, default=None, context={}): + def copy(self, cr, uid, id, default={}, context={}): name = self.read(cr, uid, [id], ['name'])[0]['name'] - default.update({'name': name+' (copy)', 'events':[]}) + default.update({'name': name+ _(' (copy)'), 'events':[]}) return super(res_partner, self).copy(cr, uid, id, default, context) def _check_ean_key(self, cr, uid, ids):