From 2d353ca2f8ceabd846a86843596608d937b28074 Mon Sep 17 00:00:00 2001 From: Raphael Collet Date: Fri, 5 Aug 2011 17:31:34 +0200 Subject: [PATCH] [IMP] disable res.log when running config wizards; to be tested bzr revid: rco@openerp.com-20110805153134-snpfjuw859wkrq36 --- openerp/addons/base/ir/ir_actions.py | 8 +++++++- openerp/osv/orm.py | 2 ++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/openerp/addons/base/ir/ir_actions.py b/openerp/addons/base/ir/ir_actions.py index 7c8a2414d25..637c62fecb6 100644 --- a/openerp/addons/base/ir/ir_actions.py +++ b/openerp/addons/base/ir/ir_actions.py @@ -856,7 +856,11 @@ Normal Recurring: the wizard is visible in the configuration panel regardless of wizard = self.browse(cr, uid, wizard_id, context=context) res = self.pool.get('ir.actions.act_window').read(cr, uid, wizard.action_id.id, [], context=context) res.update({'nodestroy': True}) - + + # disable log when running wizard + res['context'] = res.get('context') or {} + res['context'].update({'disable_log': True}) + # Open a specific record when res_id is provided in the context if res.get('context'): user = self.pool.get('res.users').browse(cr, uid, uid, context=context) @@ -864,6 +868,8 @@ Normal Recurring: the wizard is visible in the configuration panel regardless of if ctx.get('res_id'): res.update({'res_id': ctx.pop('res_id')}) res.update({'context': ctx}) + + # return res def action_open(self, cr, uid, ids, context=None): diff --git a/openerp/osv/orm.py b/openerp/osv/orm.py index 48d66f30e32..0981a77c7f1 100644 --- a/openerp/osv/orm.py +++ b/openerp/osv/orm.py @@ -607,6 +607,8 @@ class orm_template(object): CONCURRENCY_CHECK_FIELD = '__last_update' def log(self, cr, uid, id, message, secondary=False, context=None): + if context and context.get('disable_log'): + return True return self.pool.get('res.log').create(cr, uid, { 'name': message,