Commit 16b62acf authored by LE GAC Renaud's avatar LE GAC Renaud
Browse files

Polish the reports.

parent 7e7c13a7
......@@ -56,6 +56,9 @@ def people():
# add constraint to avoid 'stagiaire' category
selector.append_query(db.categories.usual != 'stagiaire')
# add constraint to avoid event (phd, hdr, ...)
selector.append_query(db.history.id_events == undef_id)
# define virtual field to compute time data
# to be added in the report via extra columns
tool = Person(selector)
......
......@@ -101,6 +101,8 @@
'plugin not install': 'plugin not install',
'Project': 'Projet',
'projects': 'projets',
'Quality': 'Qualité',
'Qualité': 'Qualité',
'Ratio': 'Ratio',
'Reports': 'Rapports',
'responsibilities': 'responsabilités',
......
......@@ -62,7 +62,7 @@ db.define_table("agencies",
migrate="agencies.table")
db.define_table("categories",
Field("code", "string", notnull=True, label=T("Level")),
Field("code", "string", notnull=True, label=T("Quality")),
Field("usual", "string", label=T("Category")),
Field("definition", "text"),
migrate="categories.table")
......
......@@ -2,10 +2,34 @@
""" widgets sqltable
"""
# sqltable accept lambda value, row: bla bla
# this form does not work when translating Rows into csv file ?
def repr_category(value, row):
if value == undef:
return ''
if 'history' in row and row.history.cdd_flag:
value = "%s%s" % (value, ' - CDD')
return value
repr_date = lambda date: (date.strftime('%d %b %Y') if date else '')
repr_flag = lambda flag: (CENTER('x') if flag else '')
repr_percentage = lambda val: ('' if val == None else val)
repr_undef = lambda val: ('' if val==undef else val)
#
# categories
#
db.categories.code.represent = repr_category
#
# events
#
db.events.event.represent = repr_undef
#
# hardware
#
......@@ -18,6 +42,12 @@ db.hardware.end_date.represent = repr_date
db.history.cdd_flag.represent = repr_flag
db.history.start_date.represent = repr_date
db.history.end_date.represent = repr_date
db.history.percentage.represent = repr_percentage
#
# organization
#
db.organizations.organization.represent = repr_undef
#
# people
......
......@@ -171,6 +171,9 @@ class Person(Base):
during the selected period.
"""
if not (self.period_start and self.period_end):
return ''
start = max(self.period_start, row.history.start_date)
end = self.period_end
......
......@@ -19,7 +19,6 @@
'teams.team',
'projects.project',
'categories.code',
'history.cdd_flag',
'events.event',
'history.start_date',
'history.percentage'],
......
......@@ -22,7 +22,6 @@
columns=['categories.usual',
'people.last_name',
'categories.code',
'history.cdd_flag',
'history.percentage'],
headers='labels',
extracolumns=[time_coverage, age],
......
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