Skip to Content
Meniu
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
Această întrebare a fost marcată
2617 Vizualizări

A customer wants to be able to search for money values using both . and ,  as decimal separators (because we live in a country where , is official separator but . also is often (unofficially) used).


I started with the following filter:

<field name="offer_amount" string="Sum of Quotation" filter_domain="[('offer_amount', 'ilike', self)]"/>


It works for search values with ., such as 14.7

To make it work also for , I would need to sanitize the search value for this field using something like str.replace(',', '.')


I tried

<field name="offer_amount" string="Sum of Quotation" filter_domain="[('offer_amount', 'ilike', str(self).replace('',,'.'))]"/>

but got an error because filter_domain is parsed inside Javascrypt py.js library which doesn't support replace().

What is the right way to transform search values for specific fields?

Imagine profil
Abandonează
Related Posts Răspunsuri Vizualizări Activitate
1
sept. 23
1236
1
nov. 21
4436
1
oct. 20
4564
1
mai 24
4639
3
mar. 24
1448