[fix] if UOM and Warehouse link is invalid then set blank values
This commit is contained in:
parent
1b18bba04a
commit
29160441bb
@ -9,4 +9,13 @@ def execute():
|
|||||||
|
|
||||||
ss = frappe.get_doc("Stock Settings")
|
ss = frappe.get_doc("Stock Settings")
|
||||||
ss.set_qty_in_transactions_based_on_serial_no_input = 1
|
ss.set_qty_in_transactions_based_on_serial_no_input = 1
|
||||||
|
|
||||||
|
if ss.default_warehouse \
|
||||||
|
and not frappe.db.exists("Warehouse", ss.default_warehouse):
|
||||||
|
ss.default_warehouse = None
|
||||||
|
|
||||||
|
if ss.stock_uom and not frappe.db.exists("UOM", ss.stock_uom):
|
||||||
|
ss.stock_uom = None
|
||||||
|
|
||||||
|
ss.flags.ignore_mandatory = True
|
||||||
ss.save()
|
ss.save()
|
||||||
Loading…
x
Reference in New Issue
Block a user