[minor] added get_terms methods to erpnext.utils so that it can be used in non transactional documents (#9037)
diff --git a/erpnext/public/js/utils.js b/erpnext/public/js/utils.js
index 3a2254e..d618fbe 100644
--- a/erpnext/public/js/utils.js
+++ b/erpnext/public/js/utils.js
@@ -104,6 +104,21 @@
}
}
refresh_field(table_fieldname);
+ },
+
+ get_terms: function(tc_name, doc, callback) {
+ if(tc_name) {
+ return frappe.call({
+ method: 'erpnext.setup.doctype.terms_and_conditions.terms_and_conditions.get_terms_and_conditions',
+ args: {
+ template_name: tc_name,
+ doc: doc
+ },
+ callback: function(r) {
+ callback(r)
+ }
+ });
+ }
}
});