fix: convert default_item_manufacturer to link field (#30835)
This commit is contained in:
parent
bdd55f07f4
commit
dcda55641b
@ -366,6 +366,7 @@ erpnext.patches.v13_0.remove_unknown_links_to_prod_plan_items # 24-03-2022
|
|||||||
erpnext.patches.v13_0.update_expense_claim_status_for_paid_advances
|
erpnext.patches.v13_0.update_expense_claim_status_for_paid_advances
|
||||||
erpnext.patches.v13_0.create_gst_custom_fields_in_quotation
|
erpnext.patches.v13_0.create_gst_custom_fields_in_quotation
|
||||||
erpnext.patches.v13_0.copy_custom_field_filters_to_website_item
|
erpnext.patches.v13_0.copy_custom_field_filters_to_website_item
|
||||||
|
erpnext.patches.v13_0.change_default_item_manufacturer_fieldtype
|
||||||
erpnext.patches.v14_0.discount_accounting_separation
|
erpnext.patches.v14_0.discount_accounting_separation
|
||||||
erpnext.patches.v14_0.delete_employee_transfer_property_doctype
|
erpnext.patches.v14_0.delete_employee_transfer_property_doctype
|
||||||
erpnext.patches.v13_0.create_accounting_dimensions_in_orders
|
erpnext.patches.v13_0.create_accounting_dimensions_in_orders
|
@ -0,0 +1,16 @@
|
|||||||
|
import frappe
|
||||||
|
|
||||||
|
|
||||||
|
def execute():
|
||||||
|
|
||||||
|
# Erase all default item manufacturers that dont exist.
|
||||||
|
item = frappe.qb.DocType("Item")
|
||||||
|
manufacturer = frappe.qb.DocType("Manufacturer")
|
||||||
|
|
||||||
|
(
|
||||||
|
frappe.qb.update(item)
|
||||||
|
.set(item.default_item_manufacturer, None)
|
||||||
|
.left_join(manufacturer)
|
||||||
|
.on(item.default_item_manufacturer == manufacturer.name)
|
||||||
|
.where(manufacturer.name.isnull() & item.default_item_manufacturer.isnotnull())
|
||||||
|
).run()
|
@ -869,8 +869,9 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"fieldname": "default_item_manufacturer",
|
"fieldname": "default_item_manufacturer",
|
||||||
"fieldtype": "Data",
|
"fieldtype": "Link",
|
||||||
"label": "Default Item Manufacturer",
|
"label": "Default Item Manufacturer",
|
||||||
|
"options": "Manufacturer",
|
||||||
"read_only": 1
|
"read_only": 1
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -918,7 +919,7 @@
|
|||||||
"image_field": "image",
|
"image_field": "image",
|
||||||
"index_web_pages_for_search": 1,
|
"index_web_pages_for_search": 1,
|
||||||
"links": [],
|
"links": [],
|
||||||
"modified": "2022-03-25 06:38:55.942304",
|
"modified": "2022-04-28 04:52:10.272256",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "Stock",
|
"module": "Stock",
|
||||||
"name": "Item",
|
"name": "Item",
|
||||||
@ -991,4 +992,4 @@
|
|||||||
"states": [],
|
"states": [],
|
||||||
"title_field": "item_name",
|
"title_field": "item_name",
|
||||||
"track_changes": 1
|
"track_changes": 1
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user