Odoo Help

0

Remove an attribute from an element

By
Ahmed Ababneh
on 2/28/16, 2:23 AM 1,033 views

I would like to remove the editable attribute from this view element <tree string="Sales Order Lines" editable="bottom"> in my custom module.

I do not want to replace the whole tree element for the sake of removing the attribute.

How can I remove the editable attribute from the element above?



1
Axel Mendoza
On 2/28/16, 3:43 PM

@Ahmed Ababneh

You could do it like this:

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


0
Priyesh Solanki
On 2/28/16, 3:45 PM

You can override fields_view_get method for that object. Get the 'arch' by calling super method and remove the "editable" attrs from tree view. You will have to use python lxml packages and use etree to convert the arch into xml. You will get lots of examples in odoo addons of overriding fields_view_get.

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: 2/28/16, 2:23 AM
Seen: 1033 times
Last updated: 2/28/16, 3:45 PM