[MIG] mail_full_expand: Migrated to 10.0

pull/636/head
Damien Bouvy 2016-10-11 23:56:12 +02:00 committed by Bhavesh Odedra
parent 17b80e69a3
commit 1ad3275727
7 changed files with 88 additions and 79 deletions

View File

@ -5,9 +5,9 @@
{ {
"name": "Mail full expand", "name": "Mail full expand",
"summary": "Expand mail in a big window", "summary": "Expand mail in a big window",
"version": "8.0.3.0.0", "version": "10.0.1.0.0",
"category": "Social Network", "category": "Social Network",
"website": "http://www.grupoesoc.es, https://odoo-community.org/", "website": "http://www.grupoesoc.es/",
"author": "Grupo ESOC, Odoo Community Association (OCA)", "author": "Grupo ESOC, Odoo Community Association (OCA)",
"license": "AGPL-3", "license": "AGPL-3",
"application": False, "application": False,

View File

@ -1,12 +0,0 @@
/* © 2014-2015 Grupo ESOC <http://www.grupoesoc.es>
* License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
*/
.openerp .oe_mail .oe_msg .oe_msg_icons .oe_full_expand:hover a{
color: #BBBAFF;
text-shadow: 0px 1px #7C7BAD,
0px -1px #7C7BAD,
-1px 0px #7C7BAD,
1px 0px #7C7BAD,
0px 3px 3px rgba(0, 0, 0, 0.1);
}

View File

@ -0,0 +1,25 @@
/* © 2014-2015 Grupo ESOC <http://www.grupoesoc.es>
* License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
*/
.o_mail_thread .o_thread_message {
.o_full_expand {
cursor: pointer;
opacity: 0;
margin-right: -5px;
padding: 4px;
}
&.o_thread_selected_message .o_full_expand {
opacity: 0.6;
}
&:hover {
.o_full_expand {
opacity: 0.6;
&:hover {
opacity: 1;
}
}
}
}

View File

@ -1,26 +1,29 @@
/* © 2014-2015 Grupo ESOC <http://www.grupoesoc.es> /* © 2014-2015 Grupo ESOC <http://www.grupoesoc.es>
* License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). * License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
*/ */
odoo.define('mail_full_expand.expand', function (require) {
"use strict";
openerp.mail_full_expand = function (instance) { var Thread = require('mail.ChatThread');
instance.mail.ThreadMessage.include({
bind_events: function () {
this._super.apply(this, arguments);
this.$('.oe_full_expand').on('click', this.on_message_full_expand);
},
on_message_full_expand: function() { Thread.include({
// Get the action data and execute it to open the full view events: _.defaults({
var do_action = this.do_action, "click .o_full_expand": "on_message_full_expand",
msg_id = this.id; }, Thread.prototype.events),
this.rpc("/web/action/load", { on_message_full_expand: function(event) {
"action_id": "mail_full_expand.act_window", // Get the action data and execute it to open the full view
}) var do_action = this.do_action,
.done(function(action) { msg_id = $(event.currentTarget).data('message-id');
action.res_id = msg_id;
do_action(action); this.rpc("/web/action/load", {
}); "action_id": "mail_full_expand.mail_message_action",
} })
}); .done(function(action) {
}; action.res_id = msg_id;
do_action(action);
});
}
});
});

View File

@ -4,11 +4,10 @@
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). --> License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). -->
<template> <template>
<t t-extend="mail.thread.message"> <t t-extend="mail.ChatThread.Message">
<t t-jquery=".oe_msg_icons" t-operation="append"> <t t-jquery=".o_thread_message_needaction" t-operation="after">
<span class="oe_full_expand"> <i class="fa o_full_expand fa-arrows-alt"
<a title="Fully expand" class="oe_e">Ñ</a> t-att-data-message-id="message.id" title="Fully Expand"/>
</span>
</t> </t>
</t> </t>
</template> </template>

View File

@ -11,7 +11,7 @@
inherit_id="web.assets_backend"> inherit_id="web.assets_backend">
<xpath expr="." position="inside"> <xpath expr="." position="inside">
<link rel="stylesheet" <link rel="stylesheet"
href="/mail_full_expand/static/src/css/mail_full_expand.css"/> href="/mail_full_expand/static/src/css/mail_full_expand.less"/>
<script type="text/javascript" <script type="text/javascript"
src="/mail_full_expand/static/src/js/mail_full_expand.js"/> src="/mail_full_expand/static/src/js/mail_full_expand.js"/>
</xpath> </xpath>

View File

@ -3,44 +3,38 @@
<!-- © 2014-2015 Grupo ESOC <http://www.grupoesoc.es> <!-- © 2014-2015 Grupo ESOC <http://www.grupoesoc.es>
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). --> License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). -->
<openerp> <odoo>
<data> <record id="mail_message_view_form" model="ir.ui.view">
<field name="name">mail.message.full_expand</field>
<record id="view" model="ir.ui.view"> <field name="model">mail.message</field>
<field name="name">mail.message.full_expand</field> <field name="priority">30</field>
<field name="model">mail.message</field> <field name="arch" type="xml">
<field name="arch" type="xml"> <form string="Message">
<form string="Message" version="7.0"> <group>
<group> <field name="author_id" readonly="1"/>
<field name="author_id" readonly="1"/> <field name="email_from" readonly="1"/>
<field name="email_from" readonly="1"/> <field name="date" readonly="1"/>
<field name="date" readonly="1"/> <field name="partner_ids"
<field name="partner_ids" widget="many2many_tags"
widget="many2many_tags" readonly="1"/>
</group>
<h1><field name="subject" readonly="1"/></h1>
<field name="body" readonly="1"/>
<field name="attachment_ids"
widget="many2many_binary"
readonly="1"/> readonly="1"/>
<field name="notified_partner_ids" </form>
widget="many2many_tags" </field>
readonly="1"/> </record>
</group>
<h1><field name="subject" readonly="1"/></h1>
<field name="body" readonly="1"/>
<field name="attachment_ids"
widget="many2many_binary"
readonly="1"/>
</form>
</field>
</record>
<record id="act_window" model="ir.actions.act_window"> <record id="mail_message_action" model="ir.actions.act_window">
<field name="name">Read Full Email</field> <field name="name">Read Full Email</field>
<field name="res_model">mail.message</field> <field name="res_model">mail.message</field>
<field name="src_model">mail.message</field> <field name="src_model">mail.message</field>
<field name="type">ir.actions.act_window</field> <field name="type">ir.actions.act_window</field>
<field name="view_id" ref="view"/> <field name="view_id" ref="mail_message_view_form"/>
<field name="view_type">form</field> <field name="view_type">form</field>
<field name="view_mode">form</field> <field name="view_mode">form</field>
<field name="target">new</field> <field name="target">new</field>
</record> </record>
</odoo>
</data>
</openerp>