summaryrefslogtreecommitdiff
path: root/addons/document/report/document_report.py
diff options
context:
space:
mode:
authorPurnendu Singh (OpenERP) <psi@tinyerp.com>2012-06-22 11:22:30 +0530
committerPurnendu Singh (OpenERP) <psi@tinyerp.com>2012-06-22 11:22:30 +0530
commit1c35eb1049da4e5c4e4e1e9c50be018405806c08 (patch)
treea2230a93b6c7126df352d87bbaff801970dca468 /addons/document/report/document_report.py
parent4dbe82473921a2335dce292f9b70ef2a8bab3858 (diff)
parenteea8d596041e8f6ca3fd1d31ef3a5c5d4ae6e91d (diff)
[MERGE] Mearge with main addons
bzr revid: psi@tinyerp.com-20120622055230-trqmxu7r1qtxa0ut
Diffstat (limited to 'addons/document/report/document_report.py')
-rw-r--r--addons/document/report/document_report.py65
1 files changed, 0 insertions, 65 deletions
diff --git a/addons/document/report/document_report.py b/addons/document/report/document_report.py
index 34b61f01c01..7b09f131178 100644
--- a/addons/document/report/document_report.py
+++ b/addons/document/report/document_report.py
@@ -64,41 +64,8 @@ class report_document_user(osv.osv):
group by to_char(f.create_date, 'YYYY'), to_char(f.create_date, 'MM'),d.name,f.parent_id,d.type,f.create_date,f.user_id,f.file_size,u.name,d.type,f.write_date,f.datas_fname
)
""")
-report_document_user()
-
-class report_files_partner(osv.osv):
- _name = "report.files.partner"
- _description = "Files details by Partners"
- _auto = False
- _columns = {
- 'name': fields.char('Year',size=64,required=False, readonly=True),
- 'file_size': fields.integer('File Size', readonly=True),
- 'nbr':fields.integer('# of Files', readonly=True),
- 'partner':fields.char('Partner',size=64,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),
- }
- def init(self, cr):
- tools.drop_view_if_exists(cr, 'report_files_partner')
- cr.execute("""
- CREATE VIEW report_files_partner as (
- SELECT min(f.id) AS id,
- COUNT(*) AS nbr,
- to_char(date_trunc('month', f.create_date),'YYYY') AS name,
- to_char(date_trunc('month', f.create_date),'MM') AS month,
- SUM(f.file_size) AS file_size,
- p.name AS partner
-
- FROM ir_attachment f
- LEFT JOIN res_partner p ON (f.partner_id=p.id)
- WHERE f.datas_fname IS NOT NULL
- GROUP BY p.name, date_trunc('month', f.create_date)
- )
- """)
-report_files_partner()
-
class report_document_file(osv.osv):
_name = "report.document.file"
_description = "Files details by Directory"
@@ -122,37 +89,5 @@ class report_document_file(osv.osv):
)
""")
-report_document_file()
-
-class report_document_wall(osv.osv):
- _name = "report.document.wall"
- _description = "Users that did not inserted documents since one month"
- _auto = False
- _columns = {
- 'name': fields.date('Month', readonly=True),
- 'user_id':fields.many2one('res.users', 'Owner',readonly=True),
- 'user':fields.char('User',size=64,readonly=True),
- 'month': fields.char('Month', size=24,readonly=True),
- 'last':fields.datetime('Last Posted Time', readonly=True),
- }
-
- def init(self, cr):
- tools.drop_view_if_exists(cr, 'report_document_wall')
- cr.execute("""
- create or replace view report_document_wall as (
- select max(f.id) as id,
- to_char(min(f.create_date),'YYYY-MM-DD HH24:MI:SS') as last,
- f.user_id as user_id, f.user_id as user,
- to_char(f.create_date,'Month') as month
- from ir_attachment f
- where f.create_date in (
- select max(i.create_date)
- from ir_attachment i
- inner join res_users u on (i.user_id=u.id)
- group by i.user_id) group by f.user_id,f.create_date
- having (CURRENT_DATE - to_date(to_char(f.create_date,'YYYY-MM-DD'),'YYYY-MM-DD')) > 30
- )
- """)
-report_document_wall()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: