Odoo Help


Replace tree view "create" and "import" button with other button

ahmed khakwani
on 5/25/16, 3:25 AM 1,397 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"/>
<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"/>

when i upgrade my module it throws an error which is 

View inheritance may not use attribute 'string' as a selector.

Prakash Sharma

--Prakash Sharma--
--Prakash Sharma--

I like to surround myself with brave, creative people.

My motivation for learning different technologies and algos drive me. I love challenges of a steep learning curve which I believe makes me a better learner. I have a strong desire to learn different technologies, which would enable me to become a full stack developer.

Prakash Sharma
On 5/25/16, 6:20 AM
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]

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

ahmed khakwani
on 5/25/16, 7:12 AM

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.


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)


Asked: 5/25/16, 3:25 AM
Seen: 1397 times
Last updated: 5/25/16, 6:20 AM