feat: add patch for default batch_size for old records

This commit is contained in:
Govind S Menokee 2019-07-16 01:48:35 +05:30
parent 14ec76e8d9
commit 90fc3aff72
2 changed files with 21 additions and 0 deletions

View File

@ -615,3 +615,4 @@ erpnext.patches.v11_1.set_missing_opportunity_from
erpnext.patches.v12_0.set_quotation_status
erpnext.patches.v12_0.set_priority_for_support
erpnext.patches.v12_0.delete_priority_property_setter
erpnext.patches.v12_0.set_default_batch_size

View File

@ -0,0 +1,20 @@
import frappe
def execute():
frappe.reload_doc("manufacturing", "doctype", "bom_operation")
frappe.reload_doc("manufacturing", "doctype", "work_order_operation")
frappe.db.sql("""
UPDATE
`tabBOM Operation` bo
SET
bo.batch_size = 1
""")
frappe.db.sql("""
UPDATE
`tabWork Order Operation` wop
SET
wop.batch_size = 1
""")
frappe.db.commit()