[IMP] email_template, crm: added forgotten filters for opt-out; cleaned help of opt-out; email body is back into internal note as it has been decided that it was too much change for 7.0, especially that email content parsing is not robust enough.

bzr revid: tde@openerp.com-20130313112013-veqzplextey1300p
This commit is contained in:
Thibault Delavallée 2013-03-13 12:20:13 +01:00
parent 6b2c64ff40
commit 2f4a59fd06
4 changed files with 22 additions and 3 deletions

View File

@ -259,7 +259,9 @@ class crm_lead(base_stage, format_address, osv.osv):
'channel_id': fields.many2one('crm.case.channel', 'Channel', help="Communication channel (mail, direct, phone, ...)"),
'contact_name': fields.char('Contact Name', size=64),
'partner_name': fields.char("Customer Name", size=64,help='The name of the future partner company that will be created while converting the lead into opportunity', select=1),
'opt_out': fields.boolean('Opt-Out', oldname='optout', help="If opt-out is checked, this contact has refused to receive emails for mass mailing and marketing campaign."),
'opt_out': fields.boolean('Opt-Out', oldname='optout',
help="If opt-out is checked, this contact has refused to receive emails for mass mailing and marketing campaign. "
"Filter 'Available for Mass Mailing' allows users to filter the partners when performing mass mailing."),
'type':fields.selection([ ('lead','Lead'), ('opportunity','Opportunity'), ],'Type', help="Type is used to separate Leads and Opportunities"),
'priority': fields.selection(crm.AVAILABLE_PRIORITIES, 'Priority', select=True),
'date_closed': fields.datetime('Closed', readonly=True),
@ -977,8 +979,10 @@ class crm_lead(base_stage, format_address, osv.osv):
"""
if custom_values is None:
custom_values = {}
desc = html2plaintext(msg.get('body')) if msg.get('body') else ''
defaults = {
'name': msg.get('subject') or _("No Subject"),
'description': desc,
'email_from': msg.get('from'),
'email_cc': msg.get('cc'),
'partner_id': msg.get('author_id', False),

View File

@ -341,6 +341,8 @@
<filter string="Assigned to My Team(s)"
domain="[('section_id.member_ids', 'in', [uid])]" context="{'invisible_section': False}"
help="Leads that are assigned to any sales teams I am member of"/>
<filter string="Available for mass mailing" domain="[('opt_out', '=', False)]"
help="Leads that did not ask not to be included in mass mailing campaigns"/>
<separator/>
<group expand="0" string="Group By...">
<filter string="Salesperson" domain="[]" context="{'group_by':'user_id'}"/>

View File

@ -19,7 +19,7 @@
#
##############################################################################
from openerp.osv import fields,osv
from openerp.osv import fields, osv
class res_partner(osv.osv):
"""Inherit res.partner to add a generic opt-out field that can be used
@ -29,7 +29,8 @@ class res_partner(osv.osv):
_columns = {
'opt_out': fields.boolean('Opt-Out',
help="If opt-out is checked, this contact has refused to receive emails for mass mailing and marketing campaign."),
help="If opt-out is checked, this contact has refused to receive emails for mass mailing and marketing campaign. "
"Filter 'Available for Mass Mailing' allows users to filter the partners when performing mass mailing."),
}
_defaults = {

View File

@ -11,5 +11,17 @@
</xpath>
</field>
</record>
<record model="ir.ui.view" id="res_partner_opt_out_search">
<field name="name">res.partner.opt_out.search</field>
<field name="model">res.partner</field>
<field name="inherit_id" ref="base.view_res_partner_filter"/>
<field name="arch" type="xml">
<filter string="Suppliers" position="after">
<filter string="Available for mass mailing" domain="[('opt_out', '=', False)]"
help="Leads that did not ask not to be included in mass mailing campaigns"/>
</filter>
</field>
</record>
</data>
</openerp>