From 20b01873ab3a62bd3891d6cba40de55d8957a355 Mon Sep 17 00:00:00 2001 From: Neil Trini Lasrado Date: Mon, 22 Aug 2016 13:12:44 +0530 Subject: [PATCH] Made operation mandatory and removed mandatory from operation desc in Production Order Operation, set operation name as desc in operation master if desc is blank --- erpnext/manufacturing/doctype/operation/operation.py | 10 +++------- .../production_order_operation.json | 6 +++--- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/erpnext/manufacturing/doctype/operation/operation.py b/erpnext/manufacturing/doctype/operation/operation.py index 2c75feebd4..69e83292ff 100644 --- a/erpnext/manufacturing/doctype/operation/operation.py +++ b/erpnext/manufacturing/doctype/operation/operation.py @@ -2,13 +2,9 @@ # For license information, please see license.txt from __future__ import unicode_literals -import frappe from frappe.model.document import Document class Operation(Document): - def calculate_op_cost(self): - if self.hour_rate and self.time_in_mins: - self.operating_cost = flt(self.hour_rate) * flt(self.time_in_mins) / 60.0 - else : - self.operating_cost = 0 - + def validate(self): + if not self.description: + self.description = self.name diff --git a/erpnext/manufacturing/doctype/production_order_operation/production_order_operation.json b/erpnext/manufacturing/doctype/production_order_operation/production_order_operation.json index 3493ccf43e..00bf934d83 100644 --- a/erpnext/manufacturing/doctype/production_order_operation/production_order_operation.json +++ b/erpnext/manufacturing/doctype/production_order_operation/production_order_operation.json @@ -58,7 +58,7 @@ "print_hide_if_no_value": 0, "read_only": 1, "report_hide": 0, - "reqd": 0, + "reqd": 1, "search_index": 0, "set_only_once": 0, "unique": 0 @@ -85,7 +85,7 @@ "print_hide_if_no_value": 0, "read_only": 1, "report_hide": 0, - "reqd": 1, + "reqd": 0, "search_index": 0, "set_only_once": 0, "unique": 0 @@ -539,7 +539,7 @@ "issingle": 0, "istable": 1, "max_attachments": 0, - "modified": "2016-07-11 03:28:04.235889", + "modified": "2016-08-22 03:41:42.356833", "modified_by": "Administrator", "module": "Manufacturing", "name": "Production Order Operation",