Hi
I have created a sql view for employee Birthday and show in calendar.
Sql View:
select h.id,concat(concat(date_part('Year',current_date),'-'),to_char(h.birthday, 'mm-dd')),r.name from hr_employee as h join resource_resource as r on h.resource_id=r.id where r.active='t';
employee_birthday.py
from openerp import tools
from openerp.osv import fields,osv
class birthday_report(osv.osv):
_name = "birthday.report"
_auto = False
_columns = {
'name': fields.many2one('hr.employee','Employee'),
'dob' : fields.date('Birthday'),
}
def init(self, cr):
tools.drop_view_if_exists(cr, 'birthday_report')
cr.execute("""
create or replace view birthday_report as (
select
h.id as id,
h.id as name,
concat(concat(date_part('Year',current_date),'-'),to_char(h.birthday, 'mm-dd')) as dob
from
hr_employee as h
join
resource_resource as r
on
h.resource_id=r.id
where
r.active ='t'
)
""")
birthday_report()
employee_birthday_view.xml
<record id="view_birthday_report_calendar" model="ir.ui.view">
<field name="name">Employee Birthday</field>
<field name="model">birthday.report</field>
<field name="arch" type="xml">
<calendar string="Birthday" color="name"
date_start="dob"
quick_add="False" avatar_model="hr.employee">
<field name="name"/>
</calendar>
</field>
</record>
can u post your domain condition code?..
@prakash: I have update my que. I have try both this domain but facing issue