← Back to team overview

credativ team mailing list archive

[Bug 909816] Re: Automated Actions don't email when no "Email From:" is provided

 

Hello

when I have created automated action without field 'Email_From'  with
project.task object,then I got following traceback

local value:: {'obj': browse_record(project.task, 90), 'user': browse_record(res.users, 1)}
emails value:: [u'mma@xxxxxxxxxxx', u'amb@xxxxxxxxxxx', u'han@xxxxxxxxxxx']
[2012-01-02 11:03:19,680][?] ERROR:web-services:Uncaught exception
Traceback (most recent call last):
  File "/home/rmu/source/server/trunk/openerp/osv/osv.py", line 120, in wrapper
    return f(self, dbname, *args, **kwargs)
  File "/home/rmu/source/server/trunk/openerp/osv/osv.py", line 172, in execute
    res = self.execute_cr(cr, uid, obj, method, *args, **kw)
  File "/home/rmu/source/server/trunk/openerp/osv/osv.py", line 163, in execute_cr
    return getattr(object, method)(cr, uid, *args, **kw)
  File "/home/rmu/source/addons/trunk/project/wizard/project_task_delegate.py", line 122, in delegate
    delegated_tasks = task_pool.do_delegate(cr, uid, [task_id], delegate_data, context=context)
  File "/home/rmu/source/addons/trunk/project/project.py", line 903, in do_delegate
    }, context=context)
  File "/home/rmu/source/server/trunk/openerp/osv/orm.py", line 4717, in copy
    new_id = self.create(cr, uid, data, context)
  File "/home/rmu/source/addons/trunk/base_action_rule/base_action_rule.py", line 184, in wrapper
    self.post_action(cr, uid, [new_id], model, context=context)
  File "/home/rmu/source/addons/trunk/base_action_rule/base_action_rule.py", line 171, in post_action
    self._action(cr, uid, [rule_id], obj.browse(cr, uid, ids, context=context), context=context)
  File "/home/rmu/source/addons/trunk/base_action_rule/base_action_rule.py", line 471, in _action
    self.do_action(cr, uid, action, model_obj, obj, context=context)
  File "/home/rmu/source/addons/trunk/crm/crm_action_rule.py", line 93, in do_action
    res = super(base_action_rule, self).do_action(cr, uid, action, model_obj, obj, context=context)
  File "/home/rmu/source/addons/trunk/base_action_rule/base_action_rule.py", line 441, in do_action
    email_from = safe_eval(action.act_email_from, {}, locals_for_emails)
  File "/home/rmu/source/server/trunk/openerp/tools/safe_eval.py", line 253, in safe_eval
    if '__subclasses__' in expr:
TypeError: argument of type 'bool' is not iterable

When I have created automated action  with 'Email_from' with filled
value for project.task object. I got this traceback


Traceback (most recent call last):
  File "/home/rmu/source/server/trunk/openerp/osv/osv.py", line 120, in wrapper
    return f(self, dbname, *args, **kwargs)
  File "/home/rmu/source/server/trunk/openerp/osv/osv.py", line 172, in execute
    res = self.execute_cr(cr, uid, obj, method, *args, **kw)
  File "/home/rmu/source/server/trunk/openerp/osv/osv.py", line 163, in execute_cr
    return getattr(object, method)(cr, uid, *args, **kw)
  File "/home/rmu/source/addons/trunk/project/wizard/project_task_delegate.py", line 122, in delegate
    delegated_tasks = task_pool.do_delegate(cr, uid, [task_id], delegate_data, context=context)
  File "/home/rmu/source/addons/trunk/project/project.py", line 903, in do_delegate
    }, context=context)
  File "/home/rmu/source/server/trunk/openerp/osv/orm.py", line 4717, in copy
    new_id = self.create(cr, uid, data, context)
  File "/home/rmu/source/addons/trunk/base_action_rule/base_action_rule.py", line 184, in wrapper
    self.post_action(cr, uid, [new_id], model, context=context)
  File "/home/rmu/source/addons/trunk/base_action_rule/base_action_rule.py", line 171, in post_action
    self._action(cr, uid, [rule_id], obj.browse(cr, uid, ids, context=context), context=context)
  File "/home/rmu/source/addons/trunk/base_action_rule/base_action_rule.py", line 471, in _action
    self.do_action(cr, uid, action, model_obj, obj, context=context)
  File "/home/rmu/source/addons/trunk/crm/crm_action_rule.py", line 93, in do_action
    res = super(base_action_rule, self).do_action(cr, uid, action, model_obj, obj, context=context)
  File "/home/rmu/source/addons/trunk/base_action_rule/base_action_rule.py", line 441, in do_action
    email_from = safe_eval(action.act_email_from, {}, locals_for_emails)
  File "/home/rmu/source/server/trunk/openerp/tools/safe_eval.py", line 296, in safe_eval
    return eval(test_expr(expr,_SAFE_OPCODES, mode=mode), globals_dict, locals_dict)
  File "", line 1, in <module>
NameError: name 'object' is not defined

so I let this issue to  team(addons-1) , to decide this field is filled
or empty

-- 
You received this bug notification because you are a member of OpenERP
Framework Experts, which is subscribed to OpenERP Addons.
https://bugs.launchpad.net/bugs/909816

Title:
  Automated Actions don't email when no "Email From:" is provided

Status in OpenERP Addons (modules):
  New

Bug description:
  Creating an Automated Action to e-mail someone when a Project Task is
  created, the e-mail is only sent if you set the "Email From" field,
  which is not mandatory.

  I believe that the problem is on base_action_rule.py, at the end of method do_action() there is an "if" clause preventing the e-mail to be sent:
              if email_froms:
                  self.email_send(cr, uid, obj, emails, action.act_mail_body, emailfrom=email_froms[0])

  Please note that if you try the same procedure on the Project Issue
  model, the email is correctly sent, since the do_action() on the
  crm_base_rule.py does not have this problem.

To manage notifications about this bug go to:
https://bugs.launchpad.net/openobject-addons/+bug/909816/+subscriptions


References