diff --git a/modules/plugin_dbui/converter.py b/modules/plugin_dbui/converter.py index 4e1ca50e17f3da5f690a585393986ba45a0b6d2b..9ed655085305782bd634db076a6b3c5234319322 100644 --- a/modules/plugin_dbui/converter.py +++ b/modules/plugin_dbui/converter.py @@ -424,8 +424,13 @@ def to_gridFilter(table, **kwargs): # ignore composite field defined for form cfg = to_field(field, composite=False) - # remove default value - # make no sense in this context + # remove field constraints making no sense for a filter + if 'allowBlank' in cfg: + cfg["allowBlank"] = True + + if 'readOnly' in cfg: + cfg['readOnly'] = False + if 'value' in cfg: del cfg['value'] @@ -433,6 +438,10 @@ def to_gridFilter(table, **kwargs): if cfg['xtype'] == 'xtextarea': cfg['xtype'] = 'xtextfield' + # replace all linkedcombobox by combobox + if cfg['xtype'] == 'xlinkedcombobox': + cfg['xtype'] = 'xcombobox' + # empty text for combobox if cfg['xtype'] == 'xcombobox': cfg['emptyText']= T('select...') @@ -440,7 +449,7 @@ def to_gridFilter(table, **kwargs): # prepare the name for the where close [table.field] cfg['name'] = name - # store information to customize the filter + # store information to customise the filter cfg['filterComment'] = comment cfg['filterOperator'] = operator cfg['filterType'] = field.type