Merge lp:~openerp-dev/openobject-addons/6.1-opw-577014-skh into lp:openobject-addons/6.1

Proposed by Somesh Khare
Status: Merged
Approved by: Xavier ALT
Approved revision: no longer in the source branch.
Merged at revision: 6955
Proposed branch: lp:~openerp-dev/openobject-addons/6.1-opw-577014-skh
Merge into: lp:openobject-addons/6.1
Diff against target: 15 lines (+4/-1)
1 file modified
email_template/wizard/mail_compose_message.py (+4/-1)
To merge this branch: bzr merge lp:~openerp-dev/openobject-addons/6.1-opw-577014-skh
Reviewer Review Type Date Requested Status
Somesh Khare (community) Needs Resubmitting
Vinay Rana (OpenERP) (community) Needs Fixing
Naresh(OpenERP) Pending
Review via email: mp+115665@code.launchpad.net

Description of the change

Hello Sir,

[FIX] email_template: sending mail from the template Sidebar action button shows expression value not the original values.

Steps to reproduce:
1. Create a template as Issue Template on the model "project.issue" and provide the email details as "${object.partner_address_id.email}" in the To/From/CC/BCC field.
2. Create a Side bar action button on the template.
3. Open Issue form and create an issue and Try to send email from the created Side bar action button.
Current Behavior:
  Wizard shows the expression values as "${object.partner_address_id.email}"
Expected Behavior:
  Wizard should shows actual email address ex:"<email address hidden>".

This branch fixes this issue.

Thanks,
Somesh Khare

To post a comment you must log in.
Revision history for this message
Vinay Rana (OpenERP) (vra-openerp) wrote :

The provided fix is perfect.As per my test cases this is working.

review: Approve
Revision history for this message
Vinay Rana (OpenERP) (vra-openerp) wrote :

One more thing I want to include this issue as I found one problem with mass mailing part where we needed expression instead of rendered value. This require expression part so I think this fix will create a another problem while doing from list view action and calling the wizard for multiple ids.

As I think, this can be propose solution for covering both the point when we calls a wizard from tree and form view:
1) If the action is called from tree view the value should not be rendered, If this is calling from form view the value should be replaced.

review: Needs Fixing
Revision history for this message
Somesh Khare (somesh.khare) wrote :

Hello Sir,

I have changed the code as per as your above suggession. The value of expression will render only when single record is selected either from the form view or list view. In case multiple ids selection (list view) the values will not render only expression will be there.

Kindly review the branch and please share your views on it.

Thanks,
Somesh Khare

review: Needs Resubmitting
Revision history for this message
Naresh(OpenERP) (nch-openerp) wrote :

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'email_template/wizard/mail_compose_message.py'
2--- email_template/wizard/mail_compose_message.py 2012-04-12 12:34:50 +0000
3+++ email_template/wizard/mail_compose_message.py 2012-08-20 08:00:59 +0000
4@@ -82,7 +82,10 @@
5 values = {}
6 if template_id:
7 res_id = context.get('mail.compose.target.id') or context.get('active_id') or False
8- if context.get('mail.compose.message.mode') == 'mass_mail':
9+ # when composing message interactivly, do not use mass_mail mode if user are working
10+ # on a unique resource (ex: when composing message from a form view)
11+ working_on_multi_resources = len(context.get('active_ids') or []) > 1 and True or False
12+ if context.get('mail.compose.message.mode') == 'mass_mail' and working_on_multi_resources:
13 # use the original template values - to be rendered when actually sent
14 # by super.send_mail()
15 values = self.pool.get('email.template').read(cr, uid, template_id, self.fields_get_keys(cr, uid), context)