commit | e1116bbbbb6987e37d940f1f00e3e334ed0101d0 | [log] [tgz] |
---|---|---|
author | Nikhil Kothari <nik.kothari22@live.com> | Wed Jun 07 14:20:42 2023 +0530 |
committer | Nikhil Kothari <nik.kothari22@live.com> | Wed Jun 07 14:20:42 2023 +0530 |
tree | 7311f40d8648993178afd464bb5b5b8a06f7d044 | |
parent | 83c46085fbb56e1cfb2981a7d57b8ed313b4979a [diff] |
fix: added server side check for allow/restrict
diff --git a/erpnext/accounts/doctype/accounting_dimension_filter/accounting_dimension_filter.py b/erpnext/accounts/doctype/accounting_dimension_filter/accounting_dimension_filter.py index c0573a7..2a6c76d 100644 --- a/erpnext/accounts/doctype/accounting_dimension_filter/accounting_dimension_filter.py +++ b/erpnext/accounts/doctype/accounting_dimension_filter/accounting_dimension_filter.py
@@ -8,6 +8,13 @@ class AccountingDimensionFilter(Document): + + def before_save(self): + # If restriction is not applied on values, then remove all the dimensions and set allow_or_restrict to Restrict + if not self.apply_restriction_on_values: + self.allow_or_restrict = "Restrict" + self.set('dimensions', []) + def validate(self): self.validate_applicable_accounts()