Browse Source

[Fix] Link formatter, Indicator not showing in the item link field for stock entry (#4966)

* [Fix] Link formatter, Indicator not showing in the item link field for stock entry

* Handle empty df
version-14
rohitwaghchaure 7 years ago
committed by Faris Ansari
parent
commit
2625cefe89
2 changed files with 9 additions and 1 deletions
  1. +8
    -0
      frappe/public/js/frappe/form/grid.js
  2. +1
    -1
      frappe/public/js/legacy/client_script_helpers.js

+ 8
- 0
frappe/public/js/frappe/form/grid.js View File

@@ -508,6 +508,14 @@ frappe.ui.form.Grid = Class.extend({
}
df.colsize = colsize;
}
// attach formatter on refresh
if (df.fieldtype == 'Link' && !df.formatter) {
const docfield = frappe.meta.docfield_map[df.parent][df.fieldname];
if (docfield && docfield.formatter) {
df.formatter = docfield.formatter;
}
}

total_colsize += df.colsize;
if(total_colsize > 11)


+ 1
- 1
frappe/public/js/legacy/client_script_helpers.js View File

@@ -433,7 +433,7 @@ _f.Frm.prototype.set_indicator_formatter = function(fieldname, get_color, get_te
})
}

frappe.meta.get_docfield(doctype, fieldname, this.doc.name).formatter =
frappe.meta.docfield_map[doctype][fieldname].formatter =
function(value, df, options, doc) {
if(value) {
return repl('<a class="indicator %(color)s" href="#Form/%(doctype)s/%(name)s">%(label)s</a>', {


Loading…
Cancel
Save