[CLEAN] Misc cleaning and code review before merging.

bzr revid: tde@openerp.com-20130319091844-tnpd0w8tlagcbypz
This commit is contained in:
Thibault Delavallée 2013-03-19 10:18:44 +01:00
parent e559949f07
commit 522f144781
6 changed files with 11 additions and 31 deletions

View File

@ -224,7 +224,7 @@
<!--Definition of an email template with an empty body that will be used in opportunity mailing.
Used to give a basis for email recipients, name and to ease the definition of a further
elaborated template. -->
<record id="lead_template" model="email.template">
<record id="email_template_opportunity_mail" model="email.template">
<field name="name">Lead/Opportunity Mass Mail</field>
<field name="model_id" ref="crm.model_crm_lead"/>
<field name="auto_delete" eval="True"/>

View File

@ -597,12 +597,12 @@
'default_composition_mode': 'mass_mail',
'default_email_to':'{$object.email or \'\'}',
'default_use_template': True,
'default_template_id': ref('crm.lead_template'),
'default_template_id': ref('crm.email_template_opportunity_mail'),
}"/>
<!--Update of email_template defined in crm_lead_data, to add ref_ir_act_window
allowing to have a well formed email template (context action considered as set). -->
<record id="lead_template" model="email.template">
<record id="email_template_opportunity_mail" model="email.template">
<field name="ref_ir_act_window" ref="crm.action_lead_mass_mail"/>
</record>

View File

@ -15,18 +15,6 @@
</field>
</record>
<record id="view_res_partner_filter_crm" model="ir.ui.view">
<field name="name">res.partner.select.crm</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="Not opt-out" domain="[('opt_out', '=', False)]"
help="Is not opt-out and can be included in mass mailing campaigns" />
</filter>
</field>
</record>
<!-- open meetings related to given partner -->
<record id="crm_meeting_partner" model="ir.actions.act_window">
<field name="name">Meetings</field>

View File

@ -26,9 +26,9 @@
</field>
</record>
<!--Definition of an email template with an empty body that will be used in opportunity mailing. Used to give a
<!--Definition of an email template with an empty body that will be used in partner mailing. Used to give a
basis for email recipients, name and to ease the definition of a further elaborated template. -->
<record id="partner_template" model="email.template">
<record id="email_template_partner" model="email.template">
<field name="name">Partner Mass Mail</field>
<field name="model_id" ref="base.model_res_partner"/>
<field name="auto_delete" eval="True"/>
@ -48,10 +48,10 @@
'default_composition_mode': 'mass_mail',
'default_partner_to': '${object.id or \'\'}',
'default_use_template': True,
'default_template_id': ref('partner_template'),
'default_template_id': ref('email_template_partner'),
}"/>
<record id="partner_template" model="email.template">
<record id="email_template_partner" model="email.template">
<field name="ref_ir_act_window" ref="base.action_partner_mass_mail"/>
</record>

View File

@ -22,7 +22,6 @@
from openerp import tools
from openerp.osv import osv, fields
def _reopen(self, res_id, model):
return {'type': 'ir.actions.act_window',
'view_mode': 'form',
@ -37,7 +36,6 @@ def _reopen(self, res_id, model):
},
}
class mail_compose_message(osv.TransientModel):
_inherit = 'mail.compose.message'
@ -69,12 +67,6 @@ class mail_compose_message(osv.TransientModel):
help="Carbon copy recipients (placeholders may be used here)"),
}
_defaults = {
'partner_to': lambda self, cr, uid, ctx={}: '',
'email_to': lambda self, cr, uid, ctx={}: '',
'email_cc': lambda self, cr, uid, ctx={}: '',
}
def onchange_template_id(self, cr, uid, ids, template_id, composition_mode, model, res_id, context=None):
""" - mass_mailing: we cannot render, so return the template values
- normal mode: return rendered values """

View File

@ -59,13 +59,13 @@ class mail_mail(osv.Model):
'recipient_ids': fields.many2many('res.partner', string='To (Partners)'),
'email_cc': fields.char('Cc', help='Carbon copy message recipients'),
'body_html': fields.text('Rich-text Contents', help="Rich-text/HTML message"),
# If not set in create values, auto-detected based on create values (res_id, model, email_from)
'reply_to': fields.char('Reply-To', help='Preferred response address for the message'),
'reply_to': fields.char('Reply-To',
help='Preferred response address for the message'),
# Auto-detected based on create() - if 'mail_message_id' was passed then this mail is a notification
# and during unlink() we will not cascade delete the parent and its attachments
'notification': fields.boolean('Is Notification')
'notification': fields.boolean('Is Notification',
help='Mail has been created to notify people of an existing mail.message')
}
def _get_default_from(self, cr, uid, context=None):