Odoo Help

Welcome!

This community 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.

0

Append value to attribute in qweb template

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

There is a way to remove an attribute completely:

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

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>
</xpath>

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">.

0
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

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

2 follower(s)

Stats

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