Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
3 ตอบกลับ
2420 มุมมอง

Dear Odooers,

I want to add a search panel on below list view. With xml code below, I saw the ERROR as shown in the few lines at the bottom. Could someone please advise where I missed and did wrong? 

This field ( ) is a custom added field and can be seen in the tree view as shown. Why can't it be converted to SQL?


In Search bar, I can see "Product Category" in Filter but not in "Group By". Why?


Thank you very much for enlightening me.

>

The code is 

   
  purchase.purchase.order.view.search.inherit   
  purchase.order   
   
         
 
         
           
         
       
     
   

ERROR message: 

odoo\models.py", line 2810, in _field_to_sql

    raise ValueError(f"Cannot convert field {field} to SQL")

ValueError: Cannot convert field purchase.order.categ_id to SQL

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

Hi,

Please refer to our below blog to configure search view in odoo 17

https://www.cybrosys.com/blog/how-to-configure-search-view-filter-group-by-in-odoo-17


Hope it helps

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

Thank you for your updates, I got the same error and it looked only work for the physical sql field.

อวตาร
ละทิ้ง
ผู้เขียน คำตอบที่ดีที่สุด

I fixed the issue by setting store=True in 'Product Category' field. This is a related field.  

อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
2
ก.ค. 25
2007
0
มี.ค. 25
1104
1
ก.ค. 24
1956
7
ก.ค. 24
25344
2
เม.ย. 24
3375