mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-01 19:29:10 +00:00
[fix] [minor] create birthday event only for active employees, else delete it
This commit is contained in:
@@ -1,11 +0,0 @@
|
||||
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd.
|
||||
# License: GNU General Public License v3. See license.txt
|
||||
|
||||
from __future__ import unicode_literals
|
||||
import webnotes
|
||||
|
||||
def execute():
|
||||
for employee in webnotes.conn.sql_list("""select name from `tabEmployee` where ifnull(date_of_birth, '')!=''"""):
|
||||
obj = webnotes.get_obj("Employee", employee)
|
||||
obj.update_dob_event()
|
||||
|
||||
13
patches/august_2013/p05_employee_birthdays.py
Normal file
13
patches/august_2013/p05_employee_birthdays.py
Normal file
@@ -0,0 +1,13 @@
|
||||
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd.
|
||||
# License: GNU General Public License v3. See license.txt
|
||||
|
||||
from __future__ import unicode_literals
|
||||
import webnotes
|
||||
|
||||
def execute():
|
||||
webnotes.conn.sql("""delete from `tabEvent` where repeat_on='Every Year' and ref_type='Employee'""")
|
||||
for employee in webnotes.conn.sql_list("""select name from `tabEmployee` where status='Active' and
|
||||
ifnull(date_of_birth, '')!=''"""):
|
||||
obj = webnotes.get_obj("Employee", employee)
|
||||
obj.update_dob_event()
|
||||
|
||||
@@ -254,5 +254,5 @@ patch_list = [
|
||||
"patches.august_2013.p01_hr_settings",
|
||||
"patches.august_2013.p02_rename_price_list",
|
||||
"patches.august_2013.p03_pos_setting_replace_customer_account",
|
||||
"patches.august_2013.p04_employee_birthdays",
|
||||
"patches.august_2013.p05_employee_birthdays",
|
||||
]
|
||||
Reference in New Issue
Block a user