Odoo Help

Welcome!

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

1

how to display the birthday of a customer in calendar?(SOLVED)

By
Alcaline
on 11/6/14, 2:12 AM 1,343 views

I want to display the BIRTHDATE of the customer in the calendar view? Is that possible?? if it is how will i ging to do that? can anyone please help me regarding with my problem?? thanks in advance

 

0
Gaurav Sahu
On 7/17/15, 3:47 AM

Try This 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 ;

This for hr_employee table but u can use for res_partner just change it.



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

)

""")

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>


Thanks 

0
Alcaline
On 11/10/14, 1:08 AM

I add this in my xml:


        <record id="=calendar_id" model="ir.ui.view">
            <field name="name">calendar_name</field>
            <field name="model">res.partner</field>
            <field name="type">calendar</field>
            <field name="arch" type="xml">
                <calendar string="Calendar" date_start="birthday" color="name">
                    <field name="name"/>
                </calendar>
            </field>
        </record>

can u show me the pics of this output...

Anand
on 11/10/14, 1:35 AM

Sorry Mr. Anand for the late reply.

Alcaline
on 11/21/14, 9:57 PM

Sorry Mr. Anand for the late reply.

Alcaline
on 11/21/14, 9:57 PM
0
Anand
On 11/6/14, 5:16 AM

Hai Alcaline..

First of all there is no specific module for Birthday event integeration..

But we have a alternate solution..

That is go to Message/Calendar In that

click the day you want and create a event... in that go to options tab and click 

Recurrent check box and give the untill the value every year

thats it..

Sorry I couldnt attach pics... since i have less karma..

thanks Anand

Alcaline
on 11/10/14, 1:03 AM

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

2 follower(s)

Stats

Asked: 11/6/14, 2:12 AM
Seen: 1343 times
Last updated: 7/17/15, 3:49 AM