Odoo Help


How to handle values entered in global filter in a python function?

on 8/6/13, 4:50 PM 1,175 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.

Ray Carnes
on 8/6/13, 5:40 PM

About This Community

This platform 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.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

0 follower(s)


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