mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-06 15:00:27 +00:00
fix(patch): set attribute to none if it does not exist (#17605)
This commit is contained in:
@@ -6,5 +6,10 @@ import frappe
|
||||
|
||||
def execute():
|
||||
stock_settings = frappe.get_doc('Stock Settings')
|
||||
if stock_settings.default_warehouse and not frappe.db.exists("Warehouse", stock_settings.default_warehouse):
|
||||
stock_settings.default_warehouse = None
|
||||
if stock_settings.stock_uom and not frappe.db.exists("UOM", stock_settings.stock_uom):
|
||||
stock_settings.stock_uom = None
|
||||
stock_settings.flags.ignore_mandatory = True
|
||||
stock_settings.action_if_quality_inspection_is_not_submitted = "Stop"
|
||||
stock_settings.save()
|
||||
stock_settings.save()
|
||||
|
||||
Reference in New Issue
Block a user