Skip to Content
Меню
Вам необхідно зареєструватися, щоб взаємодіяти зі спільнотою.
Це запитання позначене
1 Відповісти
2495 Переглядів
                    

Hello, 

I'm trying to Xpath match the Links in the Stock Forecast view. 


They are defined like so: 

Okay this editor doesnt like to print xml content... you can refer to:

https://github.com/odoo/odoo/blob/e887055f01fa1d726f4aaf10fd954b2a132ed018/addons/stock/report/report_stock_forecasted.xml#L135-L139


I woult like to match the "a" Tag. 

I already tried escaping the Expression, but no such luck so far:

expr="//a[@t-if='line[\'document_out\']']" 
expr="//a[@t-if='line['document_out']']"


Does anyone know, how to escape the Square breackets and the single quotes?  

Аватар
Відмінити
Найкраща відповідь

There are examples in the odoo source code.

Like this:


<xpath expr="//div[hasclass('col-4')][3]//span[@t-if=&quot;o.move_type == &apos;out_invoice&apos; and o.state == &apos;posted&apos;&quot;]" position="replace">

If you use &apos;​ to replace '​, it seems to be important to wrap this part with &quot;​s and not with '​s

Аватар
Відмінити
Related Posts Відповіді Переглядів Дія
0
квіт. 20
3621
1
груд. 19
2603
1
серп. 19
6304
1
жовт. 16
6458
0
бер. 15
4986