コンテンツへスキップ
メニュー
この質問にフラグが付けられました
2 返信
15026 ビュー

Hi,

when I try to retrieve objects from model between two dated the second conditional gives an error, any idea why  "<" is not allowed?


<t t-foreach="request.env['my.model'].search([('date','>=', doc.date_start), 
('date','<=', doc.date_end)])" t-as="m">

Error:
lxml.etree.XMLSyntaxError: Unescaped '<' not allowed in attributes values, line 29, column 80
アバター
破棄
著作者 最善の回答
<t t-foreach="request.env['my.model'].search([('date','>=', doc.date_start), 
'|',('date','&lt;', doc.date_end)],('date','=', doc.date_end)])" t-as="m">
 
アバター
破棄
最善の回答

Hi,

If you are trying to fetch records from QWEB using ‘env’ may not work. So as a solution, you have to take the objects through JS as first and loop it from QWEB Template. 

If it's web template, you can try the code below : 

<t t-foreach="request.env[‘your.model'].search_read([('date','>=', doc.date_start), '|',('date','&lt;', doc.date_end)],('date','=', doc.date_end)])" t-as="m">


Regards

アバター
破棄
関連投稿 返信 ビュー 活動
2
10月 22
5593
2
3月 21
3758
2
3月 21
8828
0
12月 20
3634
0
5月 20
2734