Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

0

Adding Search Filter For many2one Field (Payment Terms) [v7]

By
Alex Gallien
on 3/16/15, 6:53 PM 696 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!

0

Jérémy Kersten (jke)

--Jérémy Kersten (jke)--
2983
| 3 2 5
Jodoigne, Belgium
--Jérémy Kersten (jke)--

Jérémy is a member of the core R&D team since september 2013. He developed several projects for OpenERP version 8 including the eCommerce, the Google Calendar synchronization and the new product variants/configurator. Now, he manages Odoo website and themes for saas.

Jérémy Kersten (jke)
On 3/16/15, 7:52 PM

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 :)

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!

Alex Gallien
on 3/16/15, 8:43 PM

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

Asked: 3/16/15, 6:53 PM
Seen: 696 times
Last updated: 3/20/15, 5:35 PM