Skip to Content
Menu
This question has been flagged

Hello,

i am working on sale order. i just repace the page of

report_saleorder_document .  and i added my customized page. when i tried to get install that module there are some xpath problems. I trying to digging to find out what was the real problem.at last i find out there are some modules related to sale order report.

1:- module: website_quote using xpath of sale order report -

a)<xpath expr="//div[@class='page']/div[@id='informations']"

b)<xpath expr="//div[@class='page']/p[@id='fiscal_position_remark']"

2:- sale_stock is using

<xpath expr="//div[@name='payment_term']" position="after">

3:- website_sale is using

<xpath expr="//div[@name='total']" position="after">

these are inherit that template ,and using the xpath to adding some extra values. Is there is any way to print my own custom sales order?


thanking you,

Logicious

 


Avatar
Discard
Best Answer

Odoo v9  no more supports named attributes of Xpath (like @class='page', etc.). So, you'll need to rewrite Xpath expressions and use equivalent expressions without usage of named attributes.

UPDATE:

Try to use indexes, like:

 a)< xpath expr="//div[2]/div[5]", 

( indexes 2 and 5 are indicating position numbers. "//div[2]" should be second div in a parent view, accordingly "//div[2]/div[5]" - fifth child div of the second div in the parent view, etc... adapt it to your case)

Note: I've not tried it in v9, please report back if it'll work.

Avatar
Discard

I still feel bad about the fact that they removed this ability though. It was so handy.

I have not tried this way, but indexes should still work, for example, instead of named attributes: a) <xpath expr="//div[@class='page']/div[@id='informations']" use indexes: a)< xpath expr="//div[2]/div[5]", of course you'll need to use index numbers adapted to your case.

Agree, it was very handy

And not to forget that those indexes are risky. When somewhere along the line you add the same elements again the numbering will remove the incorrect items. So not very stable.

Author

actuall i given the xpaths inside the base module of website_quote,website_sale,sale_stock. i want to create sale order , its fully customised . if i want to make it, entire page i need to replace , in this situation when i was trying to install the these base module arise the errors" particular xpath can't be located on sale order report" . Is there is any other solution to solve it rahter than create new one?

Temur,
excuse for interruption, but this xpath expression do works in odoo 9 too, as i have tried it in one of my template.. ah... that might be exception in my scenario..... but it did worked...

Logicious,
Please try looking for the path you are giving, does it really exist, you can take the help of HTML inspector for getting the right path, if its a pdf report, then first change the report type to HTML from settings -> Report -> Report, browse to your report and then change type to HTML for debugging, after wards you can make it back to pdf

Related Posts Replies Views Activity
0
Sep 15
3415
0
Mar 21
1700
1
May 24
377
7
Apr 23
26598
1
Jan 19
7322