fix: add Tab Break to no value fields

This commit is contained in:
prssanna 2021-05-08 18:00:30 +05:30
parent 022f7e1c06
commit ea3ca571ad
6 changed files with 10 additions and 8 deletions

View file

@ -35,7 +35,7 @@ class PropertySetter(Document):
fields=['fieldname', 'label', 'fieldtype'],
filters={
'parent': dt,
'fieldtype': ['not in', ('Section Break', 'Column Break', 'HTML', 'Read Only', 'Fold') + frappe.model.table_fields],
'fieldtype': ['not in', ('Section Break', 'Column Break', 'Tab Break', 'HTML', 'Read Only', 'Fold') + frappe.model.table_fields],
'fieldname': ['!=', '']
},
order_by='label asc',

View file

@ -41,6 +41,7 @@ data_fieldtypes = (
no_value_fields = (
'Section Break',
'Column Break',
'Tab Break',
'HTML',
'Table',
'Table MultiSelect',
@ -53,6 +54,7 @@ no_value_fields = (
display_fieldtypes = (
'Section Break',
'Column Break',
'Tab Break',
'HTML',
'Button',
'Image',

View file

@ -261,7 +261,7 @@ frappe.PrintFormatBuilder = class PrintFormatBuilder {
} else if(f.fieldtype==="Column Break") {
set_column();
} else if(!in_list(["Section Break", "Column Break", "Fold"], f.fieldtype)
} else if(!in_list(["Section Break", "Column Break", "Tab Break", "Fold"], f.fieldtype)
&& f.label) {
if(!column) set_column();
@ -298,7 +298,7 @@ frappe.PrintFormatBuilder = class PrintFormatBuilder {
init_visible_columns(f) {
f.visible_columns = []
$.each(frappe.get_meta(f.options).fields, function(i, _f) {
if(!in_list(["Section Break", "Column Break"], _f.fieldtype) &&
if(!in_list(["Section Break", "Column Break", "Tab Break"], _f.fieldtype) &&
!_f.print_hide && f.label) {
// column names set as fieldname|width
@ -606,7 +606,7 @@ frappe.PrintFormatBuilder = class PrintFormatBuilder {
// add remaining fields
$.each(doc_fields, function(j, f) {
if (f && !in_list(column_names, f.fieldname)
&& !in_list(["Section Break", "Column Break"], f.fieldtype) && f.label) {
&& !in_list(["Section Break", "Column Break", "Tab Break"], f.fieldtype) && f.label) {
fields.push(f);
}
})

View file

@ -4,7 +4,7 @@
</div>
<div class="print-format-builder-sidebar-fields">
{% for (var i=0, l=fields.length; i < l; i++) { var f = fields[i]; %}
{% if(!in_list(["Section Break", "Column Break", "Fold"], f.fieldtype)) { %}
{% if(!in_list(["Section Break", "Tab Break", "Column Break", "Fold"], f.fieldtype)) { %}
<div class="print-format-builder-field-placeholder"
data-fieldname="{%= f.fieldname %}">
<div title="{{f.label}}" class="field-label btn btn-default btn-sm sidebar-field ellipsis

View file

@ -545,7 +545,7 @@ frappe.ui.form.Toolbar = class Toolbar {
show_jump_to_field_dialog() {
let visible_fields_filter = f =>
!['Section Break', 'Column Break'].includes(f.df.fieldtype)
!['Section Break', 'Column Break', 'Tab Break'].includes(f.df.fieldtype)
&& !f.df.hidden
&& f.disp_status !== 'None';

View file

@ -4,10 +4,10 @@
frappe.provide('frappe.model');
$.extend(frappe.model, {
no_value_type: ['Section Break', 'Column Break', 'HTML', 'Table', 'Table MultiSelect',
no_value_type: ['Section Break', 'Column Break', 'Tab Break', 'HTML', 'Table', 'Table MultiSelect',
'Button', 'Image', 'Fold', 'Heading'],
layout_fields: ['Section Break', 'Column Break', 'Fold'],
layout_fields: ['Section Break', 'Column Break', 'Tab Break', 'Fold'],
std_fields_list: ['name', 'owner', 'creation', 'modified', 'modified_by',
'_user_tags', '_comments', '_assign', '_liked_by', 'docstatus',