[fix] Updated 'Include Holiday' in existing and default leave type records

This commit is contained in:
Nabin Hait 2015-07-29 16:15:08 +05:30
parent a184fbfa66
commit b24d2efc4b
4 changed files with 16 additions and 8 deletions

View File

@ -245,7 +245,7 @@ def get_total_leave_days(leave_app):
} }
else: else:
ret = { ret = {
'total_leave_days' : flt(tot_days) 'total_leave_days' : flt(tot_days)
} }
return ret return ret

View File

@ -1,11 +1,13 @@
[ [
{ {
"doctype": "Leave Type", "doctype": "Leave Type",
"leave_type_name": "_Test Leave Type" "leave_type_name": "_Test Leave Type",
"include_holiday": 1
}, },
{ {
"doctype": "Leave Type", "doctype": "Leave Type",
"is_lwp": 1, "is_lwp": 1,
"leave_type_name": "_Test Leave Type LWP" "leave_type_name": "_Test Leave Type LWP",
"include_holiday": 1
} }
] ]

View File

@ -181,3 +181,4 @@ erpnext.patches.v5_1.rename_roles
erpnext.patches.v5_1.default_bom erpnext.patches.v5_1.default_bom
execute:frappe.delete_doc("DocType", "Party Type") execute:frappe.delete_doc("DocType", "Party Type")
erpnext.patches.v5_4.fix_reserved_qty_and_sle_for_packed_items erpnext.patches.v5_4.fix_reserved_qty_and_sle_for_packed_items
execute:frappe.db.sql("update `tabLeave Type` set include_holiday=1")

View File

@ -41,11 +41,16 @@ def install(country=None):
{'doctype': 'Expense Claim Type', 'name': _('Travel'), 'expense_type': _('Travel')}, {'doctype': 'Expense Claim Type', 'name': _('Travel'), 'expense_type': _('Travel')},
# leave type # leave type
{'doctype': 'Leave Type', 'leave_type_name': _('Casual Leave'), 'name': _('Casual Leave'), 'is_encash': 1, 'is_carry_forward': 1, 'max_days_allowed': '3', }, {'doctype': 'Leave Type', 'leave_type_name': _('Casual Leave'), 'name': _('Casual Leave'),
{'doctype': 'Leave Type', 'leave_type_name': _('Compensatory Off'), 'name': _('Compensatory Off'), 'is_encash': 0, 'is_carry_forward': 0, }, 'is_encash': 1, 'is_carry_forward': 1, 'max_days_allowed': '3', 'include_holiday': 1},
{'doctype': 'Leave Type', 'leave_type_name': _('Sick Leave'), 'name': _('Sick Leave'), 'is_encash': 0, 'is_carry_forward': 0, }, {'doctype': 'Leave Type', 'leave_type_name': _('Compensatory Off'), 'name': _('Compensatory Off'),
{'doctype': 'Leave Type', 'leave_type_name': _('Privilege Leave'), 'name': _('Privilege Leave'), 'is_encash': 0, 'is_carry_forward': 0, }, 'is_encash': 0, 'is_carry_forward': 0, 'include_holiday': 1},
{'doctype': 'Leave Type', 'leave_type_name': _('Leave Without Pay'), 'name': _('Leave Without Pay'), 'is_encash': 0, 'is_carry_forward': 0, 'is_lwp':1}, {'doctype': 'Leave Type', 'leave_type_name': _('Sick Leave'), 'name': _('Sick Leave'),
'is_encash': 0, 'is_carry_forward': 0, 'include_holiday': 1},
{'doctype': 'Leave Type', 'leave_type_name': _('Privilege Leave'), 'name': _('Privilege Leave'),
'is_encash': 0, 'is_carry_forward': 0, 'include_holiday': 1},
{'doctype': 'Leave Type', 'leave_type_name': _('Leave Without Pay'), 'name': _('Leave Without Pay'),
'is_encash': 0, 'is_carry_forward': 0, 'is_lwp':1, 'include_holiday': 1},
# Employment Type # Employment Type
{'doctype': 'Employment Type', 'employee_type_name': _('Full-time')}, {'doctype': 'Employment Type', 'employee_type_name': _('Full-time')},