[hotfix] commit after every 200 production orders (#9674)

This commit is contained in:
Makarand Bauskar 2017-07-06 19:13:09 +05:30 committed by GitHub
parent 5fe7f6c3fd
commit 88a37c17a6
2 changed files with 7 additions and 5 deletions

View File

@ -17,9 +17,11 @@ def execute():
pro_orders = frappe.get_all("Production Order", filters={"docstatus": ["!=", 2]}, fields=fields)
count = 0
for p in pro_orders:
pro_order = frappe.get_doc("Production Order", p.name)
count += 1
# set required items table
pro_order.set_required_items()
@ -39,6 +41,6 @@ def execute():
pro_order.db_set("status", status)
elif pro_order.status == "Stopped":
pro_order.update_reserved_qty_for_production()
if count % 200 == 0:
frappe.db.commit()

View File

@ -183,7 +183,7 @@ var erpnext_slides = [
slide.get_input("fy_start_date").on("change", function () {
var start_date = slide.form.fields_dict.fy_start_date.get_value();
var year_end_date =
frappe.datetime.add_days(frappe.datetime.add_months(frappe.datetime.user_to_obj(start_date), 12), -1);
frappe.datetime.add_days(frappe.datetime.add_months(start_date, 12), -1);
slide.form.fields_dict.fy_end_date.set_value(year_end_date);
});
}