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

How tow solve this error: "View inheritance may not use attribute 'string' as a selector."

By
Tatorus
on 2/23/16, 9:06 AM 1,219 views

When i try to load my module on my odoo server, i've this :

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


I'm pratically sure it comes from this line, maybe because of the string but i don't know how to solve it :

<button name="action_cancel_draft" states="cancel,sent,confirmed" string="Set to Draft" type="object" position="before">


since v9, it recommanded to not use string in xpath. Because translation is sonde, before inheritage.
So if you was doing xpath expr=@string='Set to Draft', you should replace it by @name='action_cancel_draft' eg...

Jérémy Kersten (jke)
on 2/23/16, 9:43 AM

Ok but in my view, i don't use a xpath

Tatorus
on 2/23/16, 9:47 AM

keep just ''' button name="action_cancel_draft" position="before" '''

Jérémy Kersten (jke)
on 2/23/16, 10:53 AM

Still the same error

Tatorus
on 2/24/16, 3:15 AM

My bad, now i have this error : ParseError: "Invalid view definition Error details: Element '

Tatorus
on 2/24/16, 3:50 AM

@Samer Al-Sarhan I don't use xpath in my view file code @vitzoteck Same than before, i don't use xpath

Tatorus
on 2/24/16, 10:05 AM
0
Tatorus
On 2/25/16, 8:49 AM

I replaced this :

<button name="action_cancel_draft" states="cancel,sent,confirmed" string="Set to Draft" type="object" position="before">

by :

<xpath expr="/form/header/button[@name='button_draft']" position="before">

I'm not sure if it works well but there is no more error now.

0

hi,

I got the same error while migrating one customized module from odoo version 8 to odoo version 9.because in 8 i used <xpath expr="//notebook/page[@string='Information']" position="after"> like  i solve this with replacing     <xpath expr="//notebook[last()]" position="inside">

definately you should use notebook  in view   may be,

if you need help conatct:- virzoteck@gmail.com

0
Samer Al-Sarhan
On 2/23/16, 2:25 PM

the problem not from the mentioned code you probably using xpath to access a location inside an inherited view, and in your xpath your depending on @string , which is not allowed

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: 2/23/16, 9:06 AM
Seen: 1219 times
Last updated: 2/25/16, 8:49 AM