From 3fcd89f63e18db28168b034817d3ad33c728af31 Mon Sep 17 00:00:00 2001 From: Neil Trini Lasrado Date: Tue, 24 Mar 2015 17:51:31 +0530 Subject: [PATCH] against_manufacturing renamed to for_manufacturing --- .../doctype/production_order/production_order.py | 2 +- erpnext/projects/doctype/time_log/test_time_log.py | 4 ++-- erpnext/projects/doctype/time_log/time_log.js | 2 +- erpnext/projects/doctype/time_log/time_log.json | 12 ++++++------ erpnext/projects/doctype/time_log/time_log.py | 8 +++++--- erpnext/projects/doctype/time_log/time_log_list.js | 2 +- .../doctype/time_log_batch/test_time_log_batch.py | 2 +- 7 files changed, 17 insertions(+), 15 deletions(-) diff --git a/erpnext/manufacturing/doctype/production_order/production_order.py b/erpnext/manufacturing/doctype/production_order/production_order.py index f5269982ae..524d11e98d 100644 --- a/erpnext/manufacturing/doctype/production_order/production_order.py +++ b/erpnext/manufacturing/doctype/production_order/production_order.py @@ -373,7 +373,7 @@ def get_events(start, end, filters=None): @frappe.whitelist() def make_time_log(name, operation, from_time, to_time, qty=None, project=None, workstation=None, operation_id=None): time_log = frappe.new_doc("Time Log") - time_log.against_manufacturing = 1 + time_log.for_manufacturing = 1 time_log.from_time = from_time time_log.to_time = to_time time_log.production_order = name diff --git a/erpnext/projects/doctype/time_log/test_time_log.py b/erpnext/projects/doctype/time_log/test_time_log.py index c54755eed0..8f8e31d01a 100644 --- a/erpnext/projects/doctype/time_log/test_time_log.py +++ b/erpnext/projects/doctype/time_log/test_time_log.py @@ -36,7 +36,7 @@ class TestTimeLog(unittest.TestCase): time_log = frappe.get_doc({ "doctype": "Time Log", - "against_manufacturing": 1, + "for_manufacturing": 1, "production_order": prod_order.name, "qty": 1, "from_time": "2014-12-26 00:00:00", @@ -54,7 +54,7 @@ class TestTimeLog(unittest.TestCase): time_log = frappe.get_doc({ "doctype": "Time Log", - "against_manufacturing": 1, + "for_manufacturing": 1, "production_order": prod_order.name, "operation": prod_order.operations[0].operation, "operation_id": prod_order.operations[0].name, diff --git a/erpnext/projects/doctype/time_log/time_log.js b/erpnext/projects/doctype/time_log/time_log.js index a7065cb72c..91971f3b2d 100644 --- a/erpnext/projects/doctype/time_log/time_log.js +++ b/erpnext/projects/doctype/time_log/time_log.js @@ -5,7 +5,7 @@ frappe.provide("erpnext.projects"); frappe.ui.form.on("Time Log", "onload", function(frm) { frm.set_query("task", erpnext.queries.task); - if (frm.doc.against_manufacturing) { + if (frm.doc.for_manufacturing) { frappe.ui.form.trigger("Time Log", "production_order"); } }); diff --git a/erpnext/projects/doctype/time_log/time_log.json b/erpnext/projects/doctype/time_log/time_log.json index 571b74c109..6ef576f7f7 100644 --- a/erpnext/projects/doctype/time_log/time_log.json +++ b/erpnext/projects/doctype/time_log/time_log.json @@ -75,15 +75,15 @@ "read_only": 0 }, { - "fieldname": "against_manufacturing", + "fieldname": "for_manufacturing", "fieldtype": "Check", - "label": "Against Manufacturing", + "label": "For Manufacturing", "permlevel": 0, "precision": "", "read_only": 1 }, { - "depends_on": "eval:!doc.against_manufacturing", + "depends_on": "eval:!doc.for_manufacturing", "fieldname": "activity_type", "fieldtype": "Link", "in_list_view": 0, @@ -94,7 +94,7 @@ "reqd": 0 }, { - "depends_on": "eval:!doc.against_manufacturing", + "depends_on": "eval:!doc.for_manufacturing", "fieldname": "task", "fieldtype": "Link", "label": "Task", @@ -103,7 +103,7 @@ "read_only": 0 }, { - "depends_on": "eval:doc.against_manufacturing", + "depends_on": "eval:doc.for_manufacturing", "fieldname": "section_break_11", "fieldtype": "Section Break", "permlevel": 0, @@ -242,7 +242,7 @@ "icon": "icon-time", "idx": 1, "is_submittable": 1, - "modified": "2015-03-24 07:10:31.412669", + "modified": "2015-03-24 08:10:31.412670", "modified_by": "Administrator", "module": "Projects", "name": "Time Log", diff --git a/erpnext/projects/doctype/time_log/time_log.py b/erpnext/projects/doctype/time_log/time_log.py index 24eba1ceb6..a499c8f788 100644 --- a/erpnext/projects/doctype/time_log/time_log.py +++ b/erpnext/projects/doctype/time_log/time_log.py @@ -103,9 +103,11 @@ class TimeLog(Document): self.hours = flt(time_diff_in_seconds(self.to_time, self.from_time)) / 3600 def validate_time_log_for(self): - if not self.against_manufacturing: + if not self.for_manufacturing: for fld in ["production_order", "operation", "workstation", "completed_qty"]: self.set(fld, None) + else: + self.activity_type=None def check_workstation_timings(self): """Checks if **Time Log** is between operating hours of the **Workstation**.""" @@ -122,7 +124,7 @@ class TimeLog(Document): def update_production_order(self): """Updates `start_date`, `end_date`, `status` for operation in Production Order.""" - if self.against_manufacturing and self.production_order: + if self.for_manufacturing and self.production_order: if not self.operation_id: frappe.throw(_("Operation ID not set")) @@ -185,7 +187,7 @@ class TimeLog(Document): (self.production_order, self.operation_id), as_dict=1)[0] def validate_manufacturing(self): - if self.against_manufacturing: + if self.for_manufacturing: if not self.production_order: frappe.throw(_("Production Order is Mandatory")) if not self.operation: diff --git a/erpnext/projects/doctype/time_log/time_log_list.js b/erpnext/projects/doctype/time_log/time_log_list.js index c6ab673486..d4448068fa 100644 --- a/erpnext/projects/doctype/time_log/time_log_list.js +++ b/erpnext/projects/doctype/time_log/time_log_list.js @@ -3,7 +3,7 @@ // render frappe.listview_settings['Time Log'] = { - add_fields: ["status", "billable", "activity_type", "task", "project", "hours", "against_manufacturing"], + add_fields: ["status", "billable", "activity_type", "task", "project", "hours", "for_manufacturing"], selectable: true, onload: function(me) { me.page.add_menu_item(__("Make Time Log Batch"), function() { diff --git a/erpnext/projects/doctype/time_log_batch/test_time_log_batch.py b/erpnext/projects/doctype/time_log_batch/test_time_log_batch.py index 5e94a23976..240ca97926 100644 --- a/erpnext/projects/doctype/time_log_batch/test_time_log_batch.py +++ b/erpnext/projects/doctype/time_log_batch/test_time_log_batch.py @@ -35,7 +35,7 @@ def create_time_log(): "from_time": "2013-01-02 10:00:00.000000", "to_time": "2013-01-02 11:00:00.000000", "docstatus": 0, - "against_manufacturing": 0 + "for_manufacturing": 0 }) time_log.insert() time_log.submit()