mirror of
https://github.com/frappe/erpnext.git
synced 2026-09-17 18:45:20 +00:00
chore: rename type field to secondary_item_type (#55469)
This commit is contained in:
@@ -41,7 +41,7 @@ def insert_into_bom():
|
||||
"conversion_factor": 1,
|
||||
"qty": item.stock_qty,
|
||||
"is_legacy": 1,
|
||||
"type": "Scrap",
|
||||
"secondary_item_type": "Scrap",
|
||||
}
|
||||
)
|
||||
secondary_item.insert()
|
||||
@@ -49,7 +49,14 @@ def insert_into_bom():
|
||||
|
||||
def insert_into_job_card():
|
||||
fields = ["item_code", "item_name", "description", "stock_qty", "stock_uom"]
|
||||
bulk_insert("Job Card", "Job Card Scrap Item", "Job Card Secondary Item", fields, ["type"], ["Scrap"])
|
||||
bulk_insert(
|
||||
"Job Card",
|
||||
"Job Card Scrap Item",
|
||||
"Job Card Secondary Item",
|
||||
fields,
|
||||
["secondary_item_type"],
|
||||
["Scrap"],
|
||||
)
|
||||
|
||||
|
||||
def insert_into_subcontracting_inward():
|
||||
@@ -67,7 +74,7 @@ def insert_into_subcontracting_inward():
|
||||
"Subcontracting Inward Order Scrap Item",
|
||||
"Subcontracting Inward Order Secondary Item",
|
||||
fields,
|
||||
["type"],
|
||||
["secondary_item_type"],
|
||||
["Scrap"],
|
||||
)
|
||||
|
||||
|
||||
18
erpnext/patches/v16_0/rename_secondary_item_type_field.py
Normal file
18
erpnext/patches/v16_0/rename_secondary_item_type_field.py
Normal file
@@ -0,0 +1,18 @@
|
||||
import frappe
|
||||
from frappe.model.utils.rename_field import rename_field
|
||||
|
||||
|
||||
def execute():
|
||||
doctypes = [
|
||||
"BOM Secondary Item",
|
||||
"Job Card Secondary Item",
|
||||
"Stock Entry Detail",
|
||||
"Subcontracting Inward Order Secondary Item",
|
||||
"Subcontracting Receipt Item",
|
||||
]
|
||||
|
||||
for doctype in doctypes:
|
||||
if not frappe.db.has_column(doctype, "type"):
|
||||
continue
|
||||
|
||||
rename_field(doctype, "type", "secondary_item_type")
|
||||
Reference in New Issue
Block a user