diff --git a/addons/survey/__openerp__.py b/addons/survey/__openerp__.py index a8880a8e896..eaa94178791 100644 --- a/addons/survey/__openerp__.py +++ b/addons/survey/__openerp__.py @@ -36,7 +36,7 @@ sent mails with personal token for the invitation of the survey. 'summary': 'Create surveys, collect answers and print statistics', 'author': 'OpenERP SA', 'website': 'https://www.openerp.com/apps/survey/', - 'depends': ['email_template', 'mail', 'website'], + 'depends': ['email_template', 'mail', 'website', 'web_kanban_gauge'], 'data': [ 'security/survey_security.xml', 'security/ir.model.access.csv', diff --git a/addons/survey/static/src/css/survey.css b/addons/survey/static/src/css/survey.css index 361fd5493dc..8feb0c7fc9e 100644 --- a/addons/survey/static/src/css/survey.css +++ b/addons/survey/static/src/css/survey.css @@ -6,8 +6,8 @@ } .openerp .oe_kanban_survey { - width: 212px; - min-height: 86px !important; + width: 540px; + min-height: 220px !important; } .openerp .oe_kanban_survey .oe_kanban_survey_list{ width: 100%; diff --git a/addons/survey/survey.py b/addons/survey/survey.py index 177cf16bdea..a9f78d46167 100644 --- a/addons/survey/survey.py +++ b/addons/survey/survey.py @@ -56,6 +56,17 @@ class survey_survey(osv.Model): ## Function fields ## + def _get_tot_sent_survey(self, cr, uid, ids, name, arg, context=None): + """ Returns the number of invitations sent for this survey, be they + (partially) completed or not """ + res = dict((id, 0) for id in ids) + sur_res_obj = self.pool.get('survey.user_input') + for id in ids: + res[id] = sur_res_obj.search(cr, uid, # SUPERUSER_ID, + [('survey_id', '=', id), ('type', '=', 'link')], + context=context, count=True) + return res + def _get_tot_start_survey(self, cr, uid, ids, name, arg, context=None): """ Returns the number of started instances of this survey, be they completed or not """ @@ -63,7 +74,7 @@ class survey_survey(osv.Model): sur_res_obj = self.pool.get('survey.user_input') for id in ids: res[id] = sur_res_obj.search(cr, uid, # SUPERUSER_ID, - [('survey_id', '=', id), ('state', '=', 'skip')], + ['&', ('survey_id', '=', id), '|', ('state', '=', 'skip'), ('state', '=', 'done')], context=context, count=True) return res @@ -108,6 +119,8 @@ class survey_survey(osv.Model): oldname="authenticate"), 'users_can_go_back': fields.boolean('Users can go back', help="If checked, users can go back to previous pages."), + 'tot_sent_survey': fields.function(_get_tot_sent_survey, + string="Number of sent surveys", type="integer"), 'tot_start_survey': fields.function(_get_tot_start_survey, string="Number of started surveys", type="integer"), 'tot_comp_survey': fields.function(_get_tot_comp_survey, diff --git a/addons/survey/views/survey_views.xml b/addons/survey/views/survey_views.xml index 70f019af698..b1208ab0b05 100644 --- a/addons/survey/views/survey_views.xml +++ b/addons/survey/views/survey_views.xml @@ -212,18 +212,21 @@ - event.survey.kanban + survey.kanban survey.survey - - - - - - - - + + + + + + + + + + +
@@ -247,14 +250,31 @@

-

-

    -
  • Opening:
  • -
  • Closing:
  • -
-

-

started
-

completed
+
+
+ + + +
+
+
+
+ + +
+
+
+
+
+
+ Opening date:
+ Closing date: +
@@ -277,7 +297,6 @@ survey.survey form kanban,tree,form,calendar -

Click to create a new survey.

@@ -562,7 +581,7 @@ Survey User Input lines survey.user_input_line tree,form -
--> +