Browse Source

[FIX] updates for 10.0

pull/60/head
Ivan Yelizariev 8 years ago
parent
commit
98df00ca3a
  1. 2
      mail_all/static/src/js/mail_all.js
  2. 4
      mail_archives/static/src/js/archives.js
  3. 6
      mail_base/static/src/js/base.js
  4. 2
      mail_move_message/static/src/xml/mail_move_message_main.xml
  5. 2
      mail_reply/static/src/xml/reply_button.xml
  6. 3
      mail_to/static/src/js/mail_to.js
  7. 4
      mail_to/static/src/xml/recipient.xml

2
mail_all/static/src/js/mail_all.js

@ -35,7 +35,7 @@ base_obj.MailTools.include({
set_channel_flags: function(data, msg){ set_channel_flags: function(data, msg){
this._super.apply(this, arguments); this._super.apply(this, arguments);
msg.is_all = true;
msg.is_all = data.author_id != 'ODOOBOT';
return msg; return msg;
}, },

4
mail_archives/static/src/js/archives.js

@ -44,12 +44,12 @@ base_obj.MailTools.include({
this._super.apply(this, arguments); this._super.apply(this, arguments);
// Get recipients ids // Get recipients ids
var recipients_ids = []; var recipients_ids = [];
for (var i = 0; i < data.partner_ids.length; i++){
for (var i = 0; i < (data.partner_ids || []).length; i++){
recipients_ids.push(data.partner_ids[i][0]); recipients_ids.push(data.partner_ids[i][0]);
} }
// If author or recipient // If author or recipient
if (data.author_id[0] == session.partner_id || recipients_ids.indexOf(session.partner_id) != -1) {
if (data.author_id[0] === session.partner_id || recipients_ids.indexOf(session.partner_id) != -1) {
msg.is_archive = true; msg.is_archive = true;
} }

6
mail_base/static/src/js/base.js

@ -241,7 +241,8 @@ var MailTools = core.Class.extend({
subtype_description: data.subtype_description, subtype_description: data.subtype_description,
is_author: data.author_id && data.author_id[0] === session.partner_id, is_author: data.author_id && data.author_id[0] === session.partner_id,
is_note: data.is_note, is_note: data.is_note,
is_system_notification: data.message_type === 'notification' && data.model === 'mail.channel',
is_system_notification: data.message_type === 'notification' && data.model === 'mail.channel'
|| data.info === 'transient_message',
attachment_ids: data.attachment_ids || [], attachment_ids: data.attachment_ids || [],
subject: data.subject, subject: data.subject,
email_from: data.email_from, email_from: data.email_from,
@ -731,7 +732,7 @@ var MailTools = core.Class.extend({
var last_message = _.last(messages); var last_message = _.last(messages);
data.id = (last_message ? last_message.id : 0) + 0.01; data.id = (last_message ? last_message.id : 0) + 0.01;
data.author_id = data.author_id || ODOOBOT_ID; data.author_id = data.author_id || ODOOBOT_ID;
add_message(data);
chat_manager.mail_tools.add_message(data);
} }
}); });
@ -1148,6 +1149,7 @@ function init () {
chat_manager.is_ready = init(); chat_manager.is_ready = init();
return { return {
ODOOBOT_ID: ODOOBOT_ID,
chat_manager: chat_manager, chat_manager: chat_manager,
MailTools: MailTools MailTools: MailTools
}; };

2
mail_move_message/static/src/xml/mail_move_message_main.xml

@ -2,7 +2,7 @@
<template> <template>
<t t-extend="mail.ChatThread.Message"> <t t-extend="mail.ChatThread.Message">
<t t-jquery='p.o_mail_info>span>i:first-child' t-operation="before"> <t t-jquery='p.o_mail_info>span>i:first-child' t-operation="before">
<i t-att-class="'fa fa-exchange oe_move' + (message.is_moved ? ' oe_moved' : '')"
<i t-if="!message.is_system_notification" t-att-class="'fa fa-exchange oe_move' + (message.is_moved ? ' oe_moved' : '')"
t-att-data-message-id="message.id" title="Move to thread"/> t-att-data-message-id="message.id" title="Move to thread"/>
</t> </t>
</t> </t>

2
mail_reply/static/src/xml/reply_button.xml

@ -2,7 +2,7 @@
<template> <template>
<t t-extend="mail.ChatThread.Message"> <t t-extend="mail.ChatThread.Message">
<t t-jquery='i[class="fa fa-reply o_thread_message_reply"]' t-operation="replace"> <t t-jquery='i[class="fa fa-reply o_thread_message_reply"]' t-operation="replace">
<i t-if="message.model != 'mail.channel' &amp;&amp; options.display_reply_icon"
<i t-if="message.author_id != 'ODOOBOT' &amp;&amp; message.model != 'mail.channel' &amp;&amp; options.display_reply_icon"
class="fa fa-reply o_thread_message_reply" class="fa fa-reply o_thread_message_reply"
t-att-data-message-id="message.id" title="Reply"/> t-att-data-message-id="message.id" title="Reply"/>
</t> </t>

3
mail_to/static/src/js/mail_to.js

@ -7,7 +7,8 @@ odoo.define('mail_to.MailTo', function (require) {
make_message: function(data){ make_message: function(data){
var msg = this._super(data); var msg = this._super(data);
msg.partner_ids = data.partner_ids; msg.partner_ids = data.partner_ids;
// msg.needaction_partner_ids = data.needaction_partner_ids;
if (!msg.partner_ids)
return msg
var more_recipients = ''; var more_recipients = '';
// value which define more recipients // value which define more recipients

4
mail_to/static/src/xml/recipient.xml

@ -2,7 +2,7 @@
<template> <template>
<t t-extend="mail.ChatThread.Message"> <t t-extend="mail.ChatThread.Message">
<t t-jquery="p[class=o_mail_info]>span" t-operation="after"> <t t-jquery="p[class=o_mail_info]>span" t-operation="after">
<span class="recipients_info">
<span class="recipients_info"><t t-if="message.partner_ids">
<t t-if="message.partner_ids.length > 0">To: </t> <t t-if="message.partner_ids.length > 0">To: </t>
<t t-foreach="message.partner_ids.length" t-as="i"> <t t-foreach="message.partner_ids.length" t-as="i">
<t t-if="i &lt; message.more_recipients_value"> <t t-if="i &lt; message.more_recipients_value">
@ -16,7 +16,7 @@
and <t t-esc="message.partner_ids.length - message.more_recipients_value"/> more and <t t-esc="message.partner_ids.length - message.more_recipients_value"/> more
</span> </span>
</t> </t>
</span>
</t></span>
</t> </t>
</t> </t>
</template> </template>
Loading…
Cancel
Save