Reputation: 160
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?
Upvotes: 0
Views: 717
Reputation: 14768
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.
Upvotes: 3