feat: remove check box for batch operation

This commit is contained in:
Govind S Menokee 2019-07-14 22:55:12 +05:30
parent 473a5477b6
commit f3e10a489d
3 changed files with 4 additions and 15 deletions

View File

@ -578,7 +578,7 @@ class BOM(WebsiteGenerator):
for d in self.operations:
if not d.description:
d.description = frappe.db.get_value('Operation', d.operation, 'description')
if not d.is_batch_operation:
if not d.batch_size > 0:
d.batch_size = 1
def get_list_context(context):

View File

@ -11,7 +11,6 @@
"col_break1",
"hour_rate",
"time_in_mins",
"is_batch_operation",
"batch_size",
"operating_cost",
"base_hour_rate",
@ -100,15 +99,8 @@
"fieldtype": "Attach",
"label": "Image"
},
{
"default": "0",
"fieldname": "is_batch_operation",
"fieldtype": "Check",
"label": "Is Batch Operation"
},
{
"default": "1",
"depends_on": "eval:doc.is_batch_operation==1;",
"fieldname": "batch_size",
"fieldtype": "Int",
"label": "Batch Size"
@ -116,8 +108,8 @@
],
"idx": 1,
"istable": 1,
"modified": "2019-06-29 03:35:32.213562",
"modified_by": "Administrator",
"modified": "2019-07-14 22:35:55.374037",
"modified_by": "govindsmenokee@gmail.com",
"module": "Manufacturing",
"name": "BOM Operation",
"owner": "Administrator",

View File

@ -350,10 +350,7 @@ class WorkOrder(Document):
bom_qty = frappe.db.get_value("BOM", self.bom_no, "quantity")
for d in self.get("operations"):
if d.is_batch_operation:
d.time_in_mins = flt(d.time_in_mins) / flt(bom_qty) * math.ceil(flt(self.qty)/flt(d.batch_size))
else:
d.time_in_mins = flt(d.time_in_mins) / flt(bom_qty) * flt(self.qty)
d.time_in_mins = flt(d.time_in_mins) / flt(bom_qty) * math.ceil(flt(self.qty) / flt(d.batch_size))
self.calculate_operating_cost()