fix: added server side check for allow/restrict

This commit is contained in:
Nikhil Kothari 2023-06-07 14:20:42 +05:30
parent 83c46085fb
commit e1116bbbbb

View File

@ -8,6 +8,13 @@ from frappe.model.document import Document
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()