fix: Asset Maintenance - TypeError - Version 11 (#19069)

* fix: Asset Maintenance - TypeError

* Update asset_maintenance.py
This commit is contained in:
Jamsheer PP
2019-09-16 19:42:38 +05:30
committed by Nabin Hait
parent f2544ec7f2
commit a2398775cd

View File

@@ -56,8 +56,7 @@ def assign_tasks(asset_maintenance_name, assign_to_member, maintenance_task, nex
def calculate_next_due_date(periodicity, start_date = None, end_date = None, last_completion_date = None, next_due_date = None):
if not start_date and not last_completion_date:
start_date = frappe.utils.now()
if last_completion_date and (last_completion_date > start_date or not start_date):
if last_completion_date and ((start_date and last_completion_date > start_date) or not start_date):
start_date = last_completion_date
if periodicity == 'Daily':
next_due_date = add_days(start_date, 1)
@@ -115,4 +114,4 @@ def get_maintenance_log(asset_name):
select maintenance_status, count(asset_name) as count, asset_name
from `tabAsset Maintenance Log`
where asset_name=%s group by maintenance_status""",
(asset_name), as_dict=1)
(asset_name), as_dict=1)