mirror of
https://github.com/frappe/erpnext.git
synced 2026-08-12 06:01:46 +00:00
This commit is contained in:
@@ -30,7 +30,7 @@ class TermsandConditions(Document):
|
||||
|
||||
def validate(self):
|
||||
if self.terms:
|
||||
validate_template(self.terms)
|
||||
validate_template(self.terms, restrict_globals=True)
|
||||
if not cint(self.buying) and not cint(self.selling) and not cint(self.hr) and not cint(self.disabled):
|
||||
throw(_("At least one of the Applicable Modules should be selected"))
|
||||
|
||||
@@ -40,7 +40,10 @@ def get_terms_and_conditions(template_name, doc):
|
||||
if isinstance(doc, str):
|
||||
doc = json.loads(doc)
|
||||
|
||||
terms_and_conditions = frappe.get_doc("Terms and Conditions", template_name)
|
||||
tnc = frappe.get_cached_doc("Terms and Conditions", template_name)
|
||||
tnc.check_permission()
|
||||
|
||||
if terms_and_conditions.terms:
|
||||
return frappe.render_template(terms_and_conditions.terms, doc)
|
||||
if not tnc.terms:
|
||||
return
|
||||
|
||||
return frappe.render_template(tnc.terms, doc, restrict_globals=1)
|
||||
|
||||
@@ -43,7 +43,7 @@ skip_namespaces = [
|
||||
]
|
||||
|
||||
[tool.bench.frappe-dependencies]
|
||||
frappe = ">=16.0.0,<17.0.0"
|
||||
frappe = ">=16.21.0,<17.0.0"
|
||||
|
||||
[tool.bench.assets]
|
||||
build_dir = "./banking"
|
||||
|
||||
Reference in New Issue
Block a user