From 4b83403a63d8259a97eebef8ee7eed9c988fefa3 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Fri, 12 Dec 2014 11:28:58 +0530 Subject: [PATCH] Fixed bom patch --- erpnext/patches/v4_2/recalculate_bom_costs.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/erpnext/patches/v4_2/recalculate_bom_costs.py b/erpnext/patches/v4_2/recalculate_bom_costs.py index 25fd7f34590..c05fd037093 100644 --- a/erpnext/patches/v4_2/recalculate_bom_costs.py +++ b/erpnext/patches/v4_2/recalculate_bom_costs.py @@ -5,8 +5,8 @@ from __future__ import unicode_literals import frappe def execute(): - for d in frappe.db.sql("""select bom.name from `tabBOM` bom where bom.docstatus < 2 and - exists(select bom_item.name from `tabBOM Operation` bom_op where + for d in frappe.db.sql("""select bom.name from `tabBOM` bom where bom.docstatus < 2 and + exists(select bom_op.name from `tabBOM Operation` bom_op where bom.name = bom_op.parent and bom_op.fixed_cycle_cost IS NOT NULL)""", as_dict=1): try: bom = frappe.get_doc('BOM', d.name) @@ -16,4 +16,3 @@ def execute(): frappe.db.commit() except: frappe.db.rollback() - \ No newline at end of file