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
commit e3d13bee36
2 changed files with 13 additions and 10 deletions

View File

@ -217,10 +217,12 @@ class ProductionOrder(Document):
for i, d in enumerate(self.operations):
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,
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
self.check_operation_fits_in_working_hours(d)

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):