Skip to Content
Menu
This question has been flagged
1 Reply
5459 Views

Hi, i am working on a project in odoo 9. I need to replace "create" buttons, i tries that code but on module upgrade it gives error

I tries to use that code

<record model="ir.ui.view" id="oeh_lab_test_report_tree">
<field name="name">Lab Tests Report</field>
<field name="model">oeh.medical.lab.test</field>
<field name="type">tree</field>
<field name="arch" type="xml">
<xpath expr="//page[@string='Create']" position="attributes">
<button string="Some Button" class="oe_highlight" type="button"/>
</xpath>
<tree string='Group Lab Tests'>
<field name="name"/>
<field name="patient"/>
<field name="test_type"/>
<field name="date_requested"/>
<field name="date_analysis"/>
<field name="state"/>
<button type="object" name="test_results_download" string="Download Test Results" class="oe_highlight"/>
</tree>
</field>
</record>

when i upgrade my module it throws an error which is 

View inheritance may not use attribute 'string' as a selector.
Avatar
Discard
Best Answer
in odoo9 you can't use string  as a identifier in xpath 

This is no a valid syntax:

<xpath expr="//page[@string='Create']" position="attributes">


So either locate xpath on different attribute(Like: name //page[@name='create']) or you can also use arrays like  //page[1]    //page[2]


Avatar
Discard
Author

O how can i replace that "Create" button in tree view