Browse Source

Merge pull request #60 from yelizariev/10.0-new-api

10.0 new api
pull/64/head
Ivan Yelizariev 8 years ago
committed by GitHub
parent
commit
fa1c805453
  1. 2
      mail_all/static/src/js/mail_all.js
  2. 4
      mail_archives/static/src/js/archives.js
  3. 8
      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. 6
      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){
this._super.apply(this, arguments);
msg.is_all = true;
msg.is_all = data.author_id != 'ODOOBOT';
return msg;
},

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

@ -44,12 +44,12 @@ base_obj.MailTools.include({
this._super.apply(this, arguments);
// Get 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]);
}
// 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;
}

8
mail_base/static/src/js/base.js

@ -241,7 +241,8 @@ var MailTools = core.Class.extend({
subtype_description: data.subtype_description,
is_author: data.author_id && data.author_id[0] === session.partner_id,
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 || [],
subject: data.subject,
email_from: data.email_from,
@ -611,7 +612,7 @@ var MailTools = core.Class.extend({
} else if (data.info === 'channel_seen') {
chat_manager.mail_tools.on_channel_seen_notification(data);
} else if (data.info === 'transient_message') {
on_transient_message_notification(data);
chat_manager.mail_tools.on_transient_message_notification(data);
} else {
chat_manager.mail_tools.on_chat_session_notification(data);
}
@ -731,7 +732,7 @@ var MailTools = core.Class.extend({
var last_message = _.last(messages);
data.id = (last_message ? last_message.id : 0) + 0.01;
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();
return {
ODOOBOT_ID: ODOOBOT_ID,
chat_manager: chat_manager,
MailTools: MailTools
};

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

@ -2,7 +2,7 @@
<template>
<t t-extend="mail.ChatThread.Message">
<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>
</t>

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

@ -2,7 +2,7 @@
<template>
<t t-extend="mail.ChatThread.Message">
<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"
t-att-data-message-id="message.id" title="Reply"/>
</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){
var msg = this._super(data);
msg.partner_ids = data.partner_ids;
// msg.needaction_partner_ids = data.needaction_partner_ids;
if (!msg.partner_ids)
return msg
var more_recipients = '';
// value which define more recipients

6
mail_to/static/src/xml/recipient.xml

@ -2,7 +2,7 @@
<template>
<t t-extend="mail.ChatThread.Message">
<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-foreach="message.partner_ids.length" t-as="i">
<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
</span>
</t>
</span>
</t></span>
</t>
</t>
</template>
</template>
Loading…
Cancel
Save