Odoo Help


Append value to attribute in qweb template

Anton Chepurov
on 2/19/15, 3:06 AM 1,935 views

There is a way to remove an attribute completely:

<xpath expr="//field[@name='order_line']/tree" position="attributes">
    <attribute name="editable"/>

And there is a way to completely replace an attribute with smth else:

<xpath expr="//label[@for='type']" position="attributes">
    <attribute name="groups">sale.group_delivery_invoice_address</attribute>
    <attribute name="invisible">False</attribute>

But is there a short way to append a value to an attribute?

So that after appending my_second_class to attribute class in <div class="my_first_class"> we receive <div class="my_first_class my_second_class">.

Samuel Lefever
On 2/19/15, 3:25 AM

I think there is no way to do such thing for attributes.
Your only choice is to retype the previous value of the attribute!

Looks like nobody knows of a better solution, indeed. Let's mark yours as a good one then.

Anton Chepurov
on 2/26/15, 4:37 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

2 follower(s)


Asked: 2/19/15, 3:06 AM
Seen: 1935 times
Last updated: 3/16/15, 8:10 AM