Odoo Help


How to modify a qweb template?

Bonnet Denis
on 6/12/13, 8:42 AM 5,389 views

I try to unchecked by default the list of suggested recipient in thread mail. image description

I've created a .xml file like this:

    <t t-extend="mail.thread.list_recipients">
        <t t-jquery="oe_recipients label input" t-operation="replace">
            <input type="checkbox" t-att-checked="recipient.checked ? '' : undefined" t-att-data="recipient.email_address"/>

and I set 'qweb': ['static/src/xml/juliana.xml'], in __openerp__.py file of my custom module. But I see no change.

I tried to changed in original source code of addon/mail/static/src/mail/mail.xml line 146 but after reloading the server I see no change, again.

I have 3 questions:

  • Does my inheritance is well formed?
  • Have I something else to do to OperERP Server read my template?
  • What have I to do to make change appear?

Where I can see this view?

Sudhir Arya (ERP Harbor Consulting Services)
on 6/12/13, 9:08 AM

this is the check box that appear when you want to send a message to the followers of an object.

Bonnet Denis
on 6/12/13, 10:41 AM

I didn't get it where it is. So can you please post the screenshot if possible?

Sudhir Arya (ERP Harbor Consulting Services)
on 6/13/13, 9:46 AM

Bonnet Denis

--Bonnet Denis--
| 5 6 8
St avé, France
--Bonnet Denis--

CEO/ODOO expert at Talyes.in

Bonnet Denis
On 6/13/13, 1:03 PM

My template was ok but the comportment was the same. To change the comportment I've changed the function in a custom js module. See below:

openerp.paramJuliana = function(instance){
    var module2 = instance.mail // loading the namespace of the 'sample' module

        on_toggle_quick_composer: function (event) {
            var self = this;
            var $input = $(event.target);
            var email_addresses = _.pluck(this.recipients, 'email_address');
            var suggested_partners = $.Deferred();

            // if clicked: call for suggested recipients
            if (event.type == 'click') {
                this.is_log = $input.hasClass('oe_compose_log');
                suggested_partners = this.parent_thread.ds_thread.call('message_get_suggested_recipients', [[this.context.default_res_id]]).done(function (additional_recipients) {
                    var thread_recipients = additional_recipients[self.context.default_res_id];
                    _.each(thread_recipients, function (recipient) {
                        var parsed_email = module2.ChatterUtils.parse_email(recipient[1]);
                        if (_.indexOf(email_addresses, parsed_email[1]) == -1) {
                                'checked': false,
                                'partner_id': recipient[0],
                                'full_name': recipient[1],
                                'name': parsed_email[0],
                                'email_address': parsed_email[1],
                                'reason': recipient[2],
            else {

            // when call for suggested partners finished: re-render the widget
            $.when(suggested_partners).pipe(function (additional_recipients) {
                if ((!self.stay_open || (event && event.type == 'click')) && (!self.show_composer || !self.$('textarea:not(.oe_compact)').val().match(/\S+/) && !self.attachment_ids.length)) {
                    self.show_composer = !self.show_composer || self.stay_open;
                if (!self.stay_open && self.show_composer && (!event || event.type != 'blur')) {

            return suggested_partners;


I changed 'checked': true by 'checked': false.


Sudhir Arya (ERP Harbor Consulting Services)

--Sudhir Arya (ERP Harbor Consulting Services)--
| 6 8 8
Ahmedabad, India
--Sudhir Arya (ERP Harbor Consulting Services)--

• Co-Founder & Co-Owner at ERP Harbor Consulting Services

• ERP Consultant / ERP Customization / TechnoFunctional Expert

• Sound knowledge in Python, Odoo (Open ERP), XML, PostgreSQL

• Domain knowledge of Sale Management, Purchase Management, Warehouse Management, Manufacturing, Multi Company Configuration & Management, HR Management, Medical Management, Construction Management, Education Management, Point of Sale, Third Party Integrations

• Positive attitude and quick Learner

• Good analytical skill, quick bug and issue tracing and find the solution

• Good knowledge and experience in payment gateway integration with Odoo

• Ready to accept new challenges

• Active Memeber On Stackoverflow 




Sudhir Arya
ERP Harbor Consulting Services
Sudhir Arya (ERP Harbor Consulting Services)
On 6/12/13, 9:18 AM

Try this:

    <t t-extend="mail.thread.list_recipients">
        <t t-jquery="div.oe_recipients" t-operation="replace">
            <input type="checkbox" t-att-checked="recipient.checked ? '' : undefined" t-att-data="recipient.email_address"/>

Just try this. I am not sure it will work or not.

if I use t-jquery="div.oe_recipients" instead of t-jquery="oe_recipients input" the jquery selector will replace all the bloc and not only the input tag

Bonnet Denis
on 6/12/13, 10:45 AM

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.


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

0 follower(s)


Asked: 6/12/13, 8:42 AM
Seen: 5389 times
Last updated: 3/16/15, 8:10 AM