[fix] Task should be mandatory in Time Log only when Project is mentioned but Production Order is not

This commit is contained in:
Anand Doshi
2015-06-12 18:59:18 -04:00
parent f2a0161709
commit 63e4d31aa6

View File

@@ -221,7 +221,8 @@ class TimeLog(Document):
self.billing_amount = 0
def validate_task(self):
if self.project and not self.task:
# if a time log is being created against a project without production order
if (self.project and not self.production_order) and not self.task:
frappe.throw(_("Task is Mandatory if Time Log is against a project"))
def update_task(self):