Skip to content

Commit

Permalink
[FIX] base_action_rule: argument in _action
Browse files Browse the repository at this point in the history
bzr revid: hmo@tinyerp.com-20121009111221-dris93pcszjj11es
  • Loading branch information
hmo-odoo committed Oct 9, 2012
1 parent 76d93f2 commit 257b397
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions addons/base_action_rule/base_action_rule.py
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ def _check(self, cr, uid, automatic=False, use_new_cursor=False, \
action_date = base + delay
if (not last_run or (last_run <= action_date < now)):
try:
self._action(cr, uid, rule, obj, context=ctx)
self._action(cr, uid, [rule.id], obj, context=ctx)
self.write(cr, uid, [rule.id], {'last_run': now}, context=context)
except Exception, e:
import traceback
Expand Down Expand Up @@ -308,17 +308,20 @@ def do_action(self, cr, uid, action, obj, context=None):
model_obj.message_subscribe(cr, uid, [obj.id], new_followers, context=context)
return True

def _action(self, cr, uid, action, obj, scrit=None, context=None):
def _action(self, cr, uid, ids, objects, scrit=None, context=None):
""" Do Action """
if context is None:
context = {}

context.update({'action': True})
if not scrit:
scrit = []

if self.do_check(cr, uid, action, obj, context=context):
self.do_action(cr, uid, action, obj, context=context)
if not isinstance(objects, list):
objects = [objects]
for action in self.browse(cr, uid, ids, context=context):
for obj in objects:
if self.do_check(cr, uid, action, obj, context=context):
self.do_action(cr, uid, action, obj, context=context)

context.update({'action': False})
return True
Expand Down

0 comments on commit 257b397

Please sign in to comment.