Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[17.0][MIG] hr_employee_birthday_mail : Migration to 17.0 #1296

91 changes: 91 additions & 0 deletions hr_employee_birthday_mail/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
=========================
HR Employee Birthday Mail
=========================

..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:26231c818fddb39a490e72a0eacaa8feb704e5d4c71126f35ba86923d314ccda
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
:target: https://odoo-community.org/page/development-status
:alt: Beta
.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fhr-lightgray.png?logo=github
:target: https://github.com/OCA/hr/tree/17.0/hr_employee_birthday_mail
:alt: OCA/hr
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/hr-17-0/hr-17-0-hr_employee_birthday_mail
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
:target: https://runboat.odoo-community.org/builds?repo=OCA/hr&target_branch=17.0
:alt: Try me on Runboat

|badge1| |badge2| |badge3| |badge4| |badge5|

The module automates the process of sending out personalized birthday
emails to the celebrating employee while also informing their coworkers
about the special day. It encourages a culture of mutual respect,
camaraderie, and celebration within the team.

In essence, the 'hr_employee_birthday_mail' module ensures that every
birthday is acknowledged and celebrated, thereby promoting a positive
and unified work environment.

**Table of contents**

.. contents::
:local:

Usage
=====

Just install and configure in the scheduled action the hour you want to
run the check daily.

Bug Tracker
===========

