[IMP] mail.compose.message wizard form view: updated a bit display of recipients, displaying Follows of XXX, when commenting a document, to clarify a bit which partners will receive the email.

bzr revid: tde@openerp.com-20121109135612-xw86jk4jlri8zfxp
This commit is contained in:
Thibault Delavallée 2012-11-09 14:56:12 +01:00
parent c22eec5f7d
commit aa91324cd4
2 changed files with 18 additions and 3 deletions

View File

@ -135,7 +135,12 @@ class mail_compose_message(osv.TransientModel):
related to.
:param int res_id: id of the document record this mail is related to
"""
return {'model': model, 'res_id': res_id}
doc_name_get = self.pool.get(model).name_get(cr, uid, res_id, context=context)
if doc_name_get:
record_name = doc_name_get[0][1]
else:
record_name = False
return {'model': model, 'res_id': res_id, 'record_name': record_name}
def get_message_data(self, cr, uid, message_id, context=None):
""" Returns a defaults-like dict with initial values for the composition
@ -161,6 +166,7 @@ class mail_compose_message(osv.TransientModel):
# update the result
result = {
'record_name': message_data.record_name,
'model': message_data.model,
'res_id': message_data.res_id,
'parent_id': message_data.id,

View File

@ -14,10 +14,19 @@
<field name="parent_id" invisible="1"/>
<field name="content_subtype" invisible="1"/>
<!-- visible wizard -->
<field name="partner_ids" widget="many2many_tags_email" placeholder="Add contacts to notify..."
<label for="partner_ids" string="Recipients"/>
<div>
<span attrs="{'invisible':[('model', '=', False)]}">
Followers of
<field name="record_name" readonly="1" class="oe_inline"
attrs="{'invisible':[('model', '=', False)]}"/>
and
</span>
<field name="partner_ids" widget="many2many_tags_email" placeholder="Add contacts to notify..."
context="{'force_email':True}" required="1"/>
</div>
<field name="subject" placeholder="Subject..."
attrs="{'invisible':[('content_subtype', '=', 'plain')]}"/>
attrs="{'invisible':[('content_subtype', '=', 'plain')]}"/>
</group>
<field name="body"/>
<field name="attachment_ids" widget="one2many_binary" blockui="0"/>