[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:
parent
0a3b4b7fb7
commit
d08821442e
|
@ -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):
|
||||
|
|
Loading…
Reference in New Issue