forvas
forvas

Reputation: 10189

How to change a XML tag in an OpenERP7 view?

I created a form which inherits from other form. I added and changed several fields and attributes, but now, I need to modify a tag which is not a field. This is the line in the original form:

<a type="open"><field name="name"/></a>

And I want it to be the next one:

<a type="object" name="my_function"><field name="name"/></a>

Anyone knows how to manage this? By the way, that field is inside a page (you can check it, activate debug mode on the OpenERP interface, go to the standard view of a partner which is a company, and click editFormView -debug mode-, Control+F and type the line, there is only one like that).

Upvotes: 0

Views: 51

Answers (2)

forvas
forvas

Reputation: 10189

Done! I was not able to manage this through position="attributes", so I had to use position="replace" to do it, in the following way:

<xpath expr="/form//notebook//page//a[@type='open']//field[@name='name']" position="replace"/>
    <a type='object' name='open_line'><field name="name"/></a>
</xpath>

Upvotes: 0

Adrian Merrall
Adrian Merrall

Reputation: 2499

Use an xpath with position="attributes" rather than before/after etc.

Just search the source tree for "attributes" in the XML and you will find examples. My memory is faulty so it may be position="attribute" but you will find examples.

Upvotes: 1

Related Questions