简体   繁体   中英

How to add same attributes in two different path - odoo xpath

How can i add same attributes in two different path in same form i was try to separate by "|"but it working just with the first path

    <?xml version="1.0"?>
<xpath expr="/form/sheet/notebook/page/field[@name='order_line']/form/group/group/field[@name='product_id'] | /form/sheet/notebook/page/field[@name='order_line']/tree/field[@name='name']" position="before">
              <field name="barcode_id"/>
              <field name="publisher"/>
          </xpath>

你可以试试这种 XPath :

/form/sheet/notebook/page/field[@name='order_line']//field[@name ='product_id' or @name='name']

Wiest,

AFAIK In odoo, it's forbidden functionality that doesn't consider multiple XPath correspondence.

In the alternative, you could override fields_view_get and use XPath through lxml library.

Thanks

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM