Open badbole opened 9 years ago
Hi @badbole,
Thanks a lot for reporting this! :+1: Have you found any official statement about this or why this is the fact? This would be strange since Odoo 9 will support both the V7 and V8 API. I'm not sure why they would remove this..
Greetz Yenthe
I just came into it while migrating some custom modules to v9... not sure if it will be corrected, but it does not work for now in trunk version... try it yourself.. :)
@badbole,
I've finally had the time to test this and you're correct. Xpath string expressions have been fully removed in V9! (I added a note on my sample here: https://github.com/Yenthe666/Odoo_Samples/blob/master/xpath_expressions/templates.xml) I've found an issue a few days ago which stated that this is explicitly done and was no error from Odoo. Just can't find it anymore :tongue:
Told you so :) Good to know i was right :) btw.. .can't find example also.. will soon... Yah... karma not won on forum :)
@bole,
Some alternative methods: Expr="//page[2]" Expr="//field[@name='fieldname']"
I guess there are plenty of other ways. I did like the old string option though..
this is the solution kid`s
xpath expr="//page[2]" position = "attributes"> page> attribute name="invisible">True /page>
is xpathing by number safe? every time I see that i think "who tells you it's always going to be second?" I prefer name, looks safer.
@gfcapalbo you should always go for the name if you can, it is by far better. Every once in a blue moon there is no name and then you'll need to specify an index though, just don't do it if you don't have to.
Edit: if you make an xpath with an index and the index is out of range you'll get one ugly error.
for someone get to this, you can find some field and get the parent
expr="//field[@name='some_field']/parent::page"
"string" attribute sems to be depreciated in odoo9 ... need to check the code against trunk (future odoo v9)
this: expr="//page[@string='Information']/group" will not work anymore...
all other xpath handlers seems to work fine...
greetz bole ;)