Don't run rules with time conditions from the create/write methods of models.
bzr revid: daniel.watkins@credativ.co.uk-20100909132721-wlnqp4uzwf3s7gjb
This commit is contained in:
parent
7c33b854ce
commit
e5465c80c8
|
@ -152,7 +152,10 @@ the rule to mark CC(mail to any other person defined in actions)."),
|
|||
continue
|
||||
else:
|
||||
obj = self.pool.get(obj_name)
|
||||
self._action(cr, uid, [rule_id], obj.browse(cr, uid, ids, context=context), context=context)
|
||||
# If the rule doesn't involve a time condition, run it immediately
|
||||
# Otherwise we let the scheduler run the action
|
||||
if self.browse(cr, uid, rule_id, context=context).trg_date_type == 'none':
|
||||
self._action(cr, uid, [rule_id], obj.browse(cr, uid, ids, context=context), context=context)
|
||||
return True
|
||||
|
||||
def _create(self, old_create, model, context=None):
|
||||
|
|
Loading…
Reference in New Issue