For searching purchase orders, normally we search by product other than PO header information such as supplier, even though there is product field (related) available on the purchase order header table, it seems this field only linked to the first item of the PO, so it is not useful for searching PO by product.
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- CRM
- e-Commerce
- Contabilità
- Magazzino
- PoS
- Project
- MRP
La domanda è stata contrassegnata
Per testing, I found the following simple solution: adding following line into relevant search view : purchase.order.list.select
<filter name="order_line" string="product name" domain="[('order_line.product_id.name','ilike',self)]"/>
the background logic for the above simple solution is that system take the searching criteria from search view as a domain, per evaluating the domain, ORM returned result list accordingly, in essence, due to the Model relationship, ORM can evaluate doamain on related models( one2many, many2many), so the above mentioned solution can be applied to other business objects, also tested case is searching issues by the associated message content which is very common requirement when dealing with issue tracking.
Great !!
It works if you change 'filter' to 'field'.
<field name="order_line" string="product name" domain="[('order_line.product_id.name','ilike',self)]"/>
<field name="order_line" string="product name" filter_domain="[('order_line.product_id.name','ilike',self)]"/>
Ti stai godendo la conversazione? Non leggere soltanto, partecipa anche tu!
Crea un account oggi per scoprire funzionalità esclusive ed entrare a far parte della nostra fantastica community!
RegistratiPost correlati | Risposte | Visualizzazioni | Attività | |
---|---|---|---|---|
|
1
lug 25
|
557 | ||
Search a message
Risolto
|
|
1
feb 25
|
1253 | |
|
0
set 23
|
2223 | ||
|
2
giu 23
|
4044 | ||
|
2
mag 23
|
3028 |
for search project issue by message subject and body, add the following line to search view Project Issue Tracker Search <field name="message_ids" string="message_content" filter_domain="['|',('message_ids.subject','ilike',self),('message_ids.body','ilike',self)]"/>