Jinja template in Terms and Conditions

This commit is contained in:
Kanchan Chauhan
2016-12-12 17:22:27 +05:30
parent 81af229466
commit b642625ed2
3 changed files with 68 additions and 9 deletions

View File

@@ -902,13 +902,17 @@ erpnext.TransactionController = erpnext.taxes_and_totals.extend({
get_terms: function() {
var me = this;
if(this.frm.doc.tc_name) {
return this.frm.call({
method: "frappe.client.get_value",
return frappe.call({
method: 'erpnext.setup.doctype.terms_and_conditions.terms_and_conditions.get_terms_and_conditions',
args: {
doctype: "Terms and Conditions",
fieldname: "terms",
filters: { name: this.frm.doc.tc_name },
template_name: this.frm.doc.tc_name,
doc: this.frm.doc
},
callback: function(r) {
if(!r.exc) {
me.frm.set_value("terms", r.message);
}
}
});
}
},