Merge lp:kmsistemas-openerp-addons into lp:ocb-addons/6.1

Proposed by Jordi Llinares - KM Sistemas
Status: Work in progress
Proposed branch: lp:kmsistemas-openerp-addons
Merge into: lp:ocb-addons/6.1
Diff against target: 15 lines (+4/-1)
1 file modified
email_template/email_template.py (+4/-1)
To merge this branch: bzr merge lp:kmsistemas-openerp-addons
Reviewer Review Type Date Requested Status
Pedro Manuel Baeza code review Needs Fixing
Review via email: mp+201461@code.launchpad.net

Description of the change

[FIX] Fix of bug lp:1268654, where generate_email threw an exception when an email with user signature was generated from a template with no plain text body.

To post a comment you must log in.
Revision history for this message
Pedro Manuel Baeza (pedro.baeza) wrote :

Hi, Jordi, thank you very much for pointing out the problem and its solution.

For the next time, please make the MP with an specific branch for solving the bug, because in this way, you get all the bugs that you have declared as related, as you can see here with "Bug #1256619: [6.1] report_stock_inventory wrongly declared column & SQL", that was previously reported and solved, but with the same branch.

BTW, I think it's safer to put 'if values.get('body_text')' and 'if values.get('body_html')' to avoid errors when a value is not present in the dictionary.

Regards.

review: Needs Fixing (code review)
Revision history for this message
Stefan Rijnhart (Opener) (stefan-opener) wrote :

Setting to work in progress after months without a response from the submitter

Unmerged revisions

6827. By Jordi Llinares - KM Sistemas

Fixes signature addition bug when there's no plain text body in generate_email.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'email_template/email_template.py'
2--- email_template/email_template.py 2012-08-20 08:30:47 +0000
3+++ email_template/email_template.py 2014-01-13 17:06:05 +0000
4@@ -336,7 +336,10 @@
5
6 if template.user_signature:
7 signature = self.pool.get('res.users').browse(cr, uid, uid, context).signature
8- values['body_text'] += '\n\n' + signature
9+ if values['body_text']:
10+ values['body_text'] += '\n\n' + signature
11+ if values['body_html']:
12+ values['body_html'] += '<br/><br/>' + signature
13
14 values.update(mail_server_id = template.mail_server_id.id or False,
15 auto_delete = template.auto_delete,

Subscribers

People subscribed via source and target branches

to all changes: