From d08821442e47efd873eb167e68bfa145b2de3e6f Mon Sep 17 00:00:00 2001 From: Olivier Dony Date: Mon, 16 Dec 2013 15:20:49 +0100 Subject: [PATCH] [FIX] base_action_rule: upon update/create of an automated action in multiprocess mode, force registry reload Short of signaling the other workers, the (new) automated rule may be randomly ignored, depending on which worker handles the request (until the workers all reload their registries). bzr revid: odo@openerp.com-20131216142049-xh9gxy5cir3p2i09 --- addons/base_action_rule/base_action_rule.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/addons/base_action_rule/base_action_rule.py b/addons/base_action_rule/base_action_rule.py index a73933ff0f2..3d45407cb0e 100644 --- a/addons/base_action_rule/base_action_rule.py +++ b/addons/base_action_rule/base_action_rule.py @@ -23,6 +23,7 @@ from datetime import datetime, timedelta import time import logging +import openerp from openerp import SUPERUSER_ID from openerp.osv import fields, osv from openerp.tools import DEFAULT_SERVER_DATETIME_FORMAT @@ -206,6 +207,7 @@ class base_action_rule(osv.osv): def create(self, cr, uid, vals, context=None): res_id = super(base_action_rule, self).create(cr, uid, vals, context=context) self._register_hook(cr, [res_id]) + openerp.modules.registry.RegistryManager.signal_registry_change(cr.dbname) return res_id def write(self, cr, uid, ids, vals, context=None): @@ -213,6 +215,7 @@ class base_action_rule(osv.osv): ids = [ids] super(base_action_rule, self).write(cr, uid, ids, vals, context=context) self._register_hook(cr, ids) + openerp.modules.registry.RegistryManager.signal_registry_change(cr.dbname) return True def onchange_model_id(self, cr, uid, ids, model_id, context=None):