[6.0] crm/crm_action_rule - mail action doesn't send mails to user and watchers

Bug #912841 reported by Yannick Vaucher @ Camptocamp
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Odoo Addons (MOVED TO GITHUB)
Fix Released
Low
OpenERP Publisher's Warranty Team

Bug Description

Hello,

Method do_action overwrite in crm_action_rule but it doesn't include all email action informations.

Those fields are not considered :

- act_email_to
- act_email_from
- act_mail_to_user
- act_mail_to_watchers
- act_mail_to_email

and

act_email_cc is added to followers of the model like crm_case, but those followers won't receive the current message if send to followers is checked

The reason is certainly because base_action_rule evolved but crm didn't follow.

Might this function do_action should be reviewed to split the part of modifing object fields and the part of gathering emails ?

---------

And by the way tool tips of automated action seems weird for me maybe there are some extra words. (but I'm not a native english speaker)

Here is an exemple
"Use a python expression to specify the right field on which one than we will use the 'To' field of the header"

I would say
"Specify the 'To' header field. A python expression can be used."

Regards,
Yannick

Tags: maintenance

Related branches

description: updated
tags: added: maintenance
Changed in openobject-addons:
assignee: nobody → OpenERP Publisher's Warranty Team (openerp-opw)
Revision history for this message
Yannick Vaucher @ Camptocamp (yvaucher-c2c) wrote :
Download full text (3.3 KiB)

About what I said on act_email_cc, I tested it a bit further

It tries to use act_email_cc of the object. (instead of the action ?)
However, the object crm.lead has no attribute act_email_cc.

------------------------------------------------------------------
crm/crm_action_rule.py @ line 117 - 124

If hasattr(obj, 'email_cc') and action.act_email_cc:
            if '@' in (obj.email_cc or ''):
                emails = obj.email_cc.split(",")
                if obj.act_email_cc not in emails:# and '<'+str(action.act_email_cc)+">" not in emails:
                    write['email_cc'] = obj.email_cc+','+obj.act_email_cc
            else:
                write['email_cc'] = obj.act_email_cc
------------------------------------------------------------------

We check if obj has email_cc but not if it has act_email_cc

So in case of a rule on a crm.lead

I get the following error :

Environment Information :
System : Linux-2.6.32-37-generic-i686-with-Ubuntu-10.04-lucid
OS Name : posix
Distributor ID: Ubuntu
Description: Ubuntu 10.04.3 LTS
Release: 10.04
Codename: lucid
Operating System Release : 2.6.32-37-generic
Operating System Version : #81-Ubuntu SMP Fri Dec 2 20:35:14 UTC 2011
Operating System Architecture : 32bit
Operating System Locale : en_US.UTF8
Python Version : 2.6.5
OpenERP-Client Version : 6.0.3
Last revision No. & ID :Bazaar Package not Found !Traceback (most recent call last):
  File "/home/yvaucher/Projects/bzr_c2c/c2c_openerpv6_migr/trunk/src/server/bin/netsvc.py", line 489, in dispatch
    result = ExportService.getService(service_name).dispatch(method, auth, params)
  File "/home/yvaucher/Projects/bzr_c2c/c2c_openerpv6_migr/trunk/src/server/bin/service/web_services.py", line 599, in dispatch
    res = fn(db, uid, *params)
  File "/home/yvaucher/Projects/bzr_c2c/c2c_openerpv6_migr/trunk/src/server/bin/osv/osv.py", line 122, in wrapper
    return f(self, dbname, *args, **kwargs)
  File "/home/yvaucher/Projects/bzr_c2c/c2c_openerpv6_migr/trunk/src/server/bin/osv/osv.py", line 176, in execute
    res = self.execute_cr(cr, uid, obj, method, *args, **kw)
  File "/home/yvaucher/Projects/bzr_c2c/c2c_openerpv6_migr/trunk/src/server/bin/osv/osv.py", line 167, in execute_cr
    return getattr(object, method)(cr, uid, *args, **kw)
  File "/home/yvaucher/Projects/bzr_c2c/c2c_openerpv6_migr/trunk/src/server/bin/addons/base_action_rule/base_action_rule.py", line 187, in make_call_old
    self.pre_action(cr, uid, ids, model, context=context)
  File "/home/yvaucher/Projects/bzr_c2c/c2c_openerpv6_migr/trunk/src/server/bin/addons/action_rule_trg_dates/action_rule.py", line 74, in pre_action
    self._action(cr, uid, [rule_id], obj.browse(cr, uid, ids, context=context), context=context)
  File "/home/yvaucher/Projects/bzr_c2c/c2c_openerpv6_migr/trunk/src/server/bin/addons/base_action_rule/base_action_rule.py", line 469, in _action
    self.do_action(cr, uid, action, model_obj, obj, context)
  File "/home/yvaucher/Projects/bzr_c2c/c2c_openerpv6_migr/trunk/src/server/bin/addons/crm/crm_action_rule.py", line 124, in do_action
    write['email_cc'] = obj.act_email_cc
  File "/home/yvaucher/Projects/bzr_c2c/c2c_openerpv6_migr/trunk/src/server/bin/osv/...

Read more...

Revision history for this message
Yannick Vaucher @ Camptocamp (yvaucher-c2c) wrote :

Hello,

I was wrong, the first part of this bug report is invalid. I haven't seen the call to super in do_action.

So we just need a fix for act_email_cc

Thanks,
Yannick

Changed in openobject-addons:
status: New → Confirmed
status: Confirmed → In Progress
Revision history for this message
Somesh Khare (somesh.khare) wrote :

Hello Yannick,

Thanks for reporting this issue.

It has been fixed into the lp:~openerp-dev/openobject-addons/6.0-opw-267641-skh branch,

Revision ID: <email address hidden>
Revision Number: 4988

This branch is under the review of our Experts and will be merged soon into the stable lp:openobject-addons/6.0 branch.

Thanks

Changed in openobject-addons:
importance: Undecided → Low
status: In Progress → Fix Committed
Changed in openobject-addons:
status: Fix Committed → Fix Released
milestone: none → 6.0.4
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.