[fix] use get_domains to prevent mutation of nested dictionary
This commit is contained in:
parent
c8d86cb948
commit
0e4119b2de
@ -4,7 +4,9 @@
|
|||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
import frappe
|
import frappe
|
||||||
|
|
||||||
domains = {
|
def get_domains():
|
||||||
|
'''Written as a function to prevent data mutation effects'''
|
||||||
|
return {
|
||||||
'Manufacturing': {
|
'Manufacturing': {
|
||||||
'desktop_icons': ['Item', 'BOM', 'Customer', 'Supplier', 'Sales Order',
|
'desktop_icons': ['Item', 'BOM', 'Customer', 'Supplier', 'Sales Order',
|
||||||
'Production Order', 'Stock Entry', 'Purchase Order', 'Task', 'Buying', 'Selling',
|
'Production Order', 'Stock Entry', 'Purchase Order', 'Task', 'Buying', 'Selling',
|
||||||
@ -53,9 +55,11 @@ domains = {
|
|||||||
['Stock Settings', None, 'show_barcode_field', 0]
|
['Stock Settings', None, 'show_barcode_field', 0]
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
def setup_domain(domain):
|
def setup_domain(domain):
|
||||||
|
domains = get_domains()
|
||||||
|
|
||||||
if not domain in domains:
|
if not domain in domains:
|
||||||
return
|
return
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user