Question

In HR module, in Employee form, I want to create a filter which gives me list of all employees whose birthday's appear in current month.

Currently I am trying with static month, as below - but gives me error.

[('birthday.month','=','02')]

Error:

File "/usr/lib/pymodules/python2.7/openerp/osv/expression.py", line 1079, in __leaf_to_sql or left in MAGIC_COLUMNS, "Invalid field %r in domain term %r" % (left, leaf) AssertionError: Invalid field 'birthday.month' in domain term ('birthday.month', '=', '02')

Is there any way out to accomplish it?

Was it helpful?

Solution

you can write a stored functional integer field on hr.employee with a function returning the month as integer. then you can use this field for filters.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top