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

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

By
ahmed khakwani
on 5/25/16, 3:25 AM 575 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.
0

Prakash Sharma

--Prakash Sharma--
815
| 2 1 4
Delhi, India
--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

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

1 follower(s)

Stats

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