| Availability |
Odoo Online
Odoo.sh
On Premise
|
| Odoo Apps Dependencies |
•
Contacts (contacts)
• Employees (hr) • Discuss (mail) |
| Lines of code | 299 |
| Technical Name |
birthday_notification_knk |
| License | OPL-1 |
| Website | https://www.kanakinfosystems.com |
Odoo Proprietary License v1.0 This software and associated files (the "Software") may only be used (executed, modified, executed after modifications) if you have purchased a valid license from the authors, typically via Odoo Apps, or if you have received a written agreement from the authors of the Software (see the COPYRIGHT file). You may develop Odoo modules that use the Software as a library (typically by depending on it, importing it and using its resources), but without copying any source code or material from the Software. You may distribute those modules under the license of your choice, provided that this license is compatible with the terms of the Odoo Proprietary License (For example: LGPL, MIT, or proprietary licenses similar to this one). It is forbidden to publish, distribute, sublicense, or sell copies of the Software or modified copies of the Software. The above copyright notice and this permission notice must be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Please log in to comment on this module
Bug Report – Birthday Notification (v18.0.1.0): Scheduled emails never sent
Dear Kanak Infosystems Team,
We are using your Birthday Notification module (version 18.0.1.0) on Odoo 18 Community Edition (Ubuntu 24.04). The scheduled actions run daily without errors, but no birthday emails are ever generated. We traced the cause and are sharing our findings below.
1. Birthday comparison includes the year (critical)
In models/hr_employee.py and models/res_partner.py, the check is:
This compares the full date, including the year. A birthday of 2000-10-13 will never equal 2026-10-13, so the condition never matches and no email is sent, whether the cron runs automatically or manually.
Suggested fix: compare only the month and day. Employees born on 29 February also need handling, so that in non-leap years they are greeted on 28 February:
@api.model def _is_birthday_today(self, birthday, today): if (birthday.month, birthday.day) == (today.month, today.day): return True if (birthday.month, birthday.day) == (2, 29) and (today.month, today.day) == (2, 28): return not calendar.isleap(today.year) return FalseWe applied this fix locally and confirmed that the emails are now generated and sent correctly.
2. Date is evaluated in UTC (medium)
The cron runs as base.user_root (OdooBot), which has no timezone by default, so fields.Date.context_today() returns the UTC date. For companies in timezones ahead of UTC (e.g. Asia/Jakarta, UTC+7), a cron that runs early in the morning local time uses the previous day's date, and emails are sent one day late.
Suggestion: determine "today" using the company's or the employee's timezone, or set a default nextcall time and document the expected execution time.
3. Sender address may be rejected by the mail server (minor)
The templates use object.company_id.email or user.email as the sender. On servers that restrict the sender address (e.g. Outlook/Microsoft 365 OAuth with a FROM filter), emails sent from a different address can be rejected. Making the sender configurable in the settings, or falling back to Odoo's mail.default.from, would make the module more robust.
4. Minor code improvements
We would appreciate it if these fixes could be included in a future release, so that we do not need to maintain a local patch. Please let us know if you need further details or would like us to share our patched files.
Thank you for your support.
Regards,
LP Siagian
Bug Report – Birthday Notification (v18.0.1.0): Scheduled emails never sent
Hi,
Thanks for sharing your valuable feedback. All the points have been taken care of.
Best Regards
Team Kanak
There are no comments yet!