Skip to content
Snippets Groups Projects
Commit c4a023ec authored by LE GAC Renaud's avatar LE GAC Renaud
Browse files

Modify to_gridfilter to deal with linkedcombobox.

parent 4200c308
No related branches found
No related tags found
No related merge requests found
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment