From 148d430de8ff714d85a4c9f55c021f7b43f0efd2 Mon Sep 17 00:00:00 2001 From: rch Date: Wed, 17 Nov 2010 17:27:05 +0530 Subject: [PATCH] [IMP]: Administration Dashboard. bzr revid: rch@rch-desktop-20101117115705-gmvjeqzs8szqbt9g --- addons/board/board.py | 46 ++++- addons/board/board_administration_view.xml | 203 ++++++++++----------- 2 files changed, 141 insertions(+), 108 deletions(-) diff --git a/addons/board/board.py b/addons/board/board.py index 9cc660181ab..9677c8aaa17 100644 --- a/addons/board/board.py +++ b/addons/board/board.py @@ -21,6 +21,7 @@ from osv import fields, osv import time +import tools class board_board(osv.osv): """ @@ -223,12 +224,45 @@ class board_note(osv.osv): board_note() -class temp_log(osv.osv_memory): - _inherit = 'res.log' - _description = 'Temporary Log' - _columns = {'count': fields.integer("Count")} - _defaults = {'count': lambda *a: True} +class res_log_report(osv.osv): + """ Log Report """ + _name = "res.log.report" + _auto = False + _description = "Log Report" + _columns = { + 'name': fields.char('Year', size=64, required=False, readonly=True), + 'month':fields.selection([('01', 'January'), ('02', 'February'), \ + ('03', 'March'), ('04', 'April'),\ + ('05', 'May'), ('06', 'June'), \ + ('07', 'July'), ('08', 'August'),\ + ('09', 'September'), ('10', 'October'),\ + ('11', 'November'), ('12', 'December')], 'Month', readonly=True), + 'day': fields.char('Day', size=128, readonly=True), + 'creation_date': fields.date('Creation Date', readonly=True), + 'res_model': fields.char('Object', size=128), + 'nbr': fields.integer('# of Entries', readonly=True) + } -temp_log() + def init(self, cr): + """ + Log Report + @param cr: the current row, from the database cursor + """ + tools.drop_view_if_exists(cr,'res_log_report') + cr.execute(""" + CREATE OR REPLACE VIEW res_log_report AS ( + SELECT + l.id as id, + 1 as nbr, + to_char(l.create_date, 'YYYY') as name, + to_char(l.create_date, 'MM') as month, + to_char(l.create_date, 'YYYY-MM-DD') as day, + to_char(l.create_date, 'YYYY-MM-DD') as creation_date, + l.res_model as res_model, + date_trunc('day',l.create_date) as create_date + FROM + res_log l + )""") +res_log_report() # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/board/board_administration_view.xml b/addons/board/board_administration_view.xml index 9c30e02ca9c..154669309d6 100644 --- a/addons/board/board_administration_view.xml +++ b/addons/board/board_administration_view.xml @@ -1,6 +1,7 @@ + user.connection.tree @@ -28,6 +29,98 @@ form tree,form + + + + res.log.report.select + res.log.report + search + + + + + + + + + + + + + + + + + + + + + + + + + res.log.report.tree + res.log.report + tree + + + + + + + + + + + + + + + board.res.log.report.graph + res.log.report + graph + + + + + + + + + Monthly Activity per Document + res.log.report + form + graph,tree + {'group_by':['res_model'],'group_by_no_leaf':1} + + + + + + board.weekly.res.log.report.graph + res.log.report + graph + + + + + + + + + Weekly Global Activity + res.log.report + form + graph,tree + {'group_by':['day'],'group_by_no_leaf':1} + + + board.administration.form board.board @@ -39,10 +132,15 @@ + + + + + Administration Dashboard board.board @@ -50,111 +148,12 @@ form + - - + + - - - board.res.log.graph - res.log - graph - - - - - - - - - board.res.log.tree - res.log - tree - - - - - - - - - Monthly Activity per Document - res.log - form - graph,tree - - - - - tree - - - - - - graph - - - - - - - board.weekly.res.log.graph - res.log - graph - - - - - - - - - board.weekly.res.log.tree - res.log - tree - - - - - - - - - Weekly Global Activity - res.log - form - graph,tree - - - - - tree - - - - - - graph - - - - - - board.admin.graphs.form - board.board - form - - - - - - - - - -