Skip to content

Commit

Permalink
fix: fallback to unscrubbed table fieldname if label not found (#21826)
Browse files Browse the repository at this point in the history
* fix: fallback to table fieldname if label not found

* chore: remove whitespaces

Co-authored-by: Ankush Menat <ankushmenat@gmail.com>

* chore: removes whitespaces

Co-authored-by: Ankush Menat <ankushmenat@gmail.com>

---------

Co-authored-by: Ankush Menat <ankushmenat@gmail.com>
  • Loading branch information
jll-02 and ankush committed Jul 27, 2023
1 parent b85080a commit a8091bb
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion frappe/public/js/frappe/form/save.js
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,10 @@ frappe.ui.form.save = function (frm, action, callback, btn) {
if (error_fields.length) {
let meta = frappe.get_meta(doc.doctype);
if (meta.istable) {
const table_label = __(frappe.meta.docfield_map[doc.parenttype][doc.parentfield].label).bold();
const table_field = frappe.meta.docfield_map[doc.parenttype][doc.parentfield];
const table_label = __(
table_field.label || frappe.unscrub(table_field.fieldname)
).bold();
var message = __('Mandatory fields required in table {0}, Row {1}', [table_label, doc.idx]);
} else {
var message = __('Mandatory fields required in {0}', [__(doc.doctype)]);
Expand Down

0 comments on commit a8091bb

Please sign in to comment.