fix: make currency read only once set
This commit is contained in:
parent
37d820a67c
commit
71db65d21c
@ -8,6 +8,7 @@
|
|||||||
"defaults_tab",
|
"defaults_tab",
|
||||||
"restore_defaults",
|
"restore_defaults",
|
||||||
"enable_forecasting",
|
"enable_forecasting",
|
||||||
|
"currency",
|
||||||
"branding_tab",
|
"branding_tab",
|
||||||
"brand_name",
|
"brand_name",
|
||||||
"brand_logo",
|
"brand_logo",
|
||||||
@ -64,12 +65,20 @@
|
|||||||
"fieldname": "enable_forecasting",
|
"fieldname": "enable_forecasting",
|
||||||
"fieldtype": "Check",
|
"fieldtype": "Check",
|
||||||
"label": "Enable Forecasting"
|
"label": "Enable Forecasting"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"fieldname": "currency",
|
||||||
|
"fieldtype": "Link",
|
||||||
|
"in_list_view": 1,
|
||||||
|
"label": "Currency",
|
||||||
|
"options": "Currency",
|
||||||
|
"reqd": 1
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"index_web_pages_for_search": 1,
|
"index_web_pages_for_search": 1,
|
||||||
"issingle": 1,
|
"issingle": 1,
|
||||||
"links": [],
|
"links": [],
|
||||||
"modified": "2025-07-01 13:20:48.757603",
|
"modified": "2025-07-09 17:49:18.705465",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "FCRM",
|
"module": "FCRM",
|
||||||
"name": "FCRM Settings",
|
"name": "FCRM Settings",
|
||||||
|
|||||||
@ -17,6 +17,7 @@ class FCRMSettings(Document):
|
|||||||
def validate(self):
|
def validate(self):
|
||||||
self.do_not_allow_to_delete_if_standard()
|
self.do_not_allow_to_delete_if_standard()
|
||||||
self.setup_forecasting()
|
self.setup_forecasting()
|
||||||
|
self.make_currency_read_only()
|
||||||
|
|
||||||
def do_not_allow_to_delete_if_standard(self):
|
def do_not_allow_to_delete_if_standard(self):
|
||||||
if not self.has_value_changed("dropdown_items"):
|
if not self.has_value_changed("dropdown_items"):
|
||||||
@ -60,6 +61,16 @@ class FCRMSettings(Document):
|
|||||||
"Check",
|
"Check",
|
||||||
)
|
)
|
||||||
|
|
||||||
|
def make_currency_read_only(self):
|
||||||
|
if self.currency and self.has_value_changed("currency"):
|
||||||
|
make_property_setter(
|
||||||
|
"FCRM Settings",
|
||||||
|
"currency",
|
||||||
|
"read_only",
|
||||||
|
1,
|
||||||
|
"Check",
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
def get_standard_dropdown_items():
|
def get_standard_dropdown_items():
|
||||||
return [item.get("name1") for item in frappe.get_hooks("standard_dropdown_items")]
|
return [item.get("name1") for item in frappe.get_hooks("standard_dropdown_items")]
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user