Skip to content Skip to sidebar Skip to footer

Odoo Change Base Javascript Method

There is a file in Odoo: addons/mail/static/src/js/chatter.js . It contains a method I would like to change: message_get_suggested_recipients. For this I created an addon with file

Solution 1:

Modify your chatter.xml file as:

<templateid="your_module.assets_backend"inherit_id="web.assets_backend"name="Your custome name"><xpathexpr="//script[@src='/mail/static/src/js/chatter.js']"position="after"><scripttype="text/javascript"src="/addon1/static/src/js/chatter.js"></script></xpath></template>

This works in my case on Odoo 11. In your case (Odoo 10) it should work as well.


After re-looking at the Odoo's source code, because you'd like to override the message_get_suggested_recipients which is a prop of mail.composer.BasicComposer (and not mail.Chatter) I think your include should be:

var composer = require('mail.composer');

var ChatterComposer = composer.BasicComposer.include(
    // This goes your work of message_get_suggested_recipients rewrite.
);

Post a Comment for "Odoo Change Base Javascript Method"