[IMP] base_action_rule: update records before executing server actions
bzr revid: rco@openerp.com-20130301110301-xu4iaxi7hysmclm4
This commit is contained in:
parent
51fbcd39fb
commit
9c21a6902a
|
@ -108,15 +108,6 @@ class base_action_rule(osv.osv):
|
||||||
|
|
||||||
def _process(self, cr, uid, action, record_ids, context=None):
|
def _process(self, cr, uid, action, record_ids, context=None):
|
||||||
""" process the given action on the records """
|
""" process the given action on the records """
|
||||||
# execute server actions
|
|
||||||
model = self.pool.get(action.model_id.model)
|
|
||||||
if action.server_action_ids:
|
|
||||||
server_action_ids = map(int, action.server_action_ids)
|
|
||||||
for record in model.browse(cr, uid, record_ids, context):
|
|
||||||
action_server_obj = self.pool.get('ir.actions.server')
|
|
||||||
ctx = dict(context, active_model=model._name, active_ids=[record.id], active_id=record.id)
|
|
||||||
action_server_obj.run(cr, uid, server_action_ids, context=ctx)
|
|
||||||
|
|
||||||
# modify records
|
# modify records
|
||||||
values = {}
|
values = {}
|
||||||
if 'date_action_last' in model._all_columns:
|
if 'date_action_last' in model._all_columns:
|
||||||
|
@ -130,6 +121,15 @@ class base_action_rule(osv.osv):
|
||||||
follower_ids = map(int, action.act_followers)
|
follower_ids = map(int, action.act_followers)
|
||||||
model.message_subscribe(cr, uid, record_ids, follower_ids, context=context)
|
model.message_subscribe(cr, uid, record_ids, follower_ids, context=context)
|
||||||
|
|
||||||
|
# execute server actions
|
||||||
|
model = self.pool.get(action.model_id.model)
|
||||||
|
if action.server_action_ids:
|
||||||
|
server_action_ids = map(int, action.server_action_ids)
|
||||||
|
for record in model.browse(cr, uid, record_ids, context):
|
||||||
|
action_server_obj = self.pool.get('ir.actions.server')
|
||||||
|
ctx = dict(context, active_model=model._name, active_ids=[record.id], active_id=record.id)
|
||||||
|
action_server_obj.run(cr, uid, server_action_ids, context=ctx)
|
||||||
|
|
||||||
return True
|
return True
|
||||||
|
|
||||||
def _wrap_create(self, old_create, model):
|
def _wrap_create(self, old_create, model):
|
||||||
|
|
Loading…
Reference in New Issue