Odoo Help

0

Override JS mail

By
Grf
on 4/21/17, 4:42 AM 216 views

In mail/static/src/js/thread.js i need to change display_reply_icon: false, to True

so overriding JS is kinda more difficult for me because i'm realy new to, so looking for help.

as my thought process is i need to create model find this js script with Xpath and then override with my own js file.

init: function (parent, options) {
        this._super.apply(this, arguments);
        this.options = _.defaults(options || {}, {
            display_order: ORDER.ASC,
            display_needactions: true,
            display_stars: true,
            display_document_link: true,
            display_avatar: true,
            shorten_messages: true,
            squash_close_messages: true,
            display_reply_icon: false,
        });
        this.expanded_msg_ids = [];
        this.selected_id = null;
    },
2

IT Libertas

--IT Libertas--
813
| 4 3 7
Saint Petersburg, Russian Federation
--IT Libertas--

Visit us: itlibertas.com

IT Libertas is a team of developers and automation experts to help you to unlock Odoo ERP system's potential. We have been communicating with end users to whom the software became a main business tool since 2012. As a result, we are proud of dozens of successful implementations.

IT Libertas guarantees deadlines predictability and transparent pricing. We rely upon the best international practices and invest in local markets' study. That is why the company's services are in demand of European, Asian, American and African entrepreneurs.

We are open for cooperation and keep searching for new solutions to the end that IT Libertas clients go ahead of the curve, deal with less routine and generate more profit.

IT Libertas
On 4/21/17, 6:40 AM

You should create a js file in your own module and extend initial function. Depending on an Odoo version, it should be done differently. E.g. for Odoo 10:



odoo.define('YOURMODULENAME.ChatThread',
function (require) {
"use strict";

var core = require('web.core');
var MailThread = require('mail.Thread');

var Thread = MailThread.extend({
className: 'o_mail_thread',
init: function (parent, options) { this._super.apply(this, arguments); this.options = _.defaults(options || {}, { display_order: ORDER.ASC, display_needactions: true, display_stars: true, display_document_link: true, display_avatar: true, squash_close_messages: true, display_email_icon: true, display_reply_icon: true, }); this.expanded_msg_ids = []; this.selected_id = null; },
)};



Do not forget to init your js in the xml template:

       
<template id="assets_backend" name="Genial
Selection Assets Backend" inherit_id="web.assets_backend">
       
    <xpath expr="." position="inside">
       
        <script type="text/javascript"
src="/YOURMODULENAME/static/src/js/ChatThread.js"></script>
       
    </xpath>
</template>

Once again i got great answer, really grateful for that.

Grf
on 4/21/17, 12:10 PM

About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

Register

Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

1 follower(s)

Stats

Asked: 4/21/17, 4:42 AM
Seen: 216 times
Last updated: 4/21/17, 12:10 PM