[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
This commit is contained in:
Olivier Dony 2013-12-16 15:20:49 +01:00
parent 0a3b4b7fb7
commit d08821442e
1 changed files with 3 additions and 0 deletions

View File

@ -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):