Skip to content

Commit

Permalink
fix: convert default_item_manufacturer to link field (#30835)
Browse files Browse the repository at this point in the history
(cherry picked from commit dcda556)

# Conflicts:
#	erpnext/patches.txt
#	erpnext/stock/doctype/item/item.json
  • Loading branch information
ankush authored and mergify[bot] committed May 2, 2022
1 parent 7c0069c commit 8eda11f
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 2 deletions.
7 changes: 7 additions & 0 deletions erpnext/patches.txt
Original file line number Diff line number Diff line change
Expand Up @@ -360,5 +360,12 @@ erpnext.patches.v13_0.create_gst_custom_fields_in_quotation
erpnext.patches.v13_0.update_expense_claim_status_for_paid_advances
erpnext.patches.v13_0.set_return_against_in_pos_invoice_references
erpnext.patches.v13_0.copy_custom_field_filters_to_website_item
<<<<<<< HEAD
erpnext.patches.v13_0.education_deprecation_warning
erpnext.patches.v13_0.create_accounting_dimensions_in_orders
=======
erpnext.patches.v13_0.change_default_item_manufacturer_fieldtype
erpnext.patches.v14_0.discount_accounting_separation
erpnext.patches.v14_0.delete_employee_transfer_property_doctype
erpnext.patches.v13_0.create_accounting_dimensions_in_orders
>>>>>>> dcda55641b (fix: convert default_item_manufacturer to link field (#30835))
Original file line number Diff line number Diff line change
@@ -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()
9 changes: 7 additions & 2 deletions erpnext/stock/doctype/item/item.json
Original file line number Diff line number Diff line change
Expand Up @@ -918,8 +918,9 @@
},
{
"fieldname": "default_item_manufacturer",
"fieldtype": "Data",
"fieldtype": "Link",
"label": "Default Item Manufacturer",
"options": "Manufacturer",
"read_only": 1
},
{
Expand Down Expand Up @@ -954,7 +955,11 @@
"image_field": "image",
"index_web_pages_for_search": 1,
"links": [],
<<<<<<< HEAD
"modified": "2021-12-14 04:13:16.857534",
=======
"modified": "2022-04-28 04:52:10.272256",
>>>>>>> dcda55641b (fix: convert default_item_manufacturer to link field (#30835))
"modified_by": "Administrator",
"module": "Stock",
"name": "Item",
Expand Down Expand Up @@ -1025,4 +1030,4 @@
"sort_order": "DESC",
"title_field": "item_name",
"track_changes": 1
}
}

0 comments on commit 8eda11f

Please sign in to comment.