Merge pull request #3467 from anandpdoshi/anand-june-12

Fixes
This commit is contained in:
Nabin Hait
2015-06-15 10:03:20 +05:30
2 changed files with 13 additions and 10 deletions

View File

@@ -217,12 +217,14 @@ class ProductionOrder(Document):
for i, d in enumerate(self.operations): for i, d in enumerate(self.operations):
self.set_operation_start_end_time(i, d) self.set_operation_start_end_time(i, d)
if not d.workstation:
continue
time_log = make_time_log(self.name, d.operation, d.planned_start_time, d.planned_end_time, time_log = make_time_log(self.name, d.operation, d.planned_start_time, d.planned_end_time,
flt(self.qty) - flt(d.completed_qty), self.project_name, d.workstation, operation_id=d.name) flt(self.qty) - flt(d.completed_qty), self.project_name, d.workstation, operation_id=d.name)
if d.workstation: # validate operating hours if workstation [not mandatory] is specified
# validate operating hours if workstation [not mandatory] is specified self.check_operation_fits_in_working_hours(d)
self.check_operation_fits_in_working_hours(d)
original_start_time = time_log.from_time original_start_time = time_log.from_time
while True: while True:

View File

@@ -221,7 +221,8 @@ class TimeLog(Document):
self.billing_amount = 0 self.billing_amount = 0
def validate_task(self): 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")) frappe.throw(_("Task is Mandatory if Time Log is against a project"))
def update_task(self): def update_task(self):