Skip to content

Commit

Permalink
fix(QuickEntry): Don't allow Tab Breaks (#24950) (#25468)
Browse files Browse the repository at this point in the history
(cherry picked from commit e30fdb6)

Co-authored-by: Corentin Flr <10946971+cogk@users.noreply.github.com>
  • Loading branch information
mergify[bot] and cogk committed Mar 15, 2024
1 parent 47d17f9 commit a31943e
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion frappe/public/js/frappe/form/layout.js
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,7 @@ frappe.ui.form.Layout = class Layout {
}

set_tab_as_active() {
let frm_active_tab = this?.frm.get_active_tab?.();
let frm_active_tab = this.frm?.get_active_tab?.();
if (frm_active_tab) {
frm_active_tab.set_active();
} else if (this.tabs.length) {
Expand Down
7 changes: 6 additions & 1 deletion frappe/public/js/frappe/form/quick_entry.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,12 @@ frappe.ui.form.QuickEntryForm = class QuickEntryForm {
let fields = this.meta.fields;

this.mandatory = fields.filter((df) => {
return (df.reqd || df.allow_in_quick_entry) && !df.read_only && !df.is_virtual;
return (
(df.reqd || df.allow_in_quick_entry) &&
!df.read_only &&
!df.is_virtual &&
df.fieldtype !== "Tab Break"
);
});
}

Expand Down
2 changes: 1 addition & 1 deletion frappe/public/js/frappe/form/tab.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ export default class Tab {
this.layout = layout;
this.df = df || {};
this.frm = frm;
this.doctype = this.frm.doctype;
this.doctype = this.frm?.doctype ?? this.df.parent;
this.label = this.df && this.df.label;
this.tab_link_container = tab_link_container;
this.tabs_content = tabs_content;
Expand Down

0 comments on commit a31943e

Please sign in to comment.