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

Can't use xpath while inheriting crm.lead form view

By
Tomas Parnarauskas
on 7/16/13, 7:54 AM 1,464 views

Why I can not use this xpath (can you only use @name inside expr, but not string? Because that page does not have attribute name)?:

            <xpath expr="//page[@string='Internal Notes']" position="after">
                <page string="Laser Damage Testing">
                    <field name="substrate_id"/>
                </page>                    
            </xpath>

Strangely it install my module with this view, but if I try to upgrade my module I get this error:

InternalError: current transaction is aborted, commands ignored until end of transaction block

Then I can't do anything in my database, always getting this error. I can fix it only by restoring to older database.

If I use this:

<page string="Internal Notes" position="after">
                    <page string="Laser Damage Testing">
                        <field name="substrate_id"/>
                    </page>
                </page>

Then it work fine. But if I want to insert fields in different parts of the view, I need to use xpath.

1
Antanas
On 7/16/13, 8:18 AM

@string does work. I have used this monster recently (it works):

<xpath expr="/form[@string='Manufacturing Orders']/sheet/notebook/page[@string='Consumed Products']/group/group[@string='Consumed Products']/field[@name='move_lines2']/tree[@string='Consumed Products']/field[@name='scrapped']" position="after">

Maybe try longer path, right from "form" till where you want to place your insertion.

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

0 follower(s)

Stats

Asked: 7/16/13, 7:54 AM
Seen: 1464 times
Last updated: 3/16/15, 8:10 AM