[CRM module] case description is "False" in mail notification

Bug #578106 reported by Jean-Christophe VASSORT
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
OpenERP France
New
Undecided
Unassigned

Bug Description

In CRM module, I created Cases Sections and I use the email gateway.

I created a rule to be notified when a new case was come.

It works but in the mail body, the special keyword "%(case_description)s" returns "false" instead of the case content.

I noticed when the mail is sent, datas are not yet written in DB.

I changed the openerp-mailgate.py file to obtain what I wanted.

summary: - [CRM module] case description don't work with mail notification
+ [CRM module] case description is "False" in mail notification
description: updated
Revision history for this message
Jean-Christophe VASSORT (jc-vassort) wrote :
Revision history for this message
Manu (manu-tiedra) wrote :

 Jean-Christophe VASSORT,

unfortunately your patch doesn't work as expected. With your patch, you can use the special keyword "%(case_description)s" just when a new case is created. If you try to use it for example when a partner replies and the case is in state "Pending" it will display False.

Also, with your patch, the right textbox with the buttons "Send to partner and add to history" and "Add to history" below gets populated incorrectly with the case description instead of being blank.

Revision history for this message
Jean-Christophe VASSORT (jc-vassort) wrote :

Thanks for reply !! Did you find a other solution ?

Revision history for this message
Manu (manu-tiedra) wrote :

Jean-Christophe VASSORT,,

What I'm doing now is:

1) edit addons/crm/crm.py

change in format_mail method:

 'case_description': case.description,

with:

'case_description': case.description or case.email_last,

2) edit addons/crm/scripts/openerp-mailgate/openerp-mailgate.py

there are two places where the crm case state is changed and then the case is updated with:
self.rpc('crm.case', act, [id])
self.rpc('crm.case', 'write', [id], data)

I have reversed the order of the calls:

self.rpc('crm.case', 'write', [id], data)
self.rpc('crm.case', act, [id])

As my rules are after a state change I needed the data of the case to saved first.

I don't know if it is the "proper" way to fix it but it seems to be working. Also, I don't think there will be an official fix for this as this has changed in v6 and they're not fixing a lot of v5 stuff.

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.