[fix] remove warehouse from Stock Settings if warehouse wont exists (#11487)
This commit is contained in:
parent
148b62a206
commit
045b2877b7
@ -456,3 +456,4 @@ erpnext.patches.v9_0.set_variant_item_description
|
||||
erpnext.patches.v9_0.set_uoms_in_variant_field
|
||||
erpnext.patches.v9_0.copy_old_fees_field_data
|
||||
erpnext.patches.v9_0.set_pos_profile_name
|
||||
erpnext.patches.v9_0.remove_non_existing_warehouse_from_stock_settings
|
@ -0,0 +1,7 @@
|
||||
import frappe
|
||||
|
||||
def execute():
|
||||
default_warehouse = frappe.db.get_value("Stock Settings", None, "default_warehouse")
|
||||
if default_warehouse:
|
||||
if not frappe.db.get_value("Warehouse", {"name": default_warehouse}):
|
||||
frappe.db.set_value("Stock Settings", None, "default_warehouse", "")
|
Loading…
x
Reference in New Issue
Block a user