Bugs are tracked on `GitHub Issues <https://github.com/OCA/hr/issues>`_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us to smash it by providing a detailed and welcomed
`feedback <https://github.com/OCA/hr/issues/new?body=module:%20hr_employee_birthday_mail%0Aversion:%2017.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.

Do not contact contributors directly about support or help with technical issues.

Credits
=======

Authors
-------

* ForgeFlow

Contributors
------------

- Joan Sisquella <[email protected]>
- Mateu Griful <[email protected]>
- Manish Bohra <[email protected]>

Maintainers
-----------

This module is maintained by the OCA.

.. image:: https://odoo-community.org/logo.png
:alt: Odoo Community Association
:target: https://odoo-community.org

OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.

This module is part of the `OCA/hr <https://github.com/OCA/hr/tree/17.0/hr_employee_birthday_mail>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
1 change: 1 addition & 0 deletions hr_employee_birthday_mail/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import models
16 changes: 16 additions & 0 deletions hr_employee_birthday_mail/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Copyright 2023 ForgeFlow S.L. (https://www.forgeflow.com)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
{
"name": "HR Employee Birthday Mail",
"summary": """
Automating birthday mail messages and fostering for a positive work environment.""",
"version": "17.0.1.0.0",
"license": "AGPL-3",
"author": "ForgeFlow, Odoo Community Association (OCA)",
"website": "https://github.com/OCA/hr",
"depends": ["hr", "mail"],
"data": ["data/data.xml", "data/ir_cron.xml", "views/hr_employee_views.xml"],
"installable": True,
"application": False,
"auto_install": False,
}
179 changes: 179 additions & 0 deletions hr_employee_birthday_mail/data/data.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,179 @@
<odoo noupdate="1">
<record id="email_template_birthday_1" model="mail.template">
<field name="name">Birthday Email 1</field>
<field name="model_id" ref="hr.model_hr_employee" />
<field name="subject">🎂 Happy Birthday, {{ object.name }}!</field>
<field name="email_from">{{ object.company_id.email }}</field>
<field name="email_to">{{ object.work_email }}</field>
<field name="body_html" type="html">
<div style="background-color:#f2f3f5; padding:20px;">
<h2 style="color:#4267b2; text-align:center;">Happy Birthday, <t
t-out="object.name"
/>!</h2>
<p
style="font-size:16px; text-align:center;"
>Another trip around the sun, and you don't look a day older! We wish you a fantastic day full of joy and surprises. May this year bring you closer to your dreams and bless you with abundance and joy. 🎉</p>
<p
style="font-size:16px; text-align:center;"
>Remember, you're not getting older, you're gaining more experience. And with each passing year, you become a more valuable member of our team. Here's to an amazing birthday and a year filled with adventure! 🥳</p>
<p
style="font-size:16px; text-align:center;"
>Cheers to you on your special day, <t t-out="object.name" />!</p>
</div>
</field>
</record>

<record id="email_template_birthday_2" model="mail.template">
<field name="name">Birthday Email 2</field>
<field name="model_id" ref="hr.model_hr_employee" />
<field name="subject">🎂 Celebrating You Today, {{ object.name }}!</field>
<field name="email_from">{{ object.company_id.email }}</field>
<field name="email_to">{{ object.work_email }}</field>
<field name="body_html" type="html">
<div style="background-color:#f2f3f5; padding:20px;">
<h2 style="color:#4267b2; text-align:center;">🎉 Let's Celebrate, <t
t-out="object.name"
/>! 🎉</h2>
<p
style="font-size:16px; text-align:center;"
>Today, we celebrate not just any birthday, but YOUR birthday: a day when a truly exceptional person came into this world.</p>
<p
style="font-size:16px; text-align:center;"
>Age is just a number, and the wrinkles are merely where the smiles have been. Remember, you're not getting older, you're just becoming a classic!</p>
<p
style="font-size:16px; text-align:center;"
>Your birthday is a special milestone on this journey of life, and we're thrilled to share it with you. Today is about celebrating all that you are and all that you will be.</p>
<p style="font-size:16px; text-align:center;">So here's to you, <t
t-out="object.name"
/>! Wishing you an abundance of fun, joy and cake on your special day. Have an unforgettable birthday! 🥳🎈</p>
</div>
</field>
</record>

<record id="email_template_birthday_3" model="mail.template">
<field name="name">Birthday Email 3</field>
<field name="model_id" ref="hr.model_hr_employee" />
<field name="subject">🎂 {{ object.name }}!, It's Your Day!</field>
<field name="email_from">{{ object.company_id.email }}</field>
<field name="email_to">{{ object.work_email }}</field>
<field name="body_html" type="html">
<div style="background-color:#f2f3f5; padding:20px;">
<h2 style="color:#4267b2; text-align:center;">🎂 Hey there, <t
t-out="object.name"
/>! It's Your Special Day! 🎂</h2>
<p
style="font-size:16px; text-align:center;"
>Birthdays are nature's way of telling us to eat more cake and ice cream. And, as it happens to be your birthday, we feel you deserve to have as much as you want!</p>
<p
style="font-size:16px; text-align:center;"
>Today, we're not just celebrating your birthday. We're celebrating you: the invaluable part of our team, the cheer-bringer, the problem-solver, the ray of sunshine in the office.</p>
<p
style="font-size:16px; text-align:center;"
>On this day, we hope you enjoy all the wonderful things life has to offer and spend it doing what you love the most. Remember, today is about you and only you. Make sure you enjoy it to the fullest!</p>
<p
style="font-size:16px; text-align:center;"
>So sit back, relax, and let the good vibes roll. Happy Birthday, <t
t-out="object.name"
/>! We hope this day brings you nothing but joy and happiness. 🥳🎉</p>
</div>
</field>
</record>

<record id="email_template_coworkers_1" model="mail.template">
<field name="name">Coworker's Birthday Email 1</field>
<field name="model_id" ref="hr.model_hr_employee" />
<field
name="subject"
>🎉 Birthday Alert: It's {{ ctx['birthday_employee'] }}'s special day!</field>
<field name="email_from">{{ object.company_id.email }}</field>
<field name="email_to">{{ object.work_email }}</field>
<field name="body_html" type="html">
<div style="background-color:#f2f3f5; padding:20px;">
<h2
style="color:#4267b2; text-align:center;"
>🎉 Birthday Alert 🎉</h2>
<p style="font-size:16px; text-align:center;">Hi <t
t-out="object.name"
/>,</p>
<p
style="font-size:16px; text-align:center;"
>Something feels different today, right? There's an extra sparkle in the air and a spring in our steps. Wondering why?</p>
<p style="font-size:16px; text-align:center;">It's because it's <b
><t t-out="ctx['birthday_employee']" /></b>'s birthday! 🎂</p>
<p
style="font-size:16px; text-align:center;"
>So, let's crank up the joy and celebration in the office today. Don't forget to wish them a happy birthday and make this day even more special for them! 🎈🎁</p>
</div>
</field>
</record>

<record id="email_template_coworkers_2" model="mail.template">
<field name="name">Coworker's Birthday Email 2</field>
<field name="model_id" ref="hr.model_hr_employee" />
<field name="subject">🎉 Cake Alert: {{ ctx['birthday_employee']}}</field>
<field name="email_from">{{ object.company_id.email }}</field>
<field name="email_to">{{ object.work_email }}</field>
<field name="body_html" type="html">
<div style="background-color:#f2f3f5; padding:20px;">
<h2 style="color:#4267b2; text-align:center;">🎉 Birthday Alert: <t
t-out="ctx['birthday_employee']"
/> is another year wiser! 🎉</h2>
<p style="font-size:16px; text-align:center;">Hey there, <t
t-out="object.name"
/>,</p>
<p
style="font-size:16px; text-align:center;"
>Guess what? We're fortunate enough to have a birthday in our midst today! Yes, it's <b
><t t-out="ctx['birthday_employee']" />'s</b> big day!</p>
<p
style="font-size:16px; text-align:center;"
>Take a moment, when you can, to send them your good wishes and contribute to a positive atmosphere today. Remember, even a simple 'Happy Birthday' can make someone's day!</p>
<p style="font-size:16px; text-align:center;">Let's all help make <t
t-out="ctx['birthday_employee']"
/> feel appreciated and valued on their special day! 🎈🎁</p>
<p
style="font-size:16px; text-align:center;"
>Thank you for your continuous effort in making our workplace a supportive and friendly environment!</p>
</div>
</field>
</record>

<record id="email_template_coworkers_3" model="mail.template">
<field name="name">Coworker's Birthday Email 3</field>
<field name="model_id" ref="hr.model_hr_employee" />
<field
name="subject"
>🎉 Time to Celebrate: {{ ctx['birthday_employee'] }}'s Birthday!</field>
<field name="email_from">{{ object.company_id.email }}</field>
<field name="email_to">{{ object.work_email }}</field>
<field name="body_html" type="html">
<div style="background-color:#f2f3f5; padding:20px;">
<h2
style="color:#4267b2; text-align:center;"
>🎂 It's Time to Celebrate: <t
t-out="ctx['birthday_employee']"
/>'s Birthday!</h2>
<p style="font-size:16px; text-align:center;">Hello, <t
t-out="object.name"
/>!</p>
<p
style="font-size:16px; text-align:center;"
>Today, we're celebrating the birthday of a valued team member, <b><t
t-out="ctx['birthday_employee']"
/></b>. </p>
<p
style="font-size:16px; text-align:center;"
>This day is a special one, and we encourage you to reach out and wish them a 'Happy Birthday'. A small gesture can make a big difference! </p>
<p
style="font-size:16px; text-align:center;"
>Let's make this day memorable for <t
t-out="ctx['birthday_employee']"
/>! 🎉🎁</p>
<p
style="font-size:16px; text-align:center;"
>Remember, our team is our greatest strength. Thanks for contributing to this wonderful work environment!</p>
</div>
</field>
</record>

</odoo>
15 changes: 15 additions & 0 deletions hr_employee_birthday_mail/data/ir_cron.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<odoo noupdate="1">
<record id="ir_cron_check_employee_birthdays" model="ir.cron">
<field name="name">Check Employee Birthdays</field>
<field name="model_id" ref="hr.model_hr_employee" />
<field name="state">code</field>
<field name="code">model._check_birthdays()</field>
<field name="active" eval="True" />
<field name="user_id" ref="base.user_root" />
<field name="interval_number">1</field>
<field name="interval_type">days</field>
<field name="numbercall">-1</field>
<field name="doall" eval="False" />
<field name="priority">5</field>
</record>
</odoo>
Loading
Loading