[MERGE] lp:~openerp-commiter/openobject-addons/trunk-review-dashboards-knowledge-rma and Report Fixes

bzr revid: jam@tinyerp.com-20120606093036-qfzmruon22usztnv
This commit is contained in:
Jigar Amin - OpenERP 2012-06-06 15:00:36 +05:30
commit 19e16ebb29
4 changed files with 19 additions and 257 deletions

View File

@ -12,6 +12,9 @@
<action string="New Files"
name="%(document.action_view_all_document_tree1)d"
view_mode="tree,form"/>
<action string="Files by Month"
name="%(document.action_view_files_by_month_graph)d"
view_mode="graph,tree"/>
</column>
<column>
<action string="File Size by Month"
@ -29,67 +32,17 @@
<field name="res_model">board.board</field>
<field name="view_type">form</field>
<field name="view_mode">form</field>
<field name="view_id" ref="board_document_manager_form"/>
</record>
<menuitem id="menu_reporting" name="Reporting" sequence="2" parent="knowledge.menu_document"/>
<menuitem
name="Knowledge"
id="menu_reports_document"
parent="base.menu_reporting_dashboard"
sequence="45"
groups="base.group_system"/>
name="Knowledge Dashboard"
id="menu_reports_document"
parent="base.menu_reporting_dashboard"
sequence="50"
action="open_board_document_manager"
icon="terp-graph"/>
<menuitem
parent="menu_reports_document"
action="open_board_document_manager"
sequence="1"
id="menu_reports_document_manager"
icon="terp-graph"/>
<record model="ir.ui.view" id="board_document_manager_form1">
<field name="name">board.document.manager.form1</field>
<field name="model">board.board</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Document board" layout="manual">
<board style="2-1">
<column>
<action string="Wall of Shame"
name="%(document.action_view_wall)d"
view_mode="tree"/>
</column>
<column>
<action string="Files by Users"
name="%(document.action_view_user_graph)d"
view_mode="graph,tree"/>
<action string="Files by Month"
name="%(document.action_view_files_by_month_graph)d"
view_mode="graph,tree"/>
</column>
</board>
</form>
</field>
</record>
<record model="ir.actions.act_window" id="open_board_document_manager1">
<field name="name">Statistics by User</field>
<field name="res_model">board.board</field>
<field name="view_type">form</field>
<field name="view_mode">form</field>
<field name="view_id" ref="board_document_manager_form1"/>
</record>
<menuitem
parent="menu_reports_document"
action="open_board_document_manager1"
sequence="1"
id="menu_reports_document_manager1"
icon="terp-graph"/>
</data>
</openerp>

View File

@ -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:

View File

@ -55,8 +55,6 @@
</field>
</record>
<!-- <menuitem name="Document Management" id="menu_action_view_my_document"/>
<menuitem name="Reporting" id="menu_action_view_my_document_report" parent="menu_action_view_my_document"/>-->
<record model="ir.actions.act_window" id="action_view_all_document_tree1">
<field name="name">All Users files</field>
@ -67,74 +65,20 @@
<field name="search_view_id" ref="view_report_document_user_search"/>
</record>
<!-- <menuitem name="All Users files" id="menu_action_view_my_document_report_all_userfile" parent="menu_action_view_my_document_report" action="action_view_all_document_tree1"/>-->
<!-- -->
<record model="ir.ui.view" id="view_document_wall_form">
<field name="name">report.document.wall.form</field>
<field name="model">report.document.wall</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Wall of Shame">
<field name="user_id" select="1"/>
<field name="month" select="1"/>
<field name="last"/>
</form>
</field>
</record>
<record model="ir.ui.view" id="view_document_wall_tree">
<field name="name">report.document.wall.tree</field>
<field name="model">report.document.wall</field>
<field name="type">tree</field>
<field name="arch" type="xml">
<tree string="Wall of Shame">
<field name="user_id" select="1"/>
<field name="month" select="1"/>
<field name="last"/>
</tree>
</field>
</record>
<record model="ir.actions.act_window" id="action_view_wall">
<field name="name">Wall of Shame</field>
<field name="res_model">report.document.wall</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
</record>
<!--<menuitem name="Wall of Shame" id="menu_action_view_my_document_report_shame" parent="menu_action_view_my_document_report" action="action_view_wall"/>-->
<!--***************************************************************************************-->
<record model="ir.ui.view" id="view_document_by_resourcetype_graph">
<field name="name">report.document.resource.graph</field>
<field name="model">report.document.user</field>
<field name="type">graph</field>
<field name="arch" type="xml">
<graph string="Files by Resource Type" type="pie">
<field name="type" />
<field name="nbr" operator="+"/>
</graph>
</field>
</record>
<!--***************************************************************************************-->
<record model="ir.ui.view" id="view_size_month">
<record model="ir.ui.view" id="view_size_month">
<field name="name">report.document.user.graph</field>
<field name="model">report.document.file</field>
<field name="type">graph</field>
<field name="arch" type="xml">
<graph string="File Size by Month" type="bar">
<graph string="File Size by Month" type="line">
<field name="month"/>
<field name="file_size" operator="+"/>
</graph>
</field>
</record>
</record>
<record model="ir.ui.view" id="view_size_month_tree">
<record model="ir.ui.view" id="view_size_month_tree">
<field name="name">report.document.user.tree</field>
<field name="model">report.document.file</field>
<field name="type">tree</field>
@ -145,6 +89,7 @@
</tree>
</field>
</record>
<record model="ir.actions.act_window" id="action_view_size_month">
<field name="name">File Size by Month</field>
<field name="res_model">report.document.file</field>
@ -153,20 +98,15 @@
<field name="view_mode">tree</field>
</record>
<!--***************************************************************************************-->
<record model="ir.ui.view" id="view_files_by_month_graph">
<record model="ir.ui.view" id="view_files_by_month_graph">
<field name="name">report.file.month.graph</field>
<field name="model">report.document.user</field>
<field name="type">graph</field>
<field name="arch" type="xml">
<graph string="Files by Month" type="bar">
<graph string="Files by Month" type="pie">
<field name="month" />
<field name="nbr" operator="+"/>
<!-- <field name="name" operator="+"/>-->
<!-- <field name="file_size" operator="+"/>-->
</graph>
</field>
</record>
@ -193,31 +133,6 @@
</record>
<!--***************************************************************************************-->
<record model="ir.ui.view" id="view_user_graph">
<field name="name">report.document.user.graph</field>
<field name="model">report.document.user</field>
<field name="type">graph</field>
<field name="arch" type="xml">
<graph string="Files by users" type="bar">
<field name="user" />
<field name="nbr" operator="+"/>
</graph>
</field>
</record>
<record model="ir.actions.act_window" id="action_view_user_graph">
<field name="name">Files By Users</field>
<field name="res_model">report.document.user</field>
<field name="view_id" ref="view_user_graph"></field>
<field name="view_type">form</field>
<field name="view_mode">tree</field>
</record>
<!--***************************************************************************************-->
<record model="ir.ui.view" id="view_files_by_partner_graph">
<field name="name">view.files.partner.graph</field>
<field name="model">report.files.partner</field>
@ -230,41 +145,5 @@
</graph>
</field>
</record>
<record model="ir.ui.view" id="view_files_by_partner_tree">
<field name="name">view.files.partner.tree</field>
<field name="model">report.files.partner</field>
<field name="type">tree</field>
<field name="arch" type="xml">
<tree string="Files per Month">
<field name="name"/>
<field name="month"/>
<field name="partner"/>
<field name="nbr"/>
</tree>
</field>
</record>
<record model="ir.ui.view" id="view_files_by_partner_form">
<field name="name">view.files.partner.form</field>
<field name="model">report.files.partner</field>
<field name="type">form</field>
<field name="arch" type="xml">
<tree string="Files per Month">
<field name="name" select="1"/>
<field name="month" select="1"/>
<field name="partner"/>
<field name="nbr"/>
</tree>
</field>
</record>
<record model="ir.actions.act_window" id="action_view_files_by_partner">
<field name="name">Files Per Partner</field>
<field name="res_model">report.files.partner</field>
<field name="view_id" ref="view_files_by_partner_graph"></field>
<field name="view_type">form</field>
<field name="view_mode">tree</field>
</record>
</data>
</openerp>
</data>
</openerp>

View File

@ -15,11 +15,6 @@ access_res_partner_group_user,res.partner user,base.model_res_partner,base.group
access_document_directory_dctx_all,document.directory.dctx all,model_document_directory_dctx,,1,0,0,0
access_document_directory_dctx_group_document_manager,document.directory.dctx document manager,model_document_directory_dctx,base.group_system,1,1,1,1
access_report_document_user_group_document_manager,report.document.user document manager,model_report_document_user,base.group_system,1,0,0,0
access_report_files_partner_group_document_manager,report.files.partner document manager,model_report_files_partner,base.group_system,1,0,0,0
access_report_document_file_group_document_manager,report.document.file document manager,model_report_document_file,base.group_system,1,0,0,0
access_report_document_wall_group_document_manager,report.document.wall document manager,model_report_document_wall,base.group_system,1,0,0,0
access_report_document_wall_group_system,report.document.wall group system,model_report_document_wall,base.group_system,1,0,0,0
access_report_files_partner_group_document,report.files.partner document manager,model_report_files_partner,base.group_document_user,1,0,0,0
access_report_document_file_group_document,report.document.file document manager,model_report_document_file,base.group_document_user,1,0,0,0
access_report_document_wall_group_document,report.document.wall document manager,model_report_document_wall,base.group_document_user,1,0,0,0
access_report_document_user_knowledgeuser,report.document.user knowledgeuser,document.model_report_document_user,base.group_document_user,1,0,0,0

1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
15 access_document_directory_dctx_all document.directory.dctx all model_document_directory_dctx 1 0 0 0
16 access_document_directory_dctx_group_document_manager document.directory.dctx document manager model_document_directory_dctx base.group_system 1 1 1 1
17 access_report_document_user_group_document_manager report.document.user document manager model_report_document_user base.group_system 1 0 0 0
access_report_files_partner_group_document_manager report.files.partner document manager model_report_files_partner base.group_system 1 0 0 0
18 access_report_document_file_group_document_manager report.document.file document manager model_report_document_file base.group_system 1 0 0 0
access_report_document_wall_group_document_manager report.document.wall document manager model_report_document_wall base.group_system 1 0 0 0
access_report_document_wall_group_system report.document.wall group system model_report_document_wall base.group_system 1 0 0 0
access_report_files_partner_group_document report.files.partner document manager model_report_files_partner base.group_document_user 1 0 0 0
19 access_report_document_file_group_document report.document.file document manager model_report_document_file base.group_document_user 1 0 0 0
access_report_document_wall_group_document report.document.wall document manager model_report_document_wall base.group_document_user 1 0 0 0
20 access_report_document_user_knowledgeuser report.document.user knowledgeuser document.model_report_document_user base.group_document_user 1 0 0 0