[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
|
||||
import frappe
|
||||
|
||||
domains = {
|
||||
def get_domains():
|
||||
'''Written as a function to prevent data mutation effects'''
|
||||
return {
|
||||
'Manufacturing': {
|
||||
'desktop_icons': ['Item', 'BOM', 'Customer', 'Supplier', 'Sales Order',
|
||||
'Production Order', 'Stock Entry', 'Purchase Order', 'Task', 'Buying', 'Selling',
|
||||
@ -56,6 +58,8 @@ domains = {
|
||||
}
|
||||
|
||||
def setup_domain(domain):
|
||||
domains = get_domains()
|
||||
|
||||
if not domain in domains:
|
||||
return
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user