Odoo Help


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

on 2/23/16, 9:06 AM 1,505 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

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

on 2/24/16, 3:15 AM

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

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

on 2/24/16, 10:05 AM
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.



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

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