<!-- dropdown menu with message options and actions -->
<span class="oe_dropdown_toggle oe_dropdown_arrow">
<ul class="oe_dropdown_menu">
- <t t-if="record.is_author">
- <li t-if="display['show_delete']"><a href="#" class="oe_mail_msg_delete" t-attf-data-id='{record.id}'>Delete</a></li>
- </t>
- <li t-if="display['show_hide']"><a href="#" class="oe_mail_msg_hide" t-attf-data-id='{record.id}'>Remove notification</a></li>
- <li t-if="record.is_author and options.show_dd_delete"><a class="oe_mail_msg_delete" t-attf-data-id='{record.id}'>Delete</a></li>
++ <li t-if="record.is_author & options.show_dd_delete"><a class="oe_mail_msg_delete" t-attf-data-id='{record.id}'>Delete</a></li>
+ <li t-if="options.show_dd_hide"><a class="oe_mail_msg_hide" t-attf-data-id='{record.id}'>Remove notification</a></li>
<!-- Uncomment when adding subtype hiding
<li t-if="display['show_hide']">
<a href="#" class="oe_mail_msg_hide_type" t-attf-data-subtype='{record.subtype}'>Hide '<t t-esc="record.subtype"/>' for this document</a>
<t t-raw="record.subject"/>
</h1>
<div class="oe_mail_msg_body">
- <div class="oe_mail_msg_record_body">
- <a t-attf-href="#model=#{record.model}&id=#{record.res_id}" t-if="(params.thread_level > 0) & (!record.subject)"><t t-raw="record.record_name"/></a>
- <t t-raw="record.body"/>
- </div>
- <t t-if="options.show_record_name and record.record_name and (!record.subject) and (options.thread_level > 0)">
++ <t t-if="options.show_record_name & (!record.subject) & (options.thread_level > 0)">
+ <a t-attf-href="#model=#{record.model}&id=#{record.res_id}"><t t-raw="record.record_name"/></a>
+ </t>
+ <t t-raw="record.body"/>
</div>
<div class="oe_clear"/>
<ul class="oe_mail_msg_footer">
- <li t-if="record.subject & params.thread_level > 0"><a t-attf-href="#model=#{record.model}&id=#{record.res_id}"><t t-raw="record.record_name"/></a></li>
- <li><a t-attf-href="#model=res.partner&id=#{record.author_id[0]}"><t t-raw="record.author_id[1]"/></a></li>
- <li><span t-att-title="record.date"><t t-raw="record.timerelative"/></span></li>
- <li t-if="display['show_reply']"><a href="#" class="oe_mail_msg_reply">Reply</a></li>
- <!-- uncomment when merging vote
- <li><a href="#">Like</a></li>
- -->
- <li t-if="record.attachment_ids.length > 0">
- <a href="#" class="oe_mail_msg_view_attachments">
- <t t-if="record.attachment_ids.length == 1">1 Attachment</t>
- <t t-if="record.attachment_ids.length > 1"><t t-raw="record.attachment_ids.length"/> Attachments</t>
- </a>
- </li>
- <li t-if="options.show_record_name and record.record_name and record.subject and options.thread_level > 0">
++ <li t-if="options.show_record_name & record.subject & options.thread_level > 0">
+ <a t-attf-href="#model=#{record.model}&id=#{record.res_id}"><t t-raw="record.record_name"/></a>
+ </li>
+ <li><a t-attf-href="#model=res.partner&id=#{record.author_id[0]}"><t t-raw="record.author_id[1]"/></a></li>
+ <li><span t-att-title="record.date"><t t-raw="record.timerelative"/></span></li>
+ <li t-if="options.show_reply"><a class="oe_mail_msg_reply">Reply</a></li>
+ <li t-if="options.show_reply_by_email"><a class="oe_mail_msg_reply_by_email" t-attf-data-msg_id="{record.id}">Reply</a></li>
+ <!-- uncomment when merging vote
+ <li><a href="#">Like</a></li>
+ -->
+ <li t-if="record.attachment_ids.length > 0">
+ <a class="oe_mail_msg_view_attachments">
+ <t t-if="record.attachment_ids.length == 1">1 Attachment</t>
+ <t t-if="record.attachment_ids.length > 1"><t t-raw="record.attachment_ids.length"/> Attachments</t>
+ </a>
+ </li>
</ul>
<t t-if="record.attachment_ids.length > 0">
<div class="oe_clear"></div>
return True
def onchange_content_subtype(self, cr, uid, ids, value, model, res_id, context=None):
- """ onchange_content_subtype (values: 'plain' or 'html'). This onchange
- on the subtype allows to have some specific behavior when switching
- between text or html mode.
- This method can be overridden for models that want to have their
- specific behavior. """
+ """ This onchange allows to have some specific behavior when switching
+ between text or html mode. This method can be overridden.
+ :param values: 'plain' or 'html'
+ """
return {'value': {'content_subtype': value}}
+ def _verify_partner_email(self, cr, uid, partner_ids, context=None):
+ """ Verify that selected partner_ids have an email_address defined.
+ Otherwise throw a warning. """
+ partner_wo_email_lst = []
+ for partner in self.pool.get('res.partner').browse(cr, uid, partner_ids, context=context):
+ if not partner.email:
+ partner_wo_email_lst.append(partner)
+ if not partner_wo_email_lst:
+ return {}
+ warning_msg = _('The following partners chosen as recipients for the email have no email address linked :')
+ for partner in partner_wo_email_lst:
+ warning_msg += '\n- %s' % (partner.name)
+ return {'warning': {
+ 'title': _('Partners email addresses not found'),
+ 'message': warning_msg,
+ }
+ }
+
def onchange_partner_ids(self, cr, uid, ids, value, context=None):
- """ onchange_partner_ids (value format: [[6, 0, [3, 4]]]). The
- basic purpose of this method is to check that destination partners
+ """ The basic purpose of this method is to check that destination partners
effectively have email addresses. Otherwise a warning is thrown.
+ :param value: value format: [[6, 0, [3, 4]]]
"""
res = {'value': {}}
if not value or not value[0] or not value[0][0] == 6:
return
- res.update(self.check_partners_email(cr, uid, value[0][2], context=context))
+ res.update(self._verify_partner_email(cr, uid, value[0][2], context=context))
return res
- def unlink(self, cr, uid, ids, context=None):
- # Cascade delete all attachments, as they are owned by the composition wizard
- for wizard in self.read(cr, uid, ids, ['attachment_ids'], context=context):
- self.pool.get('ir.attachment').unlink(cr, uid, wizard['attachment_ids'], context=context)
- return super(mail_compose_message, self).unlink(cr, uid, ids, context=context)
-
def dummy(self, cr, uid, ids, context=None):
""" TDE: defined to have buttons that do basically nothing. It is
currently impossible to have buttons that do nothing special
help="""Routings allow you to create and manage the manufacturing operations that should be followed
within your work centers in order to produce a product. They are attached to bills of materials
that will define the required raw materials."""),
- 'group_mrp_properties': fields.boolean("allow several bill of materials per products",
- 'group_mrp_properties': fields.boolean("Allow several bill of materials per products using properties",
++ 'group_mrp_properties': fields.boolean("allow several bill of materials per products using properties",
implied_group='product.group_mrp_properties',
help="""The selection of the right Bill of Material to use will depend on the properties specified on the sale order and the Bill of Material."""),
- 'module_product_manufacturer': fields.boolean("Define manufacturers on products ",
+ 'module_product_manufacturer': fields.boolean("define manufacturers on products ",
help="""This allows you to define the following for a product:
* Manufacturer
* Manufacturer Product Name
_columns = {
'advance_payment_method':fields.selection(
- [('all', 'Invoice all the Sale Order'), ('percentage','Percentage'), ('fixed','Fixed Price'),
- ('lines', 'Some Order Lines')],
- 'Type', required=True,
+ [('all', 'Invoice the whole sale order'), ('percentage','Percentage'), ('fixed','Fixed price (deposit)'),
+ ('lines', 'Some order lines')],
- 'What do you want to invoice?', required=True,
++ 'Invoice Method', required=True,
help="""Use All to create the final invoice.
Use Percentage to invoice a percentage of the total amount.
Use Fixed Price to invoice a specific amound in advance.