Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
tev
plugin_event
Commits
5bac85ef
Commit
5bac85ef
authored
Mar 24, 2017
by
LE GAC Renaud
Browse files
Update callbacks to fix a bug in ON_CREATE_LISTS2.
parent
5341ae8b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
3 deletions
+8
-3
modules/plugin_event/callbacks.py
modules/plugin_event/callbacks.py
+8
-3
No files found.
modules/plugin_event/callbacks.py
View file @
5bac85ef
...
...
@@ -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
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment