From e64d453d09beb399a1e9fe9ab55139e23ff56320 Mon Sep 17 00:00:00 2001 From: Neil Trini Lasrado Date: Thu, 7 May 2015 11:12:14 +0530 Subject: [PATCH] patch added --- erpnext/patches.txt | 3 ++- ...te_planned_operating_cost_in_production_order.py | 13 +++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 erpnext/patches/v5_0/reclculate_planned_operating_cost_in_production_order.py diff --git a/erpnext/patches.txt b/erpnext/patches.txt index d857c59387d..593a2b4dbb8 100644 --- a/erpnext/patches.txt +++ b/erpnext/patches.txt @@ -150,4 +150,5 @@ erpnext.patches.v5_0.update_advance_paid erpnext.patches.v5_0.link_warehouse_with_account erpnext.patches.v5_0.rename_taxes_and_charges_master execute:frappe.delete_doc("Page", "stock-ledger") -execute:frappe.delete_doc("Page", "stock-level") \ No newline at end of file +execute:frappe.delete_doc("Page", "stock-level") +erpnext.patches.v5_0.reclculate_planned_operating_cost_in_production_order diff --git a/erpnext/patches/v5_0/reclculate_planned_operating_cost_in_production_order.py b/erpnext/patches/v5_0/reclculate_planned_operating_cost_in_production_order.py new file mode 100644 index 00000000000..a943c062bc4 --- /dev/null +++ b/erpnext/patches/v5_0/reclculate_planned_operating_cost_in_production_order.py @@ -0,0 +1,13 @@ +# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors +# License: GNU General Public License v3. See license.txt + +from __future__ import unicode_literals +import frappe + +def execute(): + for po in frappe.db.sql("""select name from `tabProduction Order` where docstatus < 2""", as_dict=1): + prod_order = frappe.get_doc("Production Order", po.name) + if prod_order.operations: + prod_order.flags.ignore_validate_update_after_submit = True + prod_order.calculate_time() + prod_order.save() \ No newline at end of file