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?

有帮助吗?

解决方案

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.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top