mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-31 18:59:08 +00:00
refactor!: change "is_subcontracted" field type from "Select" to "Check"
This commit is contained in:
26
erpnext/patches/v14_0/change_is_subcontracted_fieldtype.py
Normal file
26
erpnext/patches/v14_0/change_is_subcontracted_fieldtype.py
Normal file
@@ -0,0 +1,26 @@
|
||||
# Copyright (c) 2022, Frappe Technologies Pvt. Ltd. and contributors
|
||||
# For license information, please see license.txt
|
||||
|
||||
import frappe
|
||||
|
||||
|
||||
def execute():
|
||||
for doctype in ["Purchase Order", "Purchase Receipt", "Purchase Invoice", "Supplier Quotation"]:
|
||||
frappe.db.sql(
|
||||
"""
|
||||
UPDATE `tab{doctype}`
|
||||
SET is_subcontracted = 0
|
||||
where is_subcontracted in ('', NULL, 'No')""".format(
|
||||
doctype=doctype
|
||||
)
|
||||
)
|
||||
frappe.db.sql(
|
||||
"""
|
||||
UPDATE `tab{doctype}`
|
||||
SET is_subcontracted = 1
|
||||
where is_subcontracted = 'Yes'""".format(
|
||||
doctype=doctype
|
||||
)
|
||||
)
|
||||
|
||||
frappe.reload_doc(frappe.get_meta(doctype).module, "doctype", frappe.scrub(doctype))
|
||||
Reference in New Issue
Block a user