diff --git a/erpnext/agriculture/doctype/soil_texture/soil_texture.js b/erpnext/agriculture/doctype/soil_texture/soil_texture.js index 1cb8408795..673284b246 100644 --- a/erpnext/agriculture/doctype/soil_texture/soil_texture.js +++ b/erpnext/agriculture/doctype/soil_texture/soil_texture.js @@ -15,8 +15,8 @@ frappe.ui.form.on('Soil Texture', { }, onload: function(frm) { if (frm.doc.soil_texture_criteria == undefined) frm.call('load_contents'); - if (this.ternary_plot) return; - this.ternary_plot = new agriculture.TernaryPlot({ + if (frm.doc.ternary_plot) return; + frm.doc.ternary_plot = new agriculture.TernaryPlot({ parent: frm.get_field("ternary_plot").$wrapper, clay: frm.doc.clay_composition, sand: frm.doc.sand_composition, diff --git a/erpnext/public/js/agriculture/ternary_plot.js b/erpnext/public/js/agriculture/ternary_plot.js index 6f06585e2c..b06a1fd7c8 100644 --- a/erpnext/public/js/agriculture/ternary_plot.js +++ b/erpnext/public/js/agriculture/ternary_plot.js @@ -172,17 +172,17 @@ agriculture.TernaryPlot = class TernaryPlot { make_plot_marking() { let { triangle_side: t, spacing: s, scaling_factor: p } = this.config; - let clay = this.paper.text(t * Snap.cos(60) / 2, s + t * Snap.cos(30) / 2, "Clay").attr({ + let clay = this.paper.text(t * Snap.cos(60) / 2, s + t * Snap.cos(30) / 2, __("Clay")).attr({ fill: frappe.ui.color.get('black') }); clay.transform("r300"); - let silt = this.paper.text(t, s + t * Snap.cos(30) / 2, "Silt").attr({ + let silt = this.paper.text(t, s + t * Snap.cos(30) / 2, __("Silt")).attr({ fill: frappe.ui.color.get('black') }); silt.transform("r60"); - let sand = this.paper.text(35 + t * Snap.cos(60), 90 + t * Snap.cos(30), "Sand").attr({ + let sand = this.paper.text(35 + t * Snap.cos(60), 90 + t * Snap.cos(30), __("Sand")).attr({ fill: frappe.ui.color.get('black') }); sand.transform("r0"); @@ -229,4 +229,4 @@ agriculture.TernaryPlot = class TernaryPlot { if (typeof this.blip !== 'undefined') this.blip.remove(); } -}; \ No newline at end of file +};