[IMP] mail:remove unnecessary code.

bzr revid: tpa@tinyerp.com-20120607072620-7rkq9m4svymcw8pv
This commit is contained in:
Turkesh Patel (Open ERP) 2012-06-07 12:56:20 +05:30
parent 19c544da37
commit ef3693a03b
5 changed files with 0 additions and 179 deletions

View File

@ -61,7 +61,6 @@ The main features are:
'mail_thread_view.xml',
'mail_group_view.xml',
'res_partner_view.xml',
'report/mail_message_report_view.xml',
'security/mail_security.xml',
'security/ir.model.access.csv',
'mail_data.xml',

View File

@ -19,7 +19,6 @@
#
##############################################################################
import mail_message_report
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -1,66 +0,0 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2009-today OpenERP SA (<http://www.openerp.com>)
#
# 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 <http://www.gnu.org/licenses/>
#
##############################################################################
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
)""")

View File

@ -1,110 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<!-- Latest Activities -->
<record model="ir.actions.act_window" id="action_latest_activities_tree">
<field name="name">Latest Activities</field>
<field name="res_model">mail.message</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
</record>
<!-- Mail message report search view -->
<record id="view_mail_message_report_filter" model="ir.ui.view">
<field name="name">mail.message.report.select</field>
<field name="model">mail.message.report</field>
<field name="type">search</field>
<field name="arch" type="xml">
<search string="Mail message Analysis">
<group>
<filter icon="terp-go-year" string=" Year "
domain="[('create_date','&lt;=', time.strftime('%%Y-%%m-%%d')),('create_date','&gt;=',time.strftime('%%Y-01-01'))]"
help="Messages created in current year"/>
<filter icon="terp-go-month" string=" Month "
name="month"
domain="[('create_date','&lt;=',(datetime.date.today()+relativedelta(day=31)).strftime('%%Y-%%m-%%d')),('create_date','&gt;=',(datetime.date.today()-relativedelta(day=1)).strftime('%%Y-%%m-%%d'))]"
help="Messages created in current month"/>
<filter icon="terp-go-month"
string=" Month-1 "
domain="[('create_date','&lt;=', (datetime.date.today() - relativedelta(day=31, months=1)).strftime('%%Y-%%m-%%d')),('create_date','&gt;=',(datetime.date.today() - relativedelta(day=1,months=1)).strftime('%%Y-%%m-%%d'))]"
help="Messages created in last month"/>
</group>
<newline/>
<group expand="1" string="Group By...">
<filter string="Model" icon="terp-go-home" context="{'group_by':'res_model'}" />
<separator orientation="vertical"/>
<filter string="Day" icon="terp-go-today"
domain="[]" context="{'group_by':'day'}"/>
<filter string="Month" icon="terp-go-month"
domain="[]" context="{'group_by':'month'}" />
<filter string="Year" icon="terp-go-year"
domain="[]" context="{'group_by':'name'}" />
</group>
</search>
</field>
</record>
<!-- Mail message report Tree view -->
<record id="view_mail_message_report_tree" model="ir.ui.view">
<field name="name">mail.message.report.tree</field>
<field name="model">mail.message.report</field>
<field name="type">tree</field>
<field name="arch" type="xml">
<tree string="Mail message Analysis">
<field name="name" invisible="1"/>
<field name="month" invisible="1"/>
<field name="day" invisible="1"/>
<field name="res_model" invisible="1"/>
<field name="nbr" />
<field name="creation_date" invisible="1"/>
</tree>
</field>
</record>
<!-- Monthly Activity per Document -->
<record id="board_mail_message_report_graph" model="ir.ui.view">
<field name="name">board.mail.message.report.graph</field>
<field name="model">mail.message.report</field>
<field name="type">graph</field>
<field name="arch" type="xml">
<graph string="Monthly Activity per Document" type="bar">
<field name="res_model"/>
<field name="nbr" operator="+"/>
</graph>
</field>
</record>
<record id="board_monthly_mail_message_report_action" model="ir.actions.act_window">
<field name="name">Monthly Activity per Document</field>
<field name="res_model">mail.message.report</field>
<field name="view_type">form</field>
<field name="view_mode">graph,tree</field>
<field name="domain">[('create_date','&gt;',(datetime.date.today()-datetime.timedelta(days=30)).strftime('%Y-%m-%d'))]</field>
<field name="context">{'group_by':['res_model'],'group_by_no_leaf':1}</field>
<field name="view_id" ref="board_mail_message_report_graph"></field>
</record>
<!-- Weekly Global Activity -->
<record id="board_weekly_mail_message_report_graph" model="ir.ui.view">
<field name="name">board.weekly.mail.message.report.graph</field>
<field name="model">mail.message.report</field>
<field name="type">graph</field>
<field name="arch" type="xml">
<graph string="Weekly Global Activity" type="bar">
<field name="day"/>
<field name="nbr" operator="+"/>
</graph>
</field>
</record>
<record id="board_weekly_mail_message_report_action" model="ir.actions.act_window">
<field name="name">Weekly Global Activity</field>
<field name="res_model">mail.message.report</field>
<field name="view_type">form</field>
<field name="view_mode">graph,tree</field>
<field name="domain">[('create_date','&gt;',(datetime.date.today()-datetime.timedelta(days=7)).strftime('%Y-%m-%d'))]</field>
<field name="context">{'group_by':['day'],'group_by_no_leaf':1}</field>
<field name="view_id" ref="board_weekly_mail_message_report_graph"></field>
</record>
</data>
</openerp>

View File

@ -5,4 +5,3 @@ access_mail_thread,mail.thread,model_mail_thread,base.group_user,1,1,1,0
access_mail_subscription,mail.subscription,model_mail_subscription,,1,1,1,1
access_mail_notification,mail.notification,model_mail_notification,,1,1,1,1
access_mail_group,mail.group,model_mail_group,base.group_user,1,1,1,1
access_mail_message_report,mail.message.report,model_mail_message_report,,1,0,0,0

1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
5 access_mail_subscription mail.subscription model_mail_subscription 1 1 1 1
6 access_mail_notification mail.notification model_mail_notification 1 1 1 1
7 access_mail_group mail.group model_mail_group base.group_user 1 1 1 1
access_mail_message_report mail.message.report model_mail_message_report 1 0 0 0