chore: change fieldname for carried forward leave expiry

This commit is contained in:
Mangesh-Khairnar 2019-07-23 13:18:40 +05:30
parent fd1d4c2927
commit bb1be2e2ee
7 changed files with 10 additions and 10 deletions

View File

@ -111,7 +111,7 @@ class LeaveAllocation(Document):
def create_leave_ledger_entry(self, submit=True):
if self.carry_forwarded_leaves:
expiry_days = frappe.db.get_value("Leave Type", self.leave_type, "carry_forward_leave_expiry")
expiry_days = frappe.db.get_value("Leave Type", self.leave_type, "expire_carried_forward_leaves")
args = dict(
leaves=self.carry_forwarded_leaves,
from_date=self.from_date,

View File

@ -97,7 +97,7 @@ class TestLeaveAllocation(unittest.TestCase):
leave_type = create_leave_type(
leave_type_name="_Test_CF_leave_expiry",
is_carry_forward=1,
carry_forward_leave_expiry=90)
expire_carried_forward_leaves=90)
leave_type.submit()
# initial leave allocation

View File

@ -415,7 +415,7 @@ class TestLeaveApplication(unittest.TestCase):
leave_type = create_leave_type(
leave_type_name="_Test_CF_leave_expiry",
is_carry_forward=1,
carry_forward_leave_expiry=90)
expire_carried_forward_leaves=90)
leave_type.submit()
create_carry_forwarded_allocation(employee, leave_type)
@ -516,7 +516,7 @@ class TestLeaveApplication(unittest.TestCase):
leave_type = create_leave_type(
leave_type_name="_Test_CF_leave_expiry",
is_carry_forward=1,
carry_forward_leave_expiry=90)
expire_carried_forward_leaves=90)
leave_type.submit()
create_carry_forwarded_allocation(employee, leave_type)

View File

@ -86,7 +86,7 @@ def process_expired_allocation():
# fetch leave type records that has carry forwarded leaves expiry
leave_type_records = frappe.db.get_values("Leave Type", filters={
'carry_forward_leave_expiry': (">", 0)
'expire_carried_forward_leaves': (">", 0)
}, fieldname=['name'])
if leave_type_records:

View File

@ -95,7 +95,7 @@ def get_existing_allocations(employees, leave_period):
def get_leave_type_details():
leave_type_details = frappe._dict()
leave_types = frappe.get_all("Leave Type",
fields=["name", "is_lwp", "is_earned_leave", "is_compensatory", "is_carry_forward", "carry_forward_leave_expiry"])
fields=["name", "is_lwp", "is_earned_leave", "is_compensatory", "is_carry_forward", "expire_carried_forward_leaves"])
for d in leave_types:
leave_type_details.setdefault(d.name, d)
return leave_type_details

View File

@ -419,9 +419,9 @@
"collapsible": 0,
"columns": 0,
"depends_on": "",
"description": "calculated in days",
"description": "Calculated in days",
"fetch_if_empty": 0,
"fieldname": "carry_forward_leave_expiry",
"fieldname": "expire_carried_forward_leaves",
"fieldtype": "Int",
"hidden": 0,
"ignore_user_permissions": 0,
@ -728,7 +728,7 @@
"issingle": 0,
"istable": 0,
"max_attachments": 0,
"modified": "2019-05-30 15:38:39.334283",
"modified": "2019-07-22 15:38:39.334283",
"modified_by": "Administrator",
"module": "HR",
"name": "Leave Type",

View File

@ -19,7 +19,7 @@ def create_leave_type(**args):
"is_earned_leave": args.is_earned_leave or 0,
"is_lwp": args.is_lwp or 0,
"is_carry_forward": args.is_carry_forward or 0,
"carry_forward_leave_expiry": args.carry_forward_leave_expiry or 0,
"expire_carried_forward_leaves": args.expire_carried_forward_leaves or 0,
"encashment_threshold_days": args.encashment_threshold_days or 5,
"earning_component": "Leave Encashment"
})