Commit 5bac85ef authored by LE GAC Renaud's avatar LE GAC Renaud
Browse files

Update callbacks to fix a bug in ON_CREATE_LISTS2.

parent 5341ae8b
......@@ -18,6 +18,7 @@ MSG_INHIBIT_DELETE = \
MSG_NO_DATA = \
"Can not fill the field 'columns' since there is no available data in %i"
def INHIBIT_CASCADE_DELETE(myset):
"""Inhibit the delete.
......@@ -83,14 +84,18 @@ def ON_CREATE_LISTS2(values):
# try to instantiate the DataFrame with a minimal set of criteria
year = current.request.now.year
criteria = dict(year_start=year, id_events=values["id_events"])
criteria = dict(
id_events=values["id_events"],
year_start=year,
year_end=year)
func = PluginManager("event").event.sources[values["source"]].func
df = func(**criteria)
if df.empty:
field._table[CALLBACK_ERRORS] = current.T(MSG_NO_DATA % year)
return True
return False
# generate the configuration for Ext.grid.column.Column
lst = to_extjs_gridcolumns(df)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment