[minor] added set_value in domainify
This commit is contained in:
parent
4b9238a03b
commit
48c7658aee
@ -24,7 +24,7 @@ domains = {
|
|||||||
{'doctype': 'Item', 'fieldname': 'is_stock_item', 'property': 'default', 'value': 0},
|
{'doctype': 'Item', 'fieldname': 'is_stock_item', 'property': 'default', 'value': 0},
|
||||||
],
|
],
|
||||||
'set_value': [
|
'set_value': [
|
||||||
['Stock Settings', 'show_barcode', 0]
|
['Stock Settings', None, 'show_barcode', 0]
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -47,6 +47,12 @@ def setup_domain(domain):
|
|||||||
for args in data.properties:
|
for args in data.properties:
|
||||||
frappe.make_property_setter(args)
|
frappe.make_property_setter(args)
|
||||||
|
|
||||||
|
if data.set_value:
|
||||||
|
for args in data.set_value:
|
||||||
|
doc = frappe.get_doc(args[0], args[1] or args[0])
|
||||||
|
doc.set(args[2], args[3])
|
||||||
|
doc.save()
|
||||||
|
|
||||||
frappe.clear_cache()
|
frappe.clear_cache()
|
||||||
|
|
||||||
def reset():
|
def reset():
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user