Odoo Help


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.


Search Domain For field.property() Fields

Alex Gallien
on 3/31/15, 2:40 PM 469 views

Is it possible to search on field.property() fields? I would really like to be able to search by payment terms, but can't figure out the way to do so. I have tried:

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


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

as well as

<filter string="COD" name="type_cod" domain="[('property_payment_term','like','COD')]" help="COD Customers"/> 
But none of these seem to be working. The field is defined as such:

        'property_payment_term': fields.property(
string ='Customer Payment Term',
help="This payment term will be used instead of the default one for sale orders and customer invoices"),

Any idea how to search on this? Thanks!


Cyril Gaspard (GEM)

--Cyril Gaspard (GEM)--
| 5 6 8
Paris, France
--Cyril Gaspard (GEM)--

Forum contributor since 2008

Cyril Gaspard (GEM)
On 3/31/15, 3:26 PM

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

Ah forgot to specify, I want to perform this search on partner records, to see which partners are using CoD.

Alex Gallien
on 3/31/15, 3:42 PM

property_payment_term is defined in module account file partner.py, this should work, exept perhaps to add company_id in context (should be defined for a property field) context="{'company_id': user_id.company_id.id}"

Cyril Gaspard (GEM)
on 3/31/15, 5:00 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)


Asked: 3/31/15, 2:40 PM
Seen: 469 times
Last updated: 3/31/15, 3:26 PM