Hello there,
I am fairly new to Frappe/ERPNext. I am trying to deliver a html template to a doctype, but I can’t find how it is done. What I have done so far:
-
Create the html-template in the app’s public/js/templates/template_name.html
-
Add it to the build in public/build.json as
{ “mymodule/js/mymodule.min.js” : [ “public/js/templates/template_name.html”] } -
Add the reference in hooks.py : app_include_js = “/assets/mymodule/js/mymodule.min.js”
-
bench build & bench clear-cache
-
My DocType has a html field with the name chart. I edit the my_doctype.
frappe.ui.form.on(‘DocType Name’, {
refresh(frm){
frm.set_df_property(‘chart’, ‘options’, [frappe.render_template(“template_name.html”, {jinja_var: “Hello World”})]);
frm.refresh_field(‘chart’)
It is not working though… I have searched for hours but can’t get it running.
Anybody?