Fixes in Production Order
diff --git a/erpnext/manufacturing/doctype/production_order/production_order.js b/erpnext/manufacturing/doctype/production_order/production_order.js
index 971f007..17fa202 100644
--- a/erpnext/manufacturing/doctype/production_order/production_order.js
+++ b/erpnext/manufacturing/doctype/production_order/production_order.js
@@ -198,11 +198,13 @@
frappe.ui.form.trigger("Production Order", 'bom_no')
},
- track_operations: function() {
- return this.frm.call({
- doc: this.frm.doc,
- method: "track_operation"
- });
+ track_operations: function(doc) {
+ if (doc.track_operations) {
+ frappe.ui.form.trigger("Production Order", 'bom_no')
+ }
+ else {
+ doc.operations =[];
+ }
},
show_time_logs: function(doc, cdt, cdn) {
diff --git a/erpnext/manufacturing/doctype/production_order/production_order.py b/erpnext/manufacturing/doctype/production_order/production_order.py
index 52061a0..099efaa 100644
--- a/erpnext/manufacturing/doctype/production_order/production_order.py
+++ b/erpnext/manufacturing/doctype/production_order/production_order.py
@@ -4,7 +4,7 @@
from __future__ import unicode_literals
import frappe, json
-from frappe.utils import flt, nowdate, get_datetime, getdate, date_diff, cint, now
+from frappe.utils import flt, nowdate, get_datetime, getdate, date_diff, cint
from frappe import _
from frappe.model.document import Document
from erpnext.manufacturing.doctype.bom.bom import validate_bom_no
@@ -329,12 +329,6 @@
if frappe.db.get_value("Item", self.production_item, "has_variants"):
frappe.throw(_("Production Order cannot be raised against a Item Template"))
-
- def track_operation(self):
- if self.track_operations:
- self.set_production_order_operations()
- else:
- self.set('operations', [])
@frappe.whitelist()
def get_item_details(item):
@@ -399,7 +393,7 @@
return data
@frappe.whitelist()
-def make_time_log(name, operation, from_time=now(), to_time=now(), qty=None, project=None, workstation=None, operation_id=None):
+def make_time_log(name, operation, from_time=None, to_time=None, qty=None, project=None, workstation=None, operation_id=None):
time_log = frappe.new_doc("Time Log")
time_log.for_manufacturing = 1
time_log.from_time = from_time