This question has been flagged
2 Replies
3538 Views

I have been attempting to create a filter for Customers that selects only those who have COD payment terms, but can't figure out how to correctly call it. Payment terms is a many2one field with the 'selection' widget, FWIW. The code I tried is:

<filter string="COD" name="type_cod" domain="[('property_payment_term.name','=','COD')]" help="COD Customers"/> 

and I also tried

<filter string="COD" name="type_cod" domain="[('property_payment_term','=','COD')]" help="COD Customers"/> 

But neither of those worked. Any idea how to do this correctly? Thanks!

Avatar
Discard
Best Answer

Hello,

<filter string="COD" name="type_cod" domain="[('property_payment_term','like','COD')]" help="COD Customers"/>

[('m2o','like', 'value')]  or  [('m2o','=', id)]


I Hope that it will help you :)

Avatar
Discard
Author

Hmm that didn't seem to work, I tried several permutations of it. I think it has to do with the 'selection' widget interfering somehow. That m2o behavior will be useful though, thanks for that!