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 handle values entered in global filter in a python function?

on 8/6/13, 4:50 PM 699 views


I don't understand how to handle inputs entered in global filter. I understand that we can do the below in xml

  • Search by a field ( by placing the field name inside the search filter record)

    <field name="user_id"/>
  • Create Custom Filters

    <filter string="Customers" name="customer" domain="[('customer','=',1)]" help="Customer Partners"/>

    In my case i want to get the value entered in that filter area and process it within a python function and return the resultant record which can be displayed in the list (a kind of dynamic record filter)

My Real Case Scenario

My Zip Code contains the below values

  • 60098
  • 60012
  • 75098
  • NG34 0NA
  • NG34 0NB
  • 600AB
  • NG601
  • NG760

I would like to implement a custom search like searching the zip code like this

  • 60000 to 60100 ( should return me 60098, 60012)
  • 60* ( should return me 60098, 60012, 600AB and not NG601, NG760) - i.e starts with 60
  • 60 ( should return me NG601, NG760) - i.e contains 60
  • *60 (should return me only NG760) - i.e contains 60

And Finally if i am able to get the input entered in the global filter in openerp7 i would be able to easily implement this search and return the result. Thanks for your time.

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

0 follower(s)


Asked: 8/6/13, 4:50 PM
Seen: 699 times
Last updated: 3/16/15, 8:10 AM