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.


How to compare fields in a filter ?

Mohamed Hagag
on 12/7/14, 2:08 PM 825 views


Plz let me know how to make this filter work,  adding filter on partners search form:

                    <field name="credit_limit"/>
                    <field name="credit"/>

                   <filter name="credit limit" domain="[('credit','>',credit_limit)]"/>

Applying this filter gives below error:

Uncaught Error: Failed to evaluate search criterions:
{"code":400,"message":"Evaluation Error","data":{"type":"local_exception","debug":"Local evaluation failure\nNameError: name 'credit_limit' is not defined\n\n{\"domains\":[[],\"[('customer','=',1)]\",\"[('credit','=',credit_limit)]\"],\"contexts\":[{\"lang\":\"en_US\",\"tz\":\"Africa/Cairo\",\"uid\":1,\"search_default_customer\":1}],\"group_by_seq\":[]}"}}

I googled many times to find a solution without finding anyone .

the simple form [('credit_limit','<',credit)] always returns the error "can not convert string to float" where string is credit and float is credit_limit.

is there any way to say [('credit_limit','<',valueof(credit))] or [('field1','=',valueof(field2))] ??


I have the error today!

Pascal Tremblay
on 12/4/15, 5:45 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: 12/7/14, 2:08 PM
Seen: 825 times
Last updated: 12/4/15, 5:45 PM