diff --git a/addons/board/board.py b/addons/board/board.py index af1434835d5..6c28aa33c40 100644 --- a/addons/board/board.py +++ b/addons/board/board.py @@ -186,46 +186,4 @@ class board_line(osv.osv): 'position': lambda *args: 'left' } -#class res_log_report(osv.osv): - # CSV:: access_res_log_report all,res.log.report,model_res_log_report,,1,0,0,0 - #""" 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) - #} - - #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_data_admin.xml b/addons/board/board_data_admin.xml index e56bcbc174a..5f8c2f1b05c 100644 --- a/addons/board/board_data_admin.xml +++ b/addons/board/board_data_admin.xml @@ -1,6 +1,7 @@ - + + user.connection.tree @@ -21,125 +22,11 @@ - - - - - - - - - Configuration Overview board.config.overview - - - - - - board.administration.form board.board @@ -174,5 +61,5 @@ - + diff --git a/addons/mail/__init__.py b/addons/mail/__init__.py index 2474c321946..d9835f86fc5 100644 --- a/addons/mail/__init__.py +++ b/addons/mail/__init__.py @@ -25,6 +25,7 @@ import mail_group import mail_subscription import res_users import res_partner +import report import wizard # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/mail/__openerp__.py b/addons/mail/__openerp__.py index 380134e2735..f2b7b0a0c9c 100644 --- a/addons/mail/__openerp__.py +++ b/addons/mail/__openerp__.py @@ -56,16 +56,17 @@ The main features are: 'website': 'http://www.openerp.com', 'depends': ['base', 'base_tools'], 'data': [ - "wizard/mail_compose_message_view.xml", - "mail_message_view.xml", - "mail_subscription_view.xml", - "mail_thread_view.xml", - "mail_group_view.xml", - "res_partner_view.xml", + 'wizard/mail_compose_message_view.xml', + 'mail_message_view.xml', + 'mail_subscription_view.xml', + 'mail_thread_view.xml', + 'mail_group_view.xml', + 'res_partner_view.xml', 'security/mail_security.xml', 'security/ir.model.access.csv', 'mail_data.xml', 'res_users_view.xml', + 'report/mail_message_report_view.xml', ], 'installable': True, 'auto_install': False, diff --git a/addons/mail/report/__init__.py b/addons/mail/report/__init__.py new file mode 100644 index 00000000000..7ec4e7cd2c2 --- /dev/null +++ b/addons/mail/report/__init__.py @@ -0,0 +1,25 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Management Solution +# Copyright (C) 2009-Today OpenERP SA (). +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +############################################################################## + +import mail_message_report + +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: + diff --git a/addons/mail/report/mail_message_report.py b/addons/mail/report/mail_message_report.py new file mode 100644 index 00000000000..7955ea87909 --- /dev/null +++ b/addons/mail/report/mail_message_report.py @@ -0,0 +1,66 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Management Solution +# Copyright (C) 2009-today OpenERP SA () +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see +# +############################################################################## + +from osv import fields, osv +import time +import tools + +class mail_message_report(osv.osv): + #CSV:: access_res_log_report all,res.log.report,model_res_log_report,,1,0,0,0 + """ Log Report """ + _name = "mail.message.report" + _auto = False + _description = "Mail Message 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) + } + + def init(self, cr): + """ + Log Report + @param cr: the current row, from the database cursor + """ + tools.drop_view_if_exists(cr,'mail_message_report') + cr.execute(""" + CREATE OR REPLACE VIEW mail_message_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.model as res_model, + date_trunc('day',l.create_date) as create_date + FROM + mail_message l + )""") + diff --git a/addons/mail/report/mail_message_report_view.xml b/addons/mail/report/mail_message_report_view.xml new file mode 100644 index 00000000000..ecb26b78d1d --- /dev/null +++ b/addons/mail/report/mail_message_report_view.xml @@ -0,0 +1,110 @@ + + + + + + + Latest Activities + mail.message + form + tree,form + + + + + mail.message.report.select + mail.message.report + search + + + + + + + + + + + + + + + + + + + + + + mail.message.report.tree + mail.message.report + tree + + + + + + + + + + + + + + + board.mail.message.report.graph + mail.message.report + graph + + + + + + + + + Monthly Activity per Document + mail.message.report + form + graph,tree + [('create_date','>',(datetime.date.today()-datetime.timedelta(days=30)).strftime('%Y-%m-%d'))] + {'group_by':['res_model'],'group_by_no_leaf':1} + + + + + + board.weekly.mail.message.report.graph + mail.message.report + graph + + + + + + + + + Weekly Global Activity + mail.message.report + form + graph,tree + [('create_date','>',(datetime.date.today()-datetime.timedelta(days=7)).strftime('%Y-%m-%d'))] + {'group_by':['day'],'group_by_no_leaf':1} + + + + +