From c9be1c2271f987177a41fb9ec2d16c6ed79a8584 Mon Sep 17 00:00:00 2001 From: apa-tiny Date: Wed, 10 Mar 2010 12:57:42 +0530 Subject: [PATCH 01/42] [IMP]:Improved SQL purchase report. bzr revid: apa@tinyerp.com-20100310072742-28lym17cjluthmf6 --- addons/purchase/__terp__.py | 3 +- addons/purchase/report/__init__.py | 5 +- .../report/purchase_report.py} | 78 +++----- .../purchase/report/purchase_report_view.xml | 103 +++++++++++ .../report_purchase/report_purchase_view.xml | 171 ------------------ 5 files changed, 129 insertions(+), 231 deletions(-) rename addons/{report_purchase/report_purchase.py => purchase/report/purchase_report.py} (56%) create mode 100644 addons/purchase/report/purchase_report_view.xml delete mode 100644 addons/report_purchase/report_purchase_view.xml diff --git a/addons/purchase/__terp__.py b/addons/purchase/__terp__.py index 7c5aa05f640..ed338d3eaf7 100644 --- a/addons/purchase/__terp__.py +++ b/addons/purchase/__terp__.py @@ -41,7 +41,8 @@ 'purchase_wizard.xml', 'stock_view.xml', 'partner_view.xml', - 'process/purchase_process.xml' + 'process/purchase_process.xml', + 'report/purchase_report_view.xml', ], 'demo_xml': ['purchase_demo.xml'], 'installable': True, diff --git a/addons/purchase/report/__init__.py b/addons/purchase/report/__init__.py index c4cc8211bd9..65d4fb0bc65 100644 --- a/addons/purchase/report/__init__.py +++ b/addons/purchase/report/__init__.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- ############################################################################## -# +# # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (). # @@ -15,12 +15,13 @@ # 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 . +# along with this program. If not, see . # ############################################################################## import order import request_quotation +import purchase_report # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/report_purchase/report_purchase.py b/addons/purchase/report/purchase_report.py similarity index 56% rename from addons/report_purchase/report_purchase.py rename to addons/purchase/report/purchase_report.py index caf482fe14e..56a6b65b1b3 100644 --- a/addons/report_purchase/report_purchase.py +++ b/addons/purchase/report/purchase_report.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- ############################################################################## -# +# # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (). # @@ -15,7 +15,7 @@ # 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 . +# along with this program. If not, see . # ############################################################################## @@ -26,11 +26,12 @@ from osv import fields,osv import tools -class report_purchase_order_product(osv.osv): - _name = "report.purchase.order.product" - _description = "Purchases Orders by Products" +class report_purchase_order(osv.osv): + _name = "report.purchase.order" + _description = "Purchases Orders" _auto = False _columns = { + 'date': fields.date('Date', readonly=True), 'name': fields.char('Year',size=64,required=False, readonly=True), 'state': fields.selection([ ('draft','Quotation'), @@ -43,6 +44,10 @@ class report_purchase_order_product(osv.osv): ('cancel','Cancel') ], 'Order State', readonly=True), 'product_id':fields.many2one('product.product', 'Product', readonly=True), + 'category_id': fields.many2one('product.category', 'Categories', readonly=True), + 'partner_id':fields.many2one('res.partner', 'Partner', readonly=True), + 'company_id':fields.many2one('res.company', 'Company', readonly=True), + 'user_id':fields.many2one('res.users', 'Responsible', readonly=True), 'quantity': fields.float('# of Products', readonly=True), 'price_total': fields.float('Total Price', readonly=True), 'price_average': fields.float('Average Price', readonly=True), @@ -53,62 +58,19 @@ class report_purchase_order_product(osv.osv): } _order = 'name desc,price_total desc' def init(self, cr): - tools.sql.drop_view_if_exists(cr, 'report_purchase_order_product') + tools.sql.drop_view_if_exists(cr, 'report_purchase_order') cr.execute(""" - create or replace view report_purchase_order_product as ( + create or replace view report_purchase_order as ( select min(l.id) as id, + s.date_order as date, to_char(s.date_order, 'YYYY') as name, to_char(s.date_order, 'MM') as month, s.state, + s.partner_id as partner_id, + s.create_uid as user_id, + s.company_id as company_id, l.product_id, - sum(l.product_qty*u.factor) as quantity, - count(*), - sum(l.product_qty*l.price_unit) as price_total, - (sum(l.product_qty*l.price_unit)/sum(l.product_qty*u.factor))::decimal(16,2) as price_average - from purchase_order s - left join purchase_order_line l on (s.id=l.order_id) - left join product_uom u on (u.id=l.product_uom) - where l.product_id is not null - group by l.product_id, to_char(s.date_order, 'YYYY'),to_char(s.date_order, 'MM'),s.state - ) - """) -report_purchase_order_product() - -class report_purchase_order_category(osv.osv): - _name = "report.purchase.order.category" - _description = "Purchases Orders by Categories" - _auto = False - _columns = { - 'name': fields.char('Year',size=64,required=False, readonly=True), - 'state': fields.selection([ - ('draft','Quotation'), - ('waiting_date','Waiting Schedule'), - ('manual','Manual in progress'), - ('progress','In progress'), - ('shipping_except','Shipping Exception'), - ('invoice_except','Invoice Exception'), - ('done','Done'), - ('cancel','Cancel') - ], 'Order State', readonly=True), - 'category_id': fields.many2one('product.category', 'Categories', readonly=True), - 'quantity': fields.float('# of Products', readonly=True), - 'price_total': fields.float('Total Price', readonly=True), - 'price_average': fields.float('Average Price', readonly=True), - 'count': fields.integer('# of Lines', 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), - } - _order = 'name desc,price_total desc' - def init(self, cr): - tools.sql.drop_view_if_exists(cr, 'report_purchase_order_category') - cr.execute(""" - create or replace view report_purchase_order_category as ( - select - min(l.id) as id, - to_char(s.date_order, 'YYYY') as name, - to_char(s.date_order, 'MM') as month, - s.state, t.categ_id as category_id, sum(l.product_qty*u.factor) as quantity, count(*), @@ -120,10 +82,12 @@ class report_purchase_order_category(osv.osv): left join product_template t on (t.id=p.product_tmpl_id) left join product_uom u on (u.id=l.product_uom) where l.product_id is not null - group by t.categ_id, to_char(s.date_order, 'YYYY'),to_char(s.date_order, 'MM'),s.state - ) + group by s.company_id,s.create_uid,s.partner_id, + t.categ_id,l.product_id,s.date_order, + to_char(s.date_order, 'YYYY'),to_char(s.date_order, 'MM'),s.state + ) """) -report_purchase_order_category() +report_purchase_order() # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/purchase/report/purchase_report_view.xml b/addons/purchase/report/purchase_report_view.xml new file mode 100644 index 00000000000..3ce17f3ac9a --- /dev/null +++ b/addons/purchase/report/purchase_report_view.xml @@ -0,0 +1,103 @@ + + + + + product.month.graph + report.purchase.order + graph + + + + + + + + + + + report.purchase.order.tree + report.purchase.order + tree + + + + + + + + + + + + + + + + + + + + + report.purchase.order.search + report.purchase.order + search + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Purchase Orders + report.purchase.order + form + tree,graph + + + + + + + + diff --git a/addons/report_purchase/report_purchase_view.xml b/addons/report_purchase/report_purchase_view.xml deleted file mode 100644 index e2559b2c539..00000000000 --- a/addons/report_purchase/report_purchase_view.xml +++ /dev/null @@ -1,171 +0,0 @@ - - - - - - - report.purchase.order.product.form - report.purchase.order.product - form - -
- - - - - - - - - - -
- - - product.month.graph - report.purchase.order.product - graph - - - - - - - - - - - report.purchase.order.product.tree - report.purchase.order.product - tree - - - - - - - - - - - - - - - - report.purchase.order.product.search - report.purchase.order.product - search - - - - - - - - - - - - - - - - - Purchases by Products - report.purchase.order.product - form - tree,graph - - - - - - - - - - report.purchase.order.category.form - report.purchase.order.category - form - -
- - - - - - - - - - -
- - - product.category.graph - report.purchase.order.category - graph - - - - - - - - - - - report.purchase.order.category.tree - report.purchase.order.category - tree - - - - - - - - - - - - - - - - report.purchase.order.category.search - report.purchase.order.category - search - - - - - - - - - - - - - - - - - Purchases by Category of Products - report.purchase.order.category - form - tree,graph - - - - - - - - -
-
From ddd44fd833de3649d49a8b62c6c8712f5c5053a2 Mon Sep 17 00:00:00 2001 From: apa-tiny Date: Wed, 10 Mar 2010 13:41:37 +0530 Subject: [PATCH 02/42] [IMP]:add access rule for SQL purchase report. bzr revid: apa@tinyerp.com-20100310081137-a9lg40529nbuh53i --- addons/purchase/security/ir.model.access.csv | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/addons/purchase/security/ir.model.access.csv b/addons/purchase/security/ir.model.access.csv index 5fb968e6ce1..e1eb2cdf199 100644 --- a/addons/purchase/security/ir.model.access.csv +++ b/addons/purchase/security/ir.model.access.csv @@ -7,4 +7,5 @@ "access_stock_move_purchase_user","stock.move purchase_user","stock.model_stock_move","purchase.group_purchase_user",1,1,1,1 "access_purchase_order_stock_worker","purchase.order stock_worker","model_purchase_order","stock.group_stock_user",1,0,0,0 "access_purchase_order_line_stock_worker","purchase.order.line stock_worker","model_purchase_order_line","stock.group_stock_user",1,0,0,0 -"access_account_tax_purchase_user","account.tax purchase_user","account.model_account_tax","purchase.group_purchase_user",1,0,0,0 \ No newline at end of file +"access_account_tax_purchase_user","account.tax purchase_user","account.model_account_tax","purchase.group_purchase_user",1,0,0,0 +"access_report_purchase_order","report.purchase.order","model_report_purchase_order","purchase.group_purchase_manager",1,0,0,0 From 604aecff51f56da738f260f776740846480f3ec7 Mon Sep 17 00:00:00 2001 From: apa-tiny Date: Wed, 10 Mar 2010 13:48:07 +0530 Subject: [PATCH 03/42] [REM]:Removed files from report_purchase module. bzr revid: apa@tinyerp.com-20100310081807-zbq7jfzutihoqkyq --- addons/report_purchase/__init__.py | 25 ------------ addons/report_purchase/__terp__.py | 39 ------------------- .../security/ir.model.access.csv | 3 -- 3 files changed, 67 deletions(-) delete mode 100644 addons/report_purchase/__init__.py delete mode 100644 addons/report_purchase/__terp__.py delete mode 100644 addons/report_purchase/security/ir.model.access.csv diff --git a/addons/report_purchase/__init__.py b/addons/report_purchase/__init__.py deleted file mode 100644 index 83e17dc65d0..00000000000 --- a/addons/report_purchase/__init__.py +++ /dev/null @@ -1,25 +0,0 @@ -# -*- coding: utf-8 -*- -############################################################################## -# -# OpenERP, Open Source Management Solution -# Copyright (C) 2004-2010 Tiny SPRL (). -# -# 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 report_purchase - -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: - diff --git a/addons/report_purchase/__terp__.py b/addons/report_purchase/__terp__.py deleted file mode 100644 index 279ff24ca8e..00000000000 --- a/addons/report_purchase/__terp__.py +++ /dev/null @@ -1,39 +0,0 @@ -# -*- coding: utf-8 -*- -############################################################################## -# -# OpenERP, Open Source Management Solution -# Copyright (C) 2004-2010 Tiny SPRL (). -# -# 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 . -# -############################################################################## - - -{ - 'name': 'Purchase Management - Reporting', - 'version': '1.0', - 'category': 'Generic Modules/Sales & Purchases', - 'description': """Module to add views like - Purchase By Product, Purchase By Category of Product, All Months, Current Month.""", - 'author': 'Tiny', - 'website': 'http://www.openerp.com', - 'depends': ['purchase'], - 'init_xml': [], - 'update_xml': ['security/ir.model.access.csv', 'report_purchase_view.xml'], - 'demo_xml': [], - 'installable': True, - 'active': False, - 'certificate': '0073370750365', -} -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/report_purchase/security/ir.model.access.csv b/addons/report_purchase/security/ir.model.access.csv deleted file mode 100644 index ee05ec94cd5..00000000000 --- a/addons/report_purchase/security/ir.model.access.csv +++ /dev/null @@ -1,3 +0,0 @@ -id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink -access_report_purchase_order_product,report.purchase.order.product,model_report_purchase_order_product,purchase.group_purchase_manager,1,0,0,0 -access_report_purchase_order_category,report.purchase.order.category,model_report_purchase_order_category,purchase.group_purchase_manager,1,0,0,0 From 17c99c4ea6f65b72d61a332935ed1a964ed6d1b7 Mon Sep 17 00:00:00 2001 From: apa-tiny Date: Wed, 10 Mar 2010 15:00:35 +0530 Subject: [PATCH 04/42] [IMP]:Improved code of SQL purchase report. bzr revid: apa@tinyerp.com-20100310093035-td4stvgo9hvdkt7o --- addons/purchase/report/purchase_report_view.xml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/addons/purchase/report/purchase_report_view.xml b/addons/purchase/report/purchase_report_view.xml index 3ce17f3ac9a..f9f7f753db9 100644 --- a/addons/purchase/report/purchase_report_view.xml +++ b/addons/purchase/report/purchase_report_view.xml @@ -47,25 +47,25 @@ string="This Year" domain="[('name','=',time.strftime('%%Y'))]" default="1" - help="Sales orders of the year"/> + help="Purchase orders of the year"/> + help="Purchase orders of this month"/> From 3e82cf8a526957a663f45aa6d54317a4b27e9571 Mon Sep 17 00:00:00 2001 From: apa-tiny Date: Wed, 10 Mar 2010 15:03:23 +0530 Subject: [PATCH 05/42] [IMP]:Improved code of SQL purchase report. bzr revid: apa@tinyerp.com-20100310093323-fed6vdjm3y5mz0ch --- addons/purchase/report/purchase_report_view.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/purchase/report/purchase_report_view.xml b/addons/purchase/report/purchase_report_view.xml index f9f7f753db9..66965995f8f 100644 --- a/addons/purchase/report/purchase_report_view.xml +++ b/addons/purchase/report/purchase_report_view.xml @@ -42,7 +42,7 @@ report.purchase.order search - + Date: Wed, 10 Mar 2010 15:11:29 +0530 Subject: [PATCH 06/42] [ADD]:ADD SQL View report for Invoices. bzr revid: apa@tinyerp.com-20100310094129-y6ez35gqxe3169c7 --- addons/account/__terp__.py | 1 + addons/account/report/__init__.py | 2 +- .../account/report/account_invoice_report.py | 83 ++++++++++++++ .../report/account_invoice_report_view.xml | 101 ++++++++++++++++++ 4 files changed, 186 insertions(+), 1 deletion(-) create mode 100644 addons/account/report/account_invoice_report.py create mode 100644 addons/account/report/account_invoice_report_view.xml diff --git a/addons/account/__terp__.py b/addons/account/__terp__.py index 1c58efb161f..51ee44e0a64 100644 --- a/addons/account/__terp__.py +++ b/addons/account/__terp__.py @@ -61,6 +61,7 @@ 'sequence_view.xml', 'company_view.xml', 'account_installer.xml', + 'report/account_invoice_report_view.xml', ], 'demo_xml': [ #'demo/price_accuracy00.yml', diff --git a/addons/account/report/__init__.py b/addons/account/report/__init__.py index 0311398420b..4570b114016 100644 --- a/addons/account/report/__init__.py +++ b/addons/account/report/__init__.py @@ -34,7 +34,7 @@ import general_ledger_landscape import account_tax_code import account_balance_landscape import compare_account_balance - +import account_invoice_report # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/account/report/account_invoice_report.py b/addons/account/report/account_invoice_report.py new file mode 100644 index 00000000000..c705f3a8a01 --- /dev/null +++ b/addons/account/report/account_invoice_report.py @@ -0,0 +1,83 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Management Solution +# Copyright (C) 2004-2010 Tiny SPRL (). +# +# 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 tools +from osv import fields,osv + +class account_invoice_report(osv.osv): + _name = "account.invoice.report" + _description = "Invoices Statistics" + _auto = False + _rec_name = 'date' + _columns = { + 'date': fields.date('Date', readonly=True), + 'year': fields.char('Year', size=4, 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), + 'product_id':fields.many2one('product.product', 'Product', readonly=True), + 'product_qty':fields.float('Qty', readonly=True), + 'partner_id':fields.many2one('res.partner', 'Partner', readonly=True), + 'company_id':fields.many2one('res.company', 'Company', readonly=True), + 'user_id':fields.many2one('res.users', 'Salesman', readonly=True), + 'price_total':fields.float('Total Price', readonly=True), + 'price_average':fields.float('Average Price', readonly=True), + 'nbr':fields.integer('# of Lines', readonly=True), + 'state': fields.selection([ + ('draft','Draft'), + ('proforma','Pro-forma'), + ('proforma2','Pro-forma'), + ('open','Open'), + ('paid','Done'), + ('cancel','Cancelled') + ], 'Order State', readonly=True), + } + _order = 'date desc' + def init(self, cr): + tools.drop_view_if_exists(cr, 'report_account_invoice_report') + cr.execute(""" + create or replace view account_invoice_report as ( + select + min(l.id) as id, + s.date_invoice as date, + to_char(s.date_invoice, 'YYYY') as year, + to_char(s.date_invoice, 'MM') as month, + l.product_id as product_id, + sum(l.quantity * u.factor) as product_qty, + s.partner_id as partner_id, + s.user_id as user_id, + s.company_id as company_id, + sum(l.quantity*l.price_unit) as price_total, + (sum(l.quantity*l.price_unit)/sum(l.quantity * u.factor))::decimal(16,2) as price_average, + count(*) as nbr, + s.state + from + account_invoice_line l + left join + account_invoice s on (s.id=l.invoice_id) + left join product_uom u on (u.id=l.uos_id) + group by + s.date_invoice, s.partner_id, l.product_id, + l.uos_id, s.user_id, s.state, + s.company_id + ) + """) +account_invoice_report() diff --git a/addons/account/report/account_invoice_report_view.xml b/addons/account/report/account_invoice_report_view.xml new file mode 100644 index 00000000000..ab4e3c20db6 --- /dev/null +++ b/addons/account/report/account_invoice_report_view.xml @@ -0,0 +1,101 @@ + + + + + account.invoice.report.tree + account.invoice.report + tree + + + + + + + + + + + + + + + + + + + + + + account.invoice.report.graph + account.invoice.report + graph + + + + + + + + + + account.invoice.report.search + account.invoice.report + search + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Invoices + account.invoice.report + form + tree,graph + + + + + + + From 24d3c6237e65d7f31d1cda1700fad5cbc092f3f8 Mon Sep 17 00:00:00 2001 From: apa-tiny Date: Wed, 10 Mar 2010 15:17:44 +0530 Subject: [PATCH 07/42] [IMP]:Add warehouse filter in SQL purchase report. bzr revid: apa@tinyerp.com-20100310094744-6f3i0ulg92tvm8ep --- addons/purchase/report/purchase_report.py | 5 ++++- addons/purchase/report/purchase_report_view.xml | 2 ++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/addons/purchase/report/purchase_report.py b/addons/purchase/report/purchase_report.py index 56a6b65b1b3..ac9abaaf590 100644 --- a/addons/purchase/report/purchase_report.py +++ b/addons/purchase/report/purchase_report.py @@ -44,6 +44,7 @@ class report_purchase_order(osv.osv): ('cancel','Cancel') ], 'Order State', readonly=True), 'product_id':fields.many2one('product.product', 'Product', readonly=True), + 'warehouse_id': fields.many2one('stock.warehouse', 'Warehouse', readonly=True), 'category_id': fields.many2one('product.category', 'Categories', readonly=True), 'partner_id':fields.many2one('res.partner', 'Partner', readonly=True), 'company_id':fields.many2one('res.company', 'Company', readonly=True), @@ -67,6 +68,7 @@ class report_purchase_order(osv.osv): to_char(s.date_order, 'YYYY') as name, to_char(s.date_order, 'MM') as month, s.state, + s.warehouse_id as warehouse_id, s.partner_id as partner_id, s.create_uid as user_id, s.company_id as company_id, @@ -84,7 +86,8 @@ class report_purchase_order(osv.osv): where l.product_id is not null group by s.company_id,s.create_uid,s.partner_id, t.categ_id,l.product_id,s.date_order, - to_char(s.date_order, 'YYYY'),to_char(s.date_order, 'MM'),s.state + to_char(s.date_order, 'YYYY'),to_char(s.date_order, 'MM'),s.state, + s.warehouse_id ) """) report_purchase_order() diff --git a/addons/purchase/report/purchase_report_view.xml b/addons/purchase/report/purchase_report_view.xml index 66965995f8f..0810b013b23 100644 --- a/addons/purchase/report/purchase_report_view.xml +++ b/addons/purchase/report/purchase_report_view.xml @@ -25,6 +25,7 @@ + @@ -74,6 +75,7 @@ + From a65f5deab0d4eef4c2878c301c389d27178da46f Mon Sep 17 00:00:00 2001 From: apa-tiny Date: Wed, 10 Mar 2010 15:27:59 +0530 Subject: [PATCH 08/42] [IMP]:Changed the icon of the group in invoice sql report. bzr revid: apa@tinyerp.com-20100310095759-0dk4pbtnp63jna36 --- .../account/report/account_invoice_report_view.xml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/addons/account/report/account_invoice_report_view.xml b/addons/account/report/account_invoice_report_view.xml index ab4e3c20db6..7b3d6fe96a3 100644 --- a/addons/account/report/account_invoice_report_view.xml +++ b/addons/account/report/account_invoice_report_view.xml @@ -73,15 +73,15 @@ - - + + - - - + + + - - + + From ace30b898c7bef00faa87932121414d1ca184cbc Mon Sep 17 00:00:00 2001 From: apa-tiny Date: Wed, 10 Mar 2010 16:35:01 +0530 Subject: [PATCH 09/42] [IMP]:improved the SQL account report with type of invoice.(Extended options...). bzr revid: apa@tinyerp.com-20100310110501-awf588z6w9qcz7vp --- .../account/report/account_invoice_report.py | 9 +++++++- .../report/account_invoice_report_view.xml | 21 +++++++++++++++---- 2 files changed, 25 insertions(+), 5 deletions(-) diff --git a/addons/account/report/account_invoice_report.py b/addons/account/report/account_invoice_report.py index c705f3a8a01..32645eb85b9 100644 --- a/addons/account/report/account_invoice_report.py +++ b/addons/account/report/account_invoice_report.py @@ -41,6 +41,12 @@ class account_invoice_report(osv.osv): 'price_total':fields.float('Total Price', readonly=True), 'price_average':fields.float('Average Price', readonly=True), 'nbr':fields.integer('# of Lines', readonly=True), + 'type': fields.selection([ + ('out_invoice','Customer Invoice'), + ('in_invoice','Supplier Invoice'), + ('out_refund','Customer Refund'), + ('in_refund','Supplier Refund'), + ],'Type', readonly=True), 'state': fields.selection([ ('draft','Draft'), ('proforma','Pro-forma'), @@ -68,6 +74,7 @@ class account_invoice_report(osv.osv): sum(l.quantity*l.price_unit) as price_total, (sum(l.quantity*l.price_unit)/sum(l.quantity * u.factor))::decimal(16,2) as price_average, count(*) as nbr, + s.type as type, s.state from account_invoice_line l @@ -75,7 +82,7 @@ class account_invoice_report(osv.osv): account_invoice s on (s.id=l.invoice_id) left join product_uom u on (u.id=l.uos_id) group by - s.date_invoice, s.partner_id, l.product_id, + s.type,s.date_invoice, s.partner_id, l.product_id, l.uos_id, s.user_id, s.state, s.company_id ) diff --git a/addons/account/report/account_invoice_report_view.xml b/addons/account/report/account_invoice_report_view.xml index 7b3d6fe96a3..f555ebfc050 100644 --- a/addons/account/report/account_invoice_report_view.xml +++ b/addons/account/report/account_invoice_report_view.xml @@ -11,7 +11,7 @@ - + @@ -46,11 +46,9 @@ @@ -59,7 +57,6 @@ domain="[('state','=','draft')]"/> @@ -72,6 +69,7 @@ + @@ -83,6 +81,21 @@ + + + + + + + From b12c4d63fac028ae0d420cc7540dfa09944b6cc0 Mon Sep 17 00:00:00 2001 From: apa-tiny Date: Wed, 10 Mar 2010 16:56:43 +0530 Subject: [PATCH 10/42] [IMP]:set seq in menus of invoices report. bzr revid: apa@tinyerp.com-20100310112643-3vihstp2f9g9021p --- addons/account/report/account_invoice_report_view.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/account/report/account_invoice_report_view.xml b/addons/account/report/account_invoice_report_view.xml index f555ebfc050..a5d77ceebd6 100644 --- a/addons/account/report/account_invoice_report_view.xml +++ b/addons/account/report/account_invoice_report_view.xml @@ -108,7 +108,7 @@ - + From a81aac5802f3764f0cc91fbb380d35e535c21399 Mon Sep 17 00:00:00 2001 From: apa-tiny Date: Wed, 10 Mar 2010 17:45:50 +0530 Subject: [PATCH 11/42] [IMP]:account:improved the search view. bzr revid: apa@tinyerp.com-20100310121550-uunsf4bmt99hv3mh --- .../report/account_invoice_report_view.xml | 25 +++++++++---------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/addons/account/report/account_invoice_report_view.xml b/addons/account/report/account_invoice_report_view.xml index a5d77ceebd6..de046de6211 100644 --- a/addons/account/report/account_invoice_report_view.xml +++ b/addons/account/report/account_invoice_report_view.xml @@ -69,19 +69,6 @@ - - - - - - - - - - - - - + + + + + + + + + + + + From 5d3c7a40093aa41e628239617b611a3e578ada2d Mon Sep 17 00:00:00 2001 From: apa-tiny Date: Wed, 10 Mar 2010 17:56:12 +0530 Subject: [PATCH 12/42] [IMP]:account:moved the files from report_account to account. bzr revid: apa@tinyerp.com-20100310122612-smzqntxysp3mua15 --- addons/account/__terp__.py | 1 + addons/account/report/__init__.py | 1 + .../report_receivable.py => account/report/account_report.py} | 0 .../report/account_report_view.xml} | 0 4 files changed, 2 insertions(+) rename addons/{report_account/report_receivable.py => account/report/account_report.py} (100%) rename addons/{report_account/report_receivable_view.xml => account/report/account_report_view.xml} (100%) diff --git a/addons/account/__terp__.py b/addons/account/__terp__.py index 51ee44e0a64..3fabb495ba1 100644 --- a/addons/account/__terp__.py +++ b/addons/account/__terp__.py @@ -62,6 +62,7 @@ 'company_view.xml', 'account_installer.xml', 'report/account_invoice_report_view.xml', + 'report/account_report_view.xml', ], 'demo_xml': [ #'demo/price_accuracy00.yml', diff --git a/addons/account/report/__init__.py b/addons/account/report/__init__.py index 4570b114016..71f612e0329 100644 --- a/addons/account/report/__init__.py +++ b/addons/account/report/__init__.py @@ -35,6 +35,7 @@ import account_tax_code import account_balance_landscape import compare_account_balance import account_invoice_report +import account_report # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/report_account/report_receivable.py b/addons/account/report/account_report.py similarity index 100% rename from addons/report_account/report_receivable.py rename to addons/account/report/account_report.py diff --git a/addons/report_account/report_receivable_view.xml b/addons/account/report/account_report_view.xml similarity index 100% rename from addons/report_account/report_receivable_view.xml rename to addons/account/report/account_report_view.xml From cf1e32e3f906a9ab444ef3327640aa2457c7d96d Mon Sep 17 00:00:00 2001 From: apa-tiny Date: Wed, 10 Mar 2010 18:04:36 +0530 Subject: [PATCH 13/42] [IMP/REM]:account:add access rules for report view object and also removed the files from report_account module. bzr revid: apa@tinyerp.com-20100310123436-36so4ir31k7fg0xc --- addons/account/security/ir.model.access.csv | 7 ++++ addons/report_account/__init__.py | 25 ------------ addons/report_account/__terp__.py | 38 ------------------- .../security/ir.model.access.csv | 7 ---- 4 files changed, 7 insertions(+), 70 deletions(-) delete mode 100644 addons/report_account/__init__.py delete mode 100644 addons/report_account/__terp__.py delete mode 100644 addons/report_account/security/ir.model.access.csv diff --git a/addons/account/security/ir.model.access.csv b/addons/account/security/ir.model.access.csv index 271a4efe0ab..656e05e2a9b 100644 --- a/addons/account/security/ir.model.access.csv +++ b/addons/account/security/ir.model.access.csv @@ -88,3 +88,10 @@ "access_account_sequence_fiscal_year","account.sequence.fiscalyear","model_account_sequence_fiscalyear","account.group_account_user",1,1,1,1 "access_account_sequence_fiscal_year_user","account.sequence.fiscalyear user","model_account_sequence_fiscalyear","base.group_user",1,0,0,0 "access_account_installer","account.installer","model_account_installer","base.group_user",1,0,0,0 +"access_report_account_receivable","report.account.receivable","model_report_account_receivable","account.group_account_manager",1,0,0,0 +"access_temp_range","temp.range","model_temp_range","account.group_account_manager",1,0,0,0 +"access_report_aged_receivable","report.aged.receivable","model_report_aged_receivable","account.group_account_manager",1,0,0,0 +"access_report_invoice_created","report.invoice.created","model_report_invoice_created","account.group_account_manager",1,0,0,0 +"access_report_account_type_sales","report.account_type.sales","model_report_account_type_sales","account.group_account_manager",1,0,0,0 +"access_report_account_sales","report.account.sales","model_report_account_sales","account.group_account_manager",1,0,0,0 +"access_account_invoice_report","account.invoice.report","model_account_invoice_report","account.group_account_manager",1,0,0,0 diff --git a/addons/report_account/__init__.py b/addons/report_account/__init__.py deleted file mode 100644 index a32842f6570..00000000000 --- a/addons/report_account/__init__.py +++ /dev/null @@ -1,25 +0,0 @@ -# -*- coding: utf-8 -*- -############################################################################## -# -# OpenERP, Open Source Management Solution -# Copyright (C) 2004-2010 Tiny SPRL (). -# -# 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 report_receivable - -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: - diff --git a/addons/report_account/__terp__.py b/addons/report_account/__terp__.py deleted file mode 100644 index 43f9ab946f8..00000000000 --- a/addons/report_account/__terp__.py +++ /dev/null @@ -1,38 +0,0 @@ -# -*- coding: utf-8 -*- -############################################################################## -# -# OpenERP, Open Source Management Solution -# Copyright (C) 2004-2010 Tiny SPRL (). -# -# 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 . -# -############################################################################## - - -{ - 'name': 'Account Reporting - Reporting', - 'version': '1.0', - 'category': 'Generic Modules/Accounting', - 'description': """A module that adds new reports based on the account module.""", - 'author': 'Tiny', - 'website': 'http://www.openerp.com', - 'depends': ['account'], - 'init_xml': [], - 'update_xml': ['security/ir.model.access.csv', 'report_receivable_view.xml'], - 'demo_xml': [], - 'installable': True, - 'active': False, - 'certificate': '0061754222813', -} -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/report_account/security/ir.model.access.csv b/addons/report_account/security/ir.model.access.csv deleted file mode 100644 index b37051847a4..00000000000 --- a/addons/report_account/security/ir.model.access.csv +++ /dev/null @@ -1,7 +0,0 @@ -"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink" -"access_report_account_receivable","report.account.receivable","model_report_account_receivable","account.group_account_manager",1,0,0,0 -"access_temp_range","temp.range","model_temp_range","account.group_account_manager",1,0,0,0 -"access_report_aged_receivable","report.aged.receivable","model_report_aged_receivable","account.group_account_manager",1,0,0,0 -"access_report_invoice_created","report.invoice.created","model_report_invoice_created","account.group_account_manager",1,0,0,0 -"access_report_account_type_sales","report.account_type.sales","model_report_account_type_sales","account.group_account_manager",1,0,0,0 -"access_report_account_sales","report.account.sales","model_report_account_sales","account.group_account_manager",1,0,0,0 From 4cd08109f57e2d913a7626714c0b7dd9a0becb16 Mon Sep 17 00:00:00 2001 From: apa-tiny Date: Fri, 12 Mar 2010 12:29:13 +0530 Subject: [PATCH 14/42] [ADD]:Add SQL Evaluation report. bzr revid: apa@tinyerp.com-20100312065913-h1ndpve2lv1n5j94 --- addons/hr_evaluation/__init__.py | 5 +- addons/hr_evaluation/__terp__.py | 3 +- addons/hr_evaluation/report/__init__.py | 21 ++++++ .../hr_evaluation/report/evaluation_report.py | 74 +++++++++++++++++++ .../report/evaluation_report_view.xml | 70 ++++++++++++++++++ 5 files changed, 170 insertions(+), 3 deletions(-) create mode 100644 addons/hr_evaluation/report/__init__.py create mode 100644 addons/hr_evaluation/report/evaluation_report.py create mode 100644 addons/hr_evaluation/report/evaluation_report_view.xml diff --git a/addons/hr_evaluation/__init__.py b/addons/hr_evaluation/__init__.py index 7fe03d1245a..e8abcb28e1d 100644 --- a/addons/hr_evaluation/__init__.py +++ b/addons/hr_evaluation/__init__.py @@ -1,6 +1,6 @@ # -*- encoding: utf-8 -*- ############################################################################## -# +# # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (). # @@ -15,11 +15,12 @@ # 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 . +# along with this program. If not, see . # ############################################################################## import hr_evaluation +import report # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/hr_evaluation/__terp__.py b/addons/hr_evaluation/__terp__.py index 0a664f50a88..75fd1a1cbd7 100644 --- a/addons/hr_evaluation/__terp__.py +++ b/addons/hr_evaluation/__terp__.py @@ -32,7 +32,8 @@ "update_xml" : [ "security/ir.model.access.csv", "hr_evaluation_view.xml", - "hr_evaluation_data.xml"], + "hr_evaluation_data.xml", + "report/evaluation_report_view.xml"], "active": False, "installable": True } diff --git a/addons/hr_evaluation/report/__init__.py b/addons/hr_evaluation/report/__init__.py new file mode 100644 index 00000000000..3fee228552a --- /dev/null +++ b/addons/hr_evaluation/report/__init__.py @@ -0,0 +1,21 @@ +# -*- encoding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Management Solution +# Copyright (C) 2004-2009 Tiny SPRL (). +# +# 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 evaluation_report \ No newline at end of file diff --git a/addons/hr_evaluation/report/evaluation_report.py b/addons/hr_evaluation/report/evaluation_report.py new file mode 100644 index 00000000000..76c6a2586d0 --- /dev/null +++ b/addons/hr_evaluation/report/evaluation_report.py @@ -0,0 +1,74 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Management Solution +# Copyright (C) 2004-2010 Tiny SPRL (). +# +# 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 tools +from osv import fields,osv + + +class evaluation_report(osv.osv): + _name = "evaluation.report" + _description = "Evaluations Statistics" + _auto = False + _rec_name = 'date' + _columns = { + 'create_date': fields.datetime('Create Date', readonly=True), + 'deadline': fields.date("Deadline", readonly=True), + 'closed': fields.date("closed", readonly=True), + 'year': fields.char('Year', size=4, 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), + 'employee_id': fields.many2one('hr.employee', "Employee", readonly=True), + 'nbr':fields.integer('# of Requests', readonly=True), + 'state': fields.selection([ + ('draft','Draft'), + ('wait','Plan In Progress'), + ('progress','Final Validation'), + ('done','Done'), + ('cancel','Cancelled'), + ], 'State',readonly=True), + } + _order = 'create_date desc' + def init(self, cr): + tools.drop_view_if_exists(cr, 'evaluation_report') + cr.execute(""" + create or replace view evaluation_report as ( + select + min(l.id) as id, + s.create_date as create_date, + s.employee_id, + s.date as deadline, + s.date_close as closed, + to_char(s.create_date, 'YYYY') as year, + to_char(s.create_date, 'MM') as month, + count(*) as nbr, + s.state + from + hr_evaluation_interview l + left join + hr_evaluation_evaluation s on (s.id=l.evaluation_id) + group by + s.create_date,s.state,s.employee_id, + s.date,s.date_close + ) + """) +evaluation_report() + diff --git a/addons/hr_evaluation/report/evaluation_report_view.xml b/addons/hr_evaluation/report/evaluation_report_view.xml new file mode 100644 index 00000000000..b9bcfccc776 --- /dev/null +++ b/addons/hr_evaluation/report/evaluation_report_view.xml @@ -0,0 +1,70 @@ + + + + + evaluation.report.tree + evaluation.report + tree + + + + + + + + + + + + + + + + evaluation.report.search + evaluation.report + search + + + + + + + + + + + + + + + + + + + + + + + + Evaluations + evaluation.report + form + tree,graph + + + + + + + + From c2fc180bb713e0b174eefe12a88fa2008349db10 Mon Sep 17 00:00:00 2001 From: apa-tiny Date: Fri, 12 Mar 2010 12:34:43 +0530 Subject: [PATCH 15/42] [IMP]:renamed the Evaluation report name. bzr revid: apa@tinyerp.com-20100312070443-ggnl6zmxbl5c5olu --- addons/hr_evaluation/__terp__.py | 2 +- addons/hr_evaluation/report/__init__.py | 2 +- .../report/{evaluation_report.py => hr_evaluation_report.py} | 0 ...evaluation_report_view.xml => hr_evaluation_report_view.xml} | 0 4 files changed, 2 insertions(+), 2 deletions(-) rename addons/hr_evaluation/report/{evaluation_report.py => hr_evaluation_report.py} (100%) rename addons/hr_evaluation/report/{evaluation_report_view.xml => hr_evaluation_report_view.xml} (100%) diff --git a/addons/hr_evaluation/__terp__.py b/addons/hr_evaluation/__terp__.py index 75fd1a1cbd7..26b71c795c8 100644 --- a/addons/hr_evaluation/__terp__.py +++ b/addons/hr_evaluation/__terp__.py @@ -33,7 +33,7 @@ "security/ir.model.access.csv", "hr_evaluation_view.xml", "hr_evaluation_data.xml", - "report/evaluation_report_view.xml"], + "report/hr_evaluation_report_view.xml"], "active": False, "installable": True } diff --git a/addons/hr_evaluation/report/__init__.py b/addons/hr_evaluation/report/__init__.py index 3fee228552a..193a389c85d 100644 --- a/addons/hr_evaluation/report/__init__.py +++ b/addons/hr_evaluation/report/__init__.py @@ -18,4 +18,4 @@ # along with this program. If not, see . # ############################################################################## -import evaluation_report \ No newline at end of file +import hr_evaluation_report \ No newline at end of file diff --git a/addons/hr_evaluation/report/evaluation_report.py b/addons/hr_evaluation/report/hr_evaluation_report.py similarity index 100% rename from addons/hr_evaluation/report/evaluation_report.py rename to addons/hr_evaluation/report/hr_evaluation_report.py diff --git a/addons/hr_evaluation/report/evaluation_report_view.xml b/addons/hr_evaluation/report/hr_evaluation_report_view.xml similarity index 100% rename from addons/hr_evaluation/report/evaluation_report_view.xml rename to addons/hr_evaluation/report/hr_evaluation_report_view.xml From 71053a2fa94d67e49a5e9f6ab938088cf7221b23 Mon Sep 17 00:00:00 2001 From: apa-tiny Date: Fri, 12 Mar 2010 12:51:01 +0530 Subject: [PATCH 16/42] [IMP]:Improved code and set access rights for evaluation report. bzr revid: apa@tinyerp.com-20100312072101-j2pwfuosgws41t45 --- .../report/hr_evaluation_report.py | 10 +++++----- .../report/hr_evaluation_report_view.xml | 14 +++++++------- .../hr_evaluation/security/ir.model.access.csv | 17 +++++++++-------- 3 files changed, 21 insertions(+), 20 deletions(-) diff --git a/addons/hr_evaluation/report/hr_evaluation_report.py b/addons/hr_evaluation/report/hr_evaluation_report.py index 76c6a2586d0..5e27b568c4f 100644 --- a/addons/hr_evaluation/report/hr_evaluation_report.py +++ b/addons/hr_evaluation/report/hr_evaluation_report.py @@ -23,8 +23,8 @@ import tools from osv import fields,osv -class evaluation_report(osv.osv): - _name = "evaluation.report" +class hr_evaluation_report(osv.osv): + _name = "hr.evaluation.report" _description = "Evaluations Statistics" _auto = False _rec_name = 'date' @@ -48,9 +48,9 @@ class evaluation_report(osv.osv): } _order = 'create_date desc' def init(self, cr): - tools.drop_view_if_exists(cr, 'evaluation_report') + tools.drop_view_if_exists(cr, 'hr_evaluation_report') cr.execute(""" - create or replace view evaluation_report as ( + create or replace view hr_evaluation_report as ( select min(l.id) as id, s.create_date as create_date, @@ -70,5 +70,5 @@ class evaluation_report(osv.osv): s.date,s.date_close ) """) -evaluation_report() +hr_evaluation_report() diff --git a/addons/hr_evaluation/report/hr_evaluation_report_view.xml b/addons/hr_evaluation/report/hr_evaluation_report_view.xml index b9bcfccc776..fe24b7c373f 100644 --- a/addons/hr_evaluation/report/hr_evaluation_report_view.xml +++ b/addons/hr_evaluation/report/hr_evaluation_report_view.xml @@ -2,8 +2,8 @@ - evaluation.report.tree - evaluation.report + hr.evaluation.report.tree + hr.evaluation.report tree @@ -20,8 +20,8 @@ - evaluation.report.search - evaluation.report + hr.evaluation.report.search + hr.evaluation.report search @@ -57,14 +57,14 @@ Evaluations - evaluation.report + hr.evaluation.report form - tree,graph + tree - + diff --git a/addons/hr_evaluation/security/ir.model.access.csv b/addons/hr_evaluation/security/ir.model.access.csv index c9962231e6c..3f3948c00db 100644 --- a/addons/hr_evaluation/security/ir.model.access.csv +++ b/addons/hr_evaluation/security/ir.model.access.csv @@ -1,9 +1,10 @@ "id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink" -"access_hr_evaluation_evaluation","hr_evaluation.evaluation","model_hr_evaluation_evaluation",hr.group_hr_user,1,0,0,0 -"access_hr_evaluation_evaluation_manager","hr_evaluation.evaluation","model_hr_evaluation_evaluation",hr.group_hr_manager,1,1,1,1 -"access_hr_evaluation_plan","hr_evaluation.plan","model_hr_evaluation_evaluation",hr.group_hr_user,1,0,0,0 -"access_hr_evaluation_plan_manager","hr_evaluation.plan","model_hr_evaluation_plan",hr.group_hr_manager,1,1,1,1 -"access_hr_evaluation_plan_phase","hr_evaluation.plan.phase","model_hr_evaluation_plan_phase",hr.group_hr_user,1,0,0,0 -"access_hr_evaluation_plan_phase_manager","hr_evaluation.plan.phase","model_hr_evaluation_plan_phase",hr.group_hr_manager,1,1,1,1 -"access_hr_evaluation_interview","hr.evaluation.interview","model_hr_evaluation_interview",hr.group_hr_user,1,0,0,0 -"access_hr_evaluation_interview_manager","hr.evaluation.interview","model_hr_evaluation_interview",hr.group_hr_manager,1,1,1,1 +"access_hr_evaluation_evaluation","hr_evaluation.evaluation","model_hr_evaluation_evaluation","hr.group_hr_user",1,0,0,0 +"access_hr_evaluation_evaluation_manager","hr_evaluation.evaluation","model_hr_evaluation_evaluation","hr.group_hr_manager",1,1,1,1 +"access_hr_evaluation_plan","hr_evaluation.plan","model_hr_evaluation_evaluation","hr.group_hr_user",1,0,0,0 +"access_hr_evaluation_plan_manager","hr_evaluation.plan","model_hr_evaluation_plan","hr.group_hr_manager",1,1,1,1 +"access_hr_evaluation_plan_phase","hr_evaluation.plan.phase","model_hr_evaluation_plan_phase","hr.group_hr_user",1,0,0,0 +"access_hr_evaluation_plan_phase_manager","hr_evaluation.plan.phase","model_hr_evaluation_plan_phase","hr.group_hr_manager",1,1,1,1 +"access_hr_evaluation_interview","hr.evaluation.interview","model_hr_evaluation_interview","hr.group_hr_user",1,0,0,0 +"access_hr_evaluation_interview_manager","hr.evaluation.interview","model_hr_evaluation_interview","hr.group_hr_manager",1,1,1,1 +"access_hr_evaluation_report","hr.evaluation.report","model_hr_evaluation_report",,1,0,0,0 From 1ecc1674abcebe3b2ca0dbdfe30dd26236a2677f Mon Sep 17 00:00:00 2001 From: apa-tiny Date: Fri, 12 Mar 2010 16:44:46 +0530 Subject: [PATCH 17/42] [ADD]:Added SQL view report for hr_expense. bzr revid: apa@tinyerp.com-20100312111446-k4mw36hv3hkqn0ss --- addons/hr_expense/__terp__.py | 7 +- addons/hr_expense/report/__init__.py | 5 +- addons/hr_expense/report/hr_expense_report.py | 90 ++++++++++++++++ .../report/hr_expense_report_view.xml | 100 ++++++++++++++++++ 4 files changed, 197 insertions(+), 5 deletions(-) create mode 100644 addons/hr_expense/report/hr_expense_report.py create mode 100644 addons/hr_expense/report/hr_expense_report_view.xml diff --git a/addons/hr_expense/__terp__.py b/addons/hr_expense/__terp__.py index 6cdf8acdd3a..03fab346c77 100644 --- a/addons/hr_expense/__terp__.py +++ b/addons/hr_expense/__terp__.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- ############################################################################## -# +# # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (). # @@ -15,7 +15,7 @@ # 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 . +# along with this program. If not, see . # ############################################################################## @@ -48,7 +48,8 @@ 'hr_expense_workflow.xml', 'hr_expense_view.xml', 'hr_expense_report.xml', - 'process/hr_expense_process.xml' + 'process/hr_expense_process.xml', + 'report/hr_expense_report_view.xml' ], 'demo_xml': ['hr.expense.expense.csv'], 'installable': True, diff --git a/addons/hr_expense/report/__init__.py b/addons/hr_expense/report/__init__.py index f55bc86bc12..4ddd1d33933 100644 --- a/addons/hr_expense/report/__init__.py +++ b/addons/hr_expense/report/__init__.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- ############################################################################## -# +# # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (). # @@ -15,10 +15,11 @@ # 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 . +# along with this program. If not, see . # ############################################################################## import expense +import hr_expense_report # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/hr_expense/report/hr_expense_report.py b/addons/hr_expense/report/hr_expense_report.py new file mode 100644 index 00000000000..81cb18dcc09 --- /dev/null +++ b/addons/hr_expense/report/hr_expense_report.py @@ -0,0 +1,90 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Management Solution +# Copyright (C) 2004-2010 Tiny SPRL (). +# +# 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 tools +from osv import fields,osv + + +class hr_expense_report(osv.osv): + _name = "hr.expense.report" + _description = "Expenses Statistics" + _auto = False + _rec_name = 'date' + _columns = { + 'date': fields.date('Date', readonly=True), + 'year': fields.char('Year', size=4, 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), + 'product_id':fields.many2one('product.product', 'Product', readonly=True), + 'product_qty':fields.float('Qty', readonly=True), + 'employee_id': fields.many2one('hr.employee', "Employee's Name", readonly=True), + 'invoice_id': fields.many2one('account.invoice', 'Invoice',readonly=True), + 'department_id':fields.many2one('hr.department','Department',readonly=True), + 'company_id':fields.many2one('res.company', 'Company', readonly=True), + 'user_id':fields.many2one('res.users', 'User', readonly=True), + 'price_total':fields.float('Total Price', readonly=True), + 'price_average':fields.float('Average Price', readonly=True), + 'nbr':fields.integer('# of Lines', readonly=True), + 'state': fields.selection([ + ('draft', 'Draft'), + ('confirm', 'Waiting confirmation'), + ('accepted', 'Accepted'), + ('invoiced', 'Invoiced'), + ('paid', 'Reimbursed'), + ('cancelled', 'Cancelled')], + 'State', readonly=True), + } + _order = 'date desc' + def init(self, cr): + tools.drop_view_if_exists(cr, 'hr_expense_report') + cr.execute(""" + create or replace view hr_expense_report as ( + select + min(l.id) as id, + s.date as date, + s.employee_id, + s.invoice_id, + s.department_id, + to_char(s.date, 'YYYY') as year, + to_char(s.date, 'MM') as month, + l.product_id as product_id, + sum(l.unit_quantity * u.factor) as product_qty, + s.user_id as user_id, + s.company_id as company_id, + sum(l.unit_quantity*l.unit_amount) as price_total, + (sum(l.unit_quantity*l.unit_amount)/sum(l.unit_quantity * u.factor))::decimal(16,2) as price_average, + count(*) as nbr, + s.state + from + hr_expense_line l + left join + hr_expense_expense s on (s.id=l.expense_id) + left join product_uom u on (u.id=l.uom_id) + group by + s.date, l.product_id,s.invoice_id, + s.department_id, + l.uom_id, s.user_id, s.state, + s.company_id,s.employee_id + ) + """) +hr_expense_report() + diff --git a/addons/hr_expense/report/hr_expense_report_view.xml b/addons/hr_expense/report/hr_expense_report_view.xml new file mode 100644 index 00000000000..9e30e6688f2 --- /dev/null +++ b/addons/hr_expense/report/hr_expense_report_view.xml @@ -0,0 +1,100 @@ + + + + + hr.expense.report.tree + hr.expense.report + tree + + + + + + + + + + + + + + + + + + + + + + hr.expense.report.graph + hr.expense.report + graph + + + + + + + + + + hr.expense.report.search + hr.expense.report + search + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Expenses + hr.expense.report + form + tree,graph + + + + + + + + From 71eda1fdf7ca27e3a687e4f2f75ed40c4c85265a Mon Sep 17 00:00:00 2001 From: apa-tiny Date: Fri, 12 Mar 2010 17:06:10 +0530 Subject: [PATCH 18/42] [MOVE/REM]:moved the sale_report.py and sale_report_view.xml in report folder and also removed report_sale_view.xml(No needed.). bzr revid: apa@tinyerp.com-20100312113610-er7p4r52anuh8phq --- addons/sale/__init__.py | 6 ++---- addons/sale/__terp__.py | 7 +++---- addons/sale/report/__init__.py | 5 +++-- addons/sale/{ => report}/sale_report.py | 0 addons/sale/{ => report}/sale_report_view.xml | 0 addons/sale/report_sale_view.xml | 6 ------ 6 files changed, 8 insertions(+), 16 deletions(-) rename addons/sale/{ => report}/sale_report.py (100%) rename addons/sale/{ => report}/sale_report_view.xml (100%) delete mode 100644 addons/sale/report_sale_view.xml diff --git a/addons/sale/__init__.py b/addons/sale/__init__.py index 8e1da80d257..ebc12a1089e 100644 --- a/addons/sale/__init__.py +++ b/addons/sale/__init__.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- ############################################################################## -# +# # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (). # @@ -15,7 +15,7 @@ # 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 . +# along with this program. If not, see . # ############################################################################## @@ -27,8 +27,6 @@ import sale import stock import product import mrp -import sale_report - import wizard import report diff --git a/addons/sale/__terp__.py b/addons/sale/__terp__.py index 70d9f084afb..51ddf03fe55 100644 --- a/addons/sale/__terp__.py +++ b/addons/sale/__terp__.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- ############################################################################## -# +# # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (). # @@ -15,7 +15,7 @@ # 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 . +# along with this program. If not, see . # ############################################################################## @@ -52,11 +52,10 @@ 'sale_data.xml', 'sale_wizard.xml', 'sale_view.xml', - 'sale_report_view.xml', + 'report/sale_report_view.xml', 'sale_report.xml', 'sale_wizard.xml', 'stock_view.xml', - 'report_sale_view.xml', 'process/sale_process.xml', ], 'demo_xml': ['sale_demo.xml'], diff --git a/addons/sale/report/__init__.py b/addons/sale/report/__init__.py index 60b6a2999fc..fb04b328a57 100644 --- a/addons/sale/report/__init__.py +++ b/addons/sale/report/__init__.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- ############################################################################## -# +# # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (). # @@ -15,10 +15,11 @@ # 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 . +# along with this program. If not, see . # ############################################################################## import sale_prepare_allot import order +import sale_report # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/sale/sale_report.py b/addons/sale/report/sale_report.py similarity index 100% rename from addons/sale/sale_report.py rename to addons/sale/report/sale_report.py diff --git a/addons/sale/sale_report_view.xml b/addons/sale/report/sale_report_view.xml similarity index 100% rename from addons/sale/sale_report_view.xml rename to addons/sale/report/sale_report_view.xml diff --git a/addons/sale/report_sale_view.xml b/addons/sale/report_sale_view.xml deleted file mode 100644 index 30816750035..00000000000 --- a/addons/sale/report_sale_view.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - From 606f433ba6b406f06d964eec580a4d40629860b1 Mon Sep 17 00:00:00 2001 From: apa-tiny Date: Fri, 12 Mar 2010 17:10:45 +0530 Subject: [PATCH 19/42] [MOVE]:stock:moved the report.py and report_view.xml in report folder. bzr revid: apa@tinyerp.com-20100312114045-fi3tpjvynoqktmy3 --- addons/stock/__init__.py | 7 ++----- addons/stock/__terp__.py | 4 ++-- addons/stock/report/__init__.py | 5 +++-- addons/stock/{ => report}/report_stock.py | 0 addons/stock/{ => report}/report_stock_view.xml | 0 5 files changed, 7 insertions(+), 9 deletions(-) rename addons/stock/{ => report}/report_stock.py (100%) rename addons/stock/{ => report}/report_stock_view.xml (100%) diff --git a/addons/stock/__init__.py b/addons/stock/__init__.py index d728efbf2fe..a2df9bdd809 100644 --- a/addons/stock/__init__.py +++ b/addons/stock/__init__.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- ############################################################################## -# +# # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (). # @@ -15,18 +15,15 @@ # 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 . +# along with this program. If not, see . # ############################################################################## from stock import * import partner import product - import report import wizard -import report_stock - import stock_wizard diff --git a/addons/stock/__terp__.py b/addons/stock/__terp__.py index 8081c4b6738..502ac0222a5 100644 --- a/addons/stock/__terp__.py +++ b/addons/stock/__terp__.py @@ -45,14 +45,14 @@ Thanks to the double entry management, the inventory controlling is powerful and "stock_data.xml", "stock_incoterms.xml", "stock_wizard.xml", - "stock_wizard_view.xml", + "stock_wizard_view.xml", "stock_view.xml", "stock_report.xml", "stock_sequence.xml", "product_data.xml", "product_view.xml", "partner_view.xml", - "report_stock_view.xml", + "report/report_stock_view.xml", "security/stock_security.xml", "security/ir.model.access.csv", ], diff --git a/addons/stock/report/__init__.py b/addons/stock/report/__init__.py index 5bad46baa07..3c650e3ed8c 100644 --- a/addons/stock/report/__init__.py +++ b/addons/stock/report/__init__.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- ############################################################################## -# +# # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (). # @@ -15,7 +15,7 @@ # 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 . +# along with this program. If not, see . # ############################################################################## @@ -26,6 +26,7 @@ import ups import picking import lot_overview import lot_overview_all +import report_stock # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/stock/report_stock.py b/addons/stock/report/report_stock.py similarity index 100% rename from addons/stock/report_stock.py rename to addons/stock/report/report_stock.py diff --git a/addons/stock/report_stock_view.xml b/addons/stock/report/report_stock_view.xml similarity index 100% rename from addons/stock/report_stock_view.xml rename to addons/stock/report/report_stock_view.xml From d209a6d50bda082d55988f909cb10ac0f0dad1d9 Mon Sep 17 00:00:00 2001 From: apa-tiny Date: Fri, 12 Mar 2010 17:14:19 +0530 Subject: [PATCH 20/42] [IMP]:improved code bzr revid: apa@tinyerp.com-20100312114419-nv9k9exe6c91ocw1 --- addons/account/report/account_invoice_report.py | 2 +- addons/sale/report/sale_report.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/addons/account/report/account_invoice_report.py b/addons/account/report/account_invoice_report.py index 32645eb85b9..0d4ac30323d 100644 --- a/addons/account/report/account_invoice_report.py +++ b/addons/account/report/account_invoice_report.py @@ -58,7 +58,7 @@ class account_invoice_report(osv.osv): } _order = 'date desc' def init(self, cr): - tools.drop_view_if_exists(cr, 'report_account_invoice_report') + tools.drop_view_if_exists(cr, 'account_invoice_report') cr.execute(""" create or replace view account_invoice_report as ( select diff --git a/addons/sale/report/sale_report.py b/addons/sale/report/sale_report.py index 2f387ee3883..3ba814b438f 100644 --- a/addons/sale/report/sale_report.py +++ b/addons/sale/report/sale_report.py @@ -32,7 +32,7 @@ class sale_report(osv.osv): 'date': fields.date('Date', readonly=True), 'year': fields.char('Year', size=4, readonly=True), 'month':fields.selection([('01','January'), ('02','February'), ('03','March'), ('04','April'), - ('05','May'), ('06','June'), ('07','July'), ('08','August'), ('09','September'), + ('05','May'), ('06','June'), ('07','July'), ('08','August'), ('09','September'), ('10','October'), ('11','November'), ('12','December')], 'Month',readonly=True), 'product_id':fields.many2one('product.product', 'Product', readonly=True), 'product_qty':fields.float('Qty', readonly=True), @@ -57,7 +57,7 @@ class sale_report(osv.osv): } _order = 'date desc' def init(self, cr): - tools.drop_view_if_exists(cr, 'report_sale_order_product') + tools.drop_view_if_exists(cr, 'sale_report') cr.execute(""" create or replace view sale_report as ( select From 9c6b0c5fa7c7ba16aeedeb3b21a4e1dae72e4442 Mon Sep 17 00:00:00 2001 From: apa-tiny Date: Fri, 12 Mar 2010 18:12:47 +0530 Subject: [PATCH 21/42] [REM/MOVE]:moved the report_analytic files in hr_timesheet_invoice module and removed the report_analyatic module. bzr revid: apa@tinyerp.com-20100312124247-8ojsf86doe2304bg --- addons/hr_timesheet_invoice/__terp__.py | 7 ++-- .../hr_timesheet_invoice/report/__init__.py | 5 ++- .../report}/report_analytic.py | 0 .../report}/report_analytic_view.xml | 0 .../security/ir.model.access.csv | 2 + addons/report_analytic/__init__.py | 25 ------------ addons/report_analytic/__terp__.py | 38 ------------------- .../security/ir.model.access.csv | 3 -- 8 files changed, 9 insertions(+), 71 deletions(-) rename addons/{report_analytic => hr_timesheet_invoice/report}/report_analytic.py (100%) rename addons/{report_analytic => hr_timesheet_invoice/report}/report_analytic_view.xml (100%) delete mode 100644 addons/report_analytic/__init__.py delete mode 100644 addons/report_analytic/__terp__.py delete mode 100644 addons/report_analytic/security/ir.model.access.csv diff --git a/addons/hr_timesheet_invoice/__terp__.py b/addons/hr_timesheet_invoice/__terp__.py index cbb2ace596a..fd07bb28317 100644 --- a/addons/hr_timesheet_invoice/__terp__.py +++ b/addons/hr_timesheet_invoice/__terp__.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- ############################################################################## -# +# # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (). # @@ -15,7 +15,7 @@ # 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 . +# along with this program. If not, see . # ############################################################################## @@ -36,7 +36,8 @@ reports, eso.""", 'security/ir.model.access.csv', 'hr_timesheet_invoice_view.xml', 'hr_timesheet_invoice_wizard.xml', - 'hr_timesheet_invoice_report.xml' + 'hr_timesheet_invoice_report.xml', + 'report/report_analytic_view.xml', ], 'demo_xml': ['hr_timesheet_invoice_demo.xml'], 'installable': True, diff --git a/addons/hr_timesheet_invoice/report/__init__.py b/addons/hr_timesheet_invoice/report/__init__.py index 9d87b1fdd1c..dc249770c4e 100644 --- a/addons/hr_timesheet_invoice/report/__init__.py +++ b/addons/hr_timesheet_invoice/report/__init__.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- ############################################################################## -# +# # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (). # @@ -15,12 +15,13 @@ # 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 . +# along with this program. If not, see . # ############################################################################## import cost_ledger import account_analytic_profit +import report_analytic # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/report_analytic/report_analytic.py b/addons/hr_timesheet_invoice/report/report_analytic.py similarity index 100% rename from addons/report_analytic/report_analytic.py rename to addons/hr_timesheet_invoice/report/report_analytic.py diff --git a/addons/report_analytic/report_analytic_view.xml b/addons/hr_timesheet_invoice/report/report_analytic_view.xml similarity index 100% rename from addons/report_analytic/report_analytic_view.xml rename to addons/hr_timesheet_invoice/report/report_analytic_view.xml diff --git a/addons/hr_timesheet_invoice/security/ir.model.access.csv b/addons/hr_timesheet_invoice/security/ir.model.access.csv index 670f835a50d..a81e229a2e0 100644 --- a/addons/hr_timesheet_invoice/security/ir.model.access.csv +++ b/addons/hr_timesheet_invoice/security/ir.model.access.csv @@ -1,3 +1,5 @@ "id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink" "access_hr_timesheet_invoice_factor_hr_user","hr_timesheet_invoice.factor.hr.user","model_hr_timesheet_invoice_factor","hr.group_hr_user",1,0,0,0 "access_hr_timesheet_invoice_factor_acc_inv","hr_timesheet_invoice.factor.account.invoice","model_hr_timesheet_invoice_factor","account.group_account_invoice",1,1,1,1 +"access_report_analytic_account_close","report.analytic.account.close","model_report_analytic_account_close","account.group_account_manager",1,0,0,0 +"access_report_account_analytic_line_to_invoice","report.account.analytic.line.to.invoice","model_report_account_analytic_line_to_invoice","account.group_account_manager",1,0,0,0 diff --git a/addons/report_analytic/__init__.py b/addons/report_analytic/__init__.py deleted file mode 100644 index ad14dd13f4e..00000000000 --- a/addons/report_analytic/__init__.py +++ /dev/null @@ -1,25 +0,0 @@ -# -*- coding: utf-8 -*- -############################################################################## -# -# OpenERP, Open Source Management Solution -# Copyright (C) 2004-2010 Tiny SPRL (). -# -# 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 report_analytic - -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: - diff --git a/addons/report_analytic/__terp__.py b/addons/report_analytic/__terp__.py deleted file mode 100644 index c5ec3a0dd8f..00000000000 --- a/addons/report_analytic/__terp__.py +++ /dev/null @@ -1,38 +0,0 @@ -# -*- coding: utf-8 -*- -############################################################################## -# -# OpenERP, Open Source Management Solution -# Copyright (C) 2004-2010 Tiny SPRL (). -# -# 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 . -# -############################################################################## - - -{ - 'name': 'Analytic Account Reporting', - 'version': '1.0', - 'category': 'Generic Modules/Accounting', - 'description': """A module that adds new reports based on analytic accounts.""", - 'author': 'Tiny', - 'website': 'http://www.openerp.com', - 'depends': ['account', 'hr_timesheet_invoice'], - 'init_xml': [], - 'update_xml': ['security/ir.model.access.csv', 'report_analytic_view.xml'], - 'demo_xml': [], - 'installable': True, - 'active': False, - 'certificate': '0059950675429', -} -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/report_analytic/security/ir.model.access.csv b/addons/report_analytic/security/ir.model.access.csv deleted file mode 100644 index 67807398c36..00000000000 --- a/addons/report_analytic/security/ir.model.access.csv +++ /dev/null @@ -1,3 +0,0 @@ -id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink -access_report_analytic_account_close,report.analytic.account.close,model_report_analytic_account_close,account.group_account_manager,1,0,0,0 -access_report_account_analytic_line_to_invoice,report.account.analytic.line.to.invoice,model_report_account_analytic_line_to_invoice,account.group_account_manager,1,0,0,0 \ No newline at end of file From cde9aa41db74e59daf6d66476c4f611c2ce324ac Mon Sep 17 00:00:00 2001 From: "Vir (Open ERP)" Date: Mon, 15 Mar 2010 17:26:28 +0530 Subject: [PATCH 22/42] [ADD/MOD] crm_helpdesk : new report added for helpdesk bzr revid: vir@tinyerp.com-20100315115628-sop2obsidgbnyok9 --- addons/crm/__terp__.py | 109 ++++++------- addons/crm/report/__init__.py | 1 + addons/crm/report/crm_helpdesk_report.py | 63 ++++++++ .../crm/report/crm_helpdesk_report_view.xml | 149 ++++++++++++++++++ 4 files changed, 268 insertions(+), 54 deletions(-) create mode 100644 addons/crm/report/crm_helpdesk_report.py create mode 100644 addons/crm/report/crm_helpdesk_report_view.xml diff --git a/addons/crm/__terp__.py b/addons/crm/__terp__.py index 994f11f3212..72222a00668 100644 --- a/addons/crm/__terp__.py +++ b/addons/crm/__terp__.py @@ -41,73 +41,74 @@ appropriate staff, and making sure all future correspondence gets to the right place. The CRM module has a email gateway for the synchronisation interface -between mails and Open ERP.""", - 'author': 'Tiny', - 'website': 'http://www.openerp.com', - 'depends': ['base', 'base_action_rule', - 'process', - 'mail_gateway', +between mails and Open ERP.""", + 'author': 'Tiny', + 'website': 'http://www.openerp.com', + 'depends': ['base', 'base_action_rule', + 'process', + 'mail_gateway', 'base_calendar', - ], - 'init_xml': ['crm_data.xml', - 'crm_meeting_data.xml', - 'crm_claims_data.xml', - 'crm_fund_data.xml', - 'crm_helpdesk_data.xml', - 'crm_lead_data.xml', - 'crm_meeting_data.xml', - 'crm_opportunity_data.xml', - 'crm_phonecall_data.xml', - ], + ], + 'init_xml': ['crm_data.xml', + 'crm_meeting_data.xml', + 'crm_claims_data.xml', + 'crm_fund_data.xml', + 'crm_helpdesk_data.xml', + 'crm_lead_data.xml', + 'crm_meeting_data.xml', + 'crm_opportunity_data.xml', + 'crm_phonecall_data.xml', + ], 'update_xml': [ - 'crm_wizard.xml', - 'crm_view.xml', - 'crm_action_rule_view.xml', - 'crm_lead_wizard.xml', - 'crm_lead_view.xml', - 'crm_lead_menu.xml', - 'crm_meeting_wizard.xml', - 'crm_meeting_view.xml', - 'crm_meeting_menu.xml', - 'crm_phonecall_wizard.xml', - 'crm_phonecall_view.xml', - 'crm_phonecall_menu.xml', - 'crm_opportunity_wizard.xml', - 'crm_opportunity_view.xml', - 'crm_opportunity_menu.xml', - 'crm_fund_view.xml', - 'crm_fund_menu.xml', - 'crm_claims_view.xml', - 'crm_claims_menu.xml', + 'crm_wizard.xml', + 'crm_view.xml', + 'crm_action_rule_view.xml', + 'crm_lead_wizard.xml', + 'crm_lead_view.xml', + 'crm_lead_menu.xml', + 'crm_meeting_wizard.xml', + 'crm_meeting_view.xml', + 'crm_meeting_menu.xml', + 'crm_phonecall_wizard.xml', + 'crm_phonecall_view.xml', + 'crm_phonecall_menu.xml', + 'crm_opportunity_wizard.xml', + 'crm_opportunity_view.xml', + 'crm_opportunity_menu.xml', + 'crm_fund_view.xml', + 'crm_fund_menu.xml', + 'crm_claims_view.xml', + 'crm_claims_menu.xml', 'crm_helpdesk_view.xml', - 'crm_helpdesk_menu.xml', - - 'security/crm_security.xml', - 'security/ir.model.access.csv', + 'crm_helpdesk_menu.xml', + + 'security/crm_security.xml', + 'security/ir.model.access.csv', 'report/crm_report_view.xml', 'report/crm_claim_report_view.xml', 'report/crm_lead_report_view.xml', 'report/crm_fundraising_report_view.xml', - 'report/crm_opportunity_report_view.xml' , + 'report/crm_opportunity_report_view.xml' , 'report/crm_phonecall_report_view.xml', - + 'report/crm_helpdesk_report_view.xml', + 'process/crm_configuration_process.xml', - + ], 'demo_xml': [ - 'crm_demo.xml', - 'crm_claims_demo.xml', - 'crm_fund_demo.xml', - 'crm_helpdesk_demo.xml', - 'crm_lead_demo.xml', - 'crm_meeting_demo.xml', - 'crm_opportunity_demo.xml', - 'crm_phonecall_demo.xml'], - 'installable': True, - 'active': False, - 'certificate': '0079056041421', + 'crm_demo.xml', + 'crm_claims_demo.xml', + 'crm_fund_demo.xml', + 'crm_helpdesk_demo.xml', + 'crm_lead_demo.xml', + 'crm_meeting_demo.xml', + 'crm_opportunity_demo.xml', + 'crm_phonecall_demo.xml'], + 'installable': True, + 'active': False, + 'certificate': '0079056041421', } # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/crm/report/__init__.py b/addons/crm/report/__init__.py index c93c51dd742..7030c43cfe2 100644 --- a/addons/crm/report/__init__.py +++ b/addons/crm/report/__init__.py @@ -26,6 +26,7 @@ import crm_lead_report import crm_phonecall_report import crm_fundraising_report import crm_opportunity_report +import crm_helpdesk_report # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/crm/report/crm_helpdesk_report.py b/addons/crm/report/crm_helpdesk_report.py new file mode 100644 index 00000000000..7a855378d19 --- /dev/null +++ b/addons/crm/report/crm_helpdesk_report.py @@ -0,0 +1,63 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Management Solution +# Copyright (C) 2004-2010 Tiny SPRL (). +# +# 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 tools + +class crm_helpdesk_report(osv.osv): + _name = "crm.helpdesk.report" + _description = "Helpdesk report after Sales Services" + _auto = False + _inherit = "crm.case.report" + _columns = { + 'delay_close': fields.char('Delay to close', size=20, readonly=True), + 'partner_id': fields.many2one('res.partner', 'Partner' ,readonly=True), + 'company_id': fields.many2one('res.company','Company',readonly=True), + 'date_deadline': fields.date('Deadline'), + 'priority': fields.selection([('5','Lowest'),('4','Low'),('3','Normal'),('2','High'),('1','Highest')], 'Priority'), + } + + def init(self, cr): + tools.drop_view_if_exists(cr, 'crm_helpdesk_report') + cr.execute(""" + create or replace view crm_helpdesk_report as ( + select + min(c.id) as id, + to_char(c.create_date, 'YYYY') as name, + to_char(c.create_date, 'MM') as month, + c.state, + c.user_id, + c.section_id, + c.partner_id, + c.company_id, + c.priority, + c.date_deadline, + count(*) as nbr, + 0 as avg_answers, + 0.0 as perc_done, + 0.0 as perc_cancel, + to_char(avg(date_closed-c.create_date), 'DD"d" HH24:MI:SS') as delay_close + from + crm_helpdesk c + group by to_char(c.create_date, 'YYYY'), to_char(c.create_date, 'MM'), c.state, c.user_id,c.section_id,c.priority, c.partner_id,c.company_id,c.date_deadline + )""") +crm_helpdesk_report() + +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/crm/report/crm_helpdesk_report_view.xml b/addons/crm/report/crm_helpdesk_report_view.xml new file mode 100644 index 00000000000..76584094da0 --- /dev/null +++ b/addons/crm/report/crm_helpdesk_report_view.xml @@ -0,0 +1,149 @@ + + + + + + + crm.helpdesk.report.tree + crm.helpdesk.report + tree + + + + + + + + + + + + + + + + + + crm.helpdesk.report.form + crm.helpdesk.report + + form + + + + + + + + + + + + crm.helpdesk.report.graph + crm.helpdesk.report + graph + + + + + + + + + + + crm.helpdesk.report.select + crm.helpdesk.report + search + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Helpdesk + crm.helpdesk.report + form + tree,graph + + + + + + + tree + + + + + + + graph + + + + + + + + + From 45b6062f40061992a6a3b1f55ff3ec5a91ab6158 Mon Sep 17 00:00:00 2001 From: apa-tiny Date: Mon, 15 Mar 2010 17:33:51 +0530 Subject: [PATCH 23/42] [ADD]:Added SQL view report for hr_holidays(Leaves). bzr revid: apa@tinyerp.com-20100315120351-z63dxf4xuzclp2m0 --- addons/hr_holidays/__terp__.py | 1 + addons/hr_holidays/report/__init__.py | 5 +- .../hr_holidays/report/hr_holidays_report.py | 72 +++++++++++++++ .../report/hr_holidays_report_view.xml | 87 +++++++++++++++++++ 4 files changed, 163 insertions(+), 2 deletions(-) create mode 100644 addons/hr_holidays/report/hr_holidays_report.py create mode 100644 addons/hr_holidays/report/hr_holidays_report_view.xml diff --git a/addons/hr_holidays/__terp__.py b/addons/hr_holidays/__terp__.py index f84a026748b..f44fe590015 100644 --- a/addons/hr_holidays/__terp__.py +++ b/addons/hr_holidays/__terp__.py @@ -55,6 +55,7 @@ 'hr_view.xml', 'hr_holidays_report.xml', 'hr_holidays_wizard.xml', + 'report/hr_holidays_report_view.xml', #'process/hr_holidays_process.xml' ], 'demo_xml': [], diff --git a/addons/hr_holidays/report/__init__.py b/addons/hr_holidays/report/__init__.py index 39882f6cd59..bb1f6229bc0 100644 --- a/addons/hr_holidays/report/__init__.py +++ b/addons/hr_holidays/report/__init__.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- ############################################################################## -# +# # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (). # @@ -15,10 +15,11 @@ # 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 . +# along with this program. If not, see . # ############################################################################## import holidays_summary_report +import hr_holidays_report # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/hr_holidays/report/hr_holidays_report.py b/addons/hr_holidays/report/hr_holidays_report.py new file mode 100644 index 00000000000..3672f4e8e06 --- /dev/null +++ b/addons/hr_holidays/report/hr_holidays_report.py @@ -0,0 +1,72 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Management Solution +# Copyright (C) 2004-2010 Tiny SPRL (). +# +# 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 tools +from osv import fields,osv + +class hr_holidays_report(osv.osv): + _name = "hr.holidays.report" + _description = "Leaves Statistics" + _auto = False + _rec_name = 'date' + _columns = { + 'date': fields.date('Date', readonly=True), + 'year': fields.char('Year', size=4, 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), + 'date_from' : fields.datetime('Start Date', readonly=True), + 'date_to' : fields.datetime('End Date', readonly=True), + 'number_of_days_temp': fields.float('Number of Days', readonly=True), + 'employee_id' : fields.many2one('hr.employee', "Employee's Name",readonly=True), + 'user_id':fields.many2one('res.users', 'User', readonly=True), + 'state': fields.selection([('draft', 'Draft'), + ('confirm', 'Waiting Validation'), + ('refuse', 'Refused'), + ('validate', 'Validated'), + ('cancel', 'Cancelled')] + ,'State', readonly=True), + } + _order = 'date desc' + def init(self, cr): + tools.drop_view_if_exists(cr, 'hr_holidays_report') + cr.execute(""" + create or replace view hr_holidays_report as ( + select + min(s.id) as id, + s.create_date as date, + to_char(s.date_from,'YYYY/mm/dd') as date_from, + to_char(s.date_to,'YYYY/mm/dd') as date_to, + s.number_of_days_temp, + s.employee_id, + s.user_id as user_id, + to_char(s.create_date, 'YYYY') as year, + to_char(s.create_date, 'MM') as month, + s.state + from + hr_holidays s + group by + s.create_date,s.state,s.date_from,s.date_to, + s.number_of_days_temp,s.employee_id,s.user_id + ) + """) +hr_holidays_report() + diff --git a/addons/hr_holidays/report/hr_holidays_report_view.xml b/addons/hr_holidays/report/hr_holidays_report_view.xml new file mode 100644 index 00000000000..6a8d1461799 --- /dev/null +++ b/addons/hr_holidays/report/hr_holidays_report_view.xml @@ -0,0 +1,87 @@ + + + + + hr.holidays.report.tree + hr.holidays.report + tree + + + + + + + + + + + + + + + + hr.holidays.report.graph + hr.holidays.report + graph + + + + + + + + + + hr.holidays.report.search + hr.holidays.report + search + + + + + + + + + + + + + + + + + + + + + + + + + + + Leaves + hr.holidays.report + form + tree,graph + + + + + + + From d2dc68d33a92ca7193f8868ece06fc25e86ae114 Mon Sep 17 00:00:00 2001 From: "Vir (Open ERP)" Date: Mon, 15 Mar 2010 17:49:55 +0530 Subject: [PATCH 24/42] [IMP/ADD] crm_helpdesk : improved view of helpdesk and security rules in csv file bzr revid: vir@tinyerp.com-20100315121955-s4n8ro8q7zvd0ce5 --- addons/crm/report/crm_helpdesk_report_view.xml | 3 +-- addons/crm/security/ir.model.access.csv | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/addons/crm/report/crm_helpdesk_report_view.xml b/addons/crm/report/crm_helpdesk_report_view.xml index 76584094da0..06a69333bd7 100644 --- a/addons/crm/report/crm_helpdesk_report_view.xml +++ b/addons/crm/report/crm_helpdesk_report_view.xml @@ -103,14 +103,13 @@ - + - diff --git a/addons/crm/security/ir.model.access.csv b/addons/crm/security/ir.model.access.csv index c3888951d4c..b6c7b0e8735 100644 --- a/addons/crm/security/ir.model.access.csv +++ b/addons/crm/security/ir.model.access.csv @@ -32,4 +32,4 @@ "access_crm_phonecall_report_user","crm.phonecall.report","model_crm_phonecall_report","crm.group_crm_user",1,0,0,0 "access_crm_opportunity_report_user","crm.opportunity.report","model_crm_opportunity_report","crm.group_crm_user",1,0,0,0 "access_report_crm_case_service_dashboard","report.crm.case.service.dashboard","model_report_crm_case_service_dashboard","crm.group_crm_user",1,0,0,0 - +"access_report_crm_helpdesk","report.crm.helpdesk","model_crm_helpdesk_report","crm.group_crm_user",1,0,0,0 From b96373c32505e2420cb6ae81f10ba16ae0939711 Mon Sep 17 00:00:00 2001 From: "Vir (Open ERP)" Date: Mon, 15 Mar 2010 17:57:50 +0530 Subject: [PATCH 25/42] [ADD] hr_holidays : security rules are added bzr revid: vir@tinyerp.com-20100315122750-bofdomun28eqw2ky --- addons/hr_holidays/security/ir.model.access.csv | 1 + 1 file changed, 1 insertion(+) diff --git a/addons/hr_holidays/security/ir.model.access.csv b/addons/hr_holidays/security/ir.model.access.csv index a7fc3d153b5..236b6a8fb89 100644 --- a/addons/hr_holidays/security/ir.model.access.csv +++ b/addons/hr_holidays/security/ir.model.access.csv @@ -2,3 +2,4 @@ "access_hr_holydays_status_user","hr.holidays.status user","model_hr_holidays_status","hr.group_hr_user",1,1,1,1 "access_hr_holidays_user","hr holidays user","model_hr_holidays","hr.group_hr_user",1,1,1,1 "access_hr_holidays_per_user","hr.holidays.per.user","model_hr_holidays_per_user","hr.group_hr_user",1,1,1,1 +"access_hr_holidays_report","hr.holidays.report","model_hr_holidays_report","hr.group_hr_user",1,1,1,1 From 188492607ce730f3aa47c439df20c5fdef8b30d5 Mon Sep 17 00:00:00 2001 From: apa-tiny Date: Tue, 16 Mar 2010 11:19:58 +0530 Subject: [PATCH 26/42] [REM/MOVE]:moved the report_timesheet module into the hr_timesheet_invoice module and removed the report_timesheet module. bzr revid: apa@tinyerp.com-20100316054958-iam0p7psf5izwkzf --- addons/hr_timesheet_invoice/__terp__.py | 1 + .../hr_timesheet_invoice/report/__init__.py | 1 + .../report/hr_timesheet_invoice_report.py} | 0 .../hr_timesheet_invoice_report_view.xml} | 0 .../security/ir.model.access.csv | 6 +++ addons/report_timesheet/__init__.py | 25 ------------ addons/report_timesheet/__terp__.py | 39 ------------------- .../security/ir.model.access.csv | 7 ---- 8 files changed, 8 insertions(+), 71 deletions(-) rename addons/{report_timesheet/report_timesheet.py => hr_timesheet_invoice/report/hr_timesheet_invoice_report.py} (100%) rename addons/{report_timesheet/report_timesheet_view.xml => hr_timesheet_invoice/report/hr_timesheet_invoice_report_view.xml} (100%) delete mode 100644 addons/report_timesheet/__init__.py delete mode 100644 addons/report_timesheet/__terp__.py delete mode 100644 addons/report_timesheet/security/ir.model.access.csv diff --git a/addons/hr_timesheet_invoice/__terp__.py b/addons/hr_timesheet_invoice/__terp__.py index fd07bb28317..f335c7dbd77 100644 --- a/addons/hr_timesheet_invoice/__terp__.py +++ b/addons/hr_timesheet_invoice/__terp__.py @@ -38,6 +38,7 @@ reports, eso.""", 'hr_timesheet_invoice_wizard.xml', 'hr_timesheet_invoice_report.xml', 'report/report_analytic_view.xml', + 'report/hr_timesheet_invoice_report_view.xml', ], 'demo_xml': ['hr_timesheet_invoice_demo.xml'], 'installable': True, diff --git a/addons/hr_timesheet_invoice/report/__init__.py b/addons/hr_timesheet_invoice/report/__init__.py index dc249770c4e..b351c097a12 100644 --- a/addons/hr_timesheet_invoice/report/__init__.py +++ b/addons/hr_timesheet_invoice/report/__init__.py @@ -22,6 +22,7 @@ import cost_ledger import account_analytic_profit import report_analytic +import hr_timesheet_invoice_report # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/report_timesheet/report_timesheet.py b/addons/hr_timesheet_invoice/report/hr_timesheet_invoice_report.py similarity index 100% rename from addons/report_timesheet/report_timesheet.py rename to addons/hr_timesheet_invoice/report/hr_timesheet_invoice_report.py diff --git a/addons/report_timesheet/report_timesheet_view.xml b/addons/hr_timesheet_invoice/report/hr_timesheet_invoice_report_view.xml similarity index 100% rename from addons/report_timesheet/report_timesheet_view.xml rename to addons/hr_timesheet_invoice/report/hr_timesheet_invoice_report_view.xml diff --git a/addons/hr_timesheet_invoice/security/ir.model.access.csv b/addons/hr_timesheet_invoice/security/ir.model.access.csv index a81e229a2e0..6349b4f766c 100644 --- a/addons/hr_timesheet_invoice/security/ir.model.access.csv +++ b/addons/hr_timesheet_invoice/security/ir.model.access.csv @@ -3,3 +3,9 @@ "access_hr_timesheet_invoice_factor_acc_inv","hr_timesheet_invoice.factor.account.invoice","model_hr_timesheet_invoice_factor","account.group_account_invoice",1,1,1,1 "access_report_analytic_account_close","report.analytic.account.close","model_report_analytic_account_close","account.group_account_manager",1,0,0,0 "access_report_account_analytic_line_to_invoice","report.account.analytic.line.to.invoice","model_report_account_analytic_line_to_invoice","account.group_account_manager",1,0,0,0 +"access_report_timesheet_user","report_timesheet.user","model_report_timesheet_user","base.group_user",1,0,0,0 +"access_report_timesheet_account","report_timesheet.account","model_report_timesheet_account","base.group_user",1,0,0,0 +"access_report_timesheet_account_date","report_timesheet.account.date","model_report_timesheet_account_date","base.group_user",1,0,0,0 +"access_report_timesheet_invoice","report_timesheet.invoice","model_report_timesheet_invoice","base.group_user",1,0,0,0 +"access_report_random_timesheet","report_random_timesheet","model_report_random_timesheet","base.group_user",1,0,0,0 +"access_report_random_timesheet_lines","random_timesheet_lines","model_random_timesheet_lines","base.group_user",1,0,0,0 diff --git a/addons/report_timesheet/__init__.py b/addons/report_timesheet/__init__.py deleted file mode 100644 index 4b57906849c..00000000000 --- a/addons/report_timesheet/__init__.py +++ /dev/null @@ -1,25 +0,0 @@ -# -*- coding: utf-8 -*- -############################################################################## -# -# OpenERP, Open Source Management Solution -# Copyright (C) 2004-2010 Tiny SPRL (). -# -# 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 report_timesheet - -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: - diff --git a/addons/report_timesheet/__terp__.py b/addons/report_timesheet/__terp__.py deleted file mode 100644 index 8fcf827af68..00000000000 --- a/addons/report_timesheet/__terp__.py +++ /dev/null @@ -1,39 +0,0 @@ -# -*- coding: utf-8 -*- -############################################################################## -# -# OpenERP, Open Source Management Solution -# Copyright (C) 2004-2010 Tiny SPRL (). -# -# 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 . -# -############################################################################## - - -{ - 'name': 'Timesheet - Reporting', - 'version': '1.0', - 'category': 'Generic Modules/Human Resources', - 'description': """Module to add timesheet views like - All Month, Timesheet By User, Timesheet Of Month, Timesheet By Account""", - 'author': 'Tiny', - 'website': 'http://www.openerp.com', - 'depends': ['hr_timesheet', 'hr_timesheet_invoice'], - 'init_xml': [], - 'update_xml': ['security/ir.model.access.csv', 'report_timesheet_view.xml'], - 'demo_xml': [], - 'installable': True, - 'active': False, - 'certificate': '0078701510301', -} -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/report_timesheet/security/ir.model.access.csv b/addons/report_timesheet/security/ir.model.access.csv deleted file mode 100644 index 84001f23c56..00000000000 --- a/addons/report_timesheet/security/ir.model.access.csv +++ /dev/null @@ -1,7 +0,0 @@ -"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink" -"access_report_timesheet_user","report_timesheet.user","model_report_timesheet_user","base.group_user",1,0,0,0 -"access_report_timesheet_account","report_timesheet.account","model_report_timesheet_account","base.group_user",1,0,0,0 -"access_report_timesheet_account_date","report_timesheet.account.date","model_report_timesheet_account_date","base.group_user",1,0,0,0 -"access_report_timesheet_invoice","report_timesheet.invoice","model_report_timesheet_invoice","base.group_user",1,0,0,0 -"access_report_random_timesheet","report_random_timesheet","model_report_random_timesheet","base.group_user",1,0,0,0 -"access_report_random_timesheet_lines","random_timesheet_lines","model_random_timesheet_lines","base.group_user",1,0,0,0 From a76b058db60682e9c9cebaa33dfb967867eea96e Mon Sep 17 00:00:00 2001 From: apa-tiny Date: Tue, 16 Mar 2010 11:30:23 +0530 Subject: [PATCH 27/42] [MOVE]:moved report_document into the document module. bzr revid: apa@tinyerp.com-20100316060023-uspgbzztn0hlg2lm --- addons/document/__init__.py | 5 +++-- addons/document/__terp__.py | 17 ++++++++------- addons/document/report/__init__.py | 21 +++++++++++++++++++ .../report/document_report.py} | 0 .../report/document_report_view.xml} | 0 addons/document/security/ir.model.access.csv | 8 +++++++ 6 files changed, 41 insertions(+), 10 deletions(-) create mode 100644 addons/document/report/__init__.py rename addons/{report_document/report_document.py => document/report/document_report.py} (100%) rename addons/{report_document/report_document_view.xml => document/report/document_report_view.xml} (100%) diff --git a/addons/document/__init__.py b/addons/document/__init__.py index 547205b1313..694989bdd79 100644 --- a/addons/document/__init__.py +++ b/addons/document/__init__.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- ############################################################################## -# +# # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (). # @@ -15,7 +15,7 @@ # 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 . +# along with this program. If not, see . # ############################################################################## @@ -26,5 +26,6 @@ import document_directory import directory_content import directory_report import document +import report # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/document/__terp__.py b/addons/document/__terp__.py index a9d7026776b..2ffb708738c 100644 --- a/addons/document/__terp__.py +++ b/addons/document/__terp__.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- ############################################################################## -# +# # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (). # @@ -15,7 +15,7 @@ # 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 . +# along with this program. If not, see . # ############################################################################## @@ -24,14 +24,14 @@ 'name': 'Integrated Document Management System', 'version': '1.99', 'category': 'Generic Modules/Others', - 'description': """This is a complete document management system: + 'description': """This is a complete document management system: * User Authentication * Document Indexation - ATTENTION: - - When you install this module in a running company that have already PDF files stored into the database, - you will lose them all. - - After installing this module PDF's are not longer stored into the database, + ATTENTION: + - When you install this module in a running company that have already PDF files stored into the database, + you will lose them all. + - After installing this module PDF's are not longer stored into the database, but in the servers rootpad like /server/bin/filestore. """, 'author': 'Tiny', @@ -42,7 +42,8 @@ 'document_view.xml', 'document_data.xml', 'security/document_security.xml', - 'security/ir.model.access.csv' + 'security/ir.model.access.csv', + 'report/document_report_view.xml' ], 'demo_xml': [ 'document_demo.xml',], 'installable': True, diff --git a/addons/document/report/__init__.py b/addons/document/report/__init__.py new file mode 100644 index 00000000000..bfdeacdaae8 --- /dev/null +++ b/addons/document/report/__init__.py @@ -0,0 +1,21 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Management Solution +# Copyright (C) 2004-2010 Tiny SPRL (). +# +# 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 document_report \ No newline at end of file diff --git a/addons/report_document/report_document.py b/addons/document/report/document_report.py similarity index 100% rename from addons/report_document/report_document.py rename to addons/document/report/document_report.py diff --git a/addons/report_document/report_document_view.xml b/addons/document/report/document_report_view.xml similarity index 100% rename from addons/report_document/report_document_view.xml rename to addons/document/report/document_report_view.xml diff --git a/addons/document/security/ir.model.access.csv b/addons/document/security/ir.model.access.csv index 4993ebc049e..245bcbffeab 100644 --- a/addons/document/security/ir.model.access.csv +++ b/addons/document/security/ir.model.access.csv @@ -11,3 +11,11 @@ "access_document_storage_group_system","document.storage group system","model_document_storage","base.group_user",1,0,0,0 "access_document_directory_dctx_group_document_manager","document.directory.dctx document manager","model_document_directory_dctx","group_document_manager",1,1,1,1 "access_document_directory_dctx_group_system","document.directory.dctx group system","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","document.group_document_manager",1,0,0,0 +"access_report_document_user_group_system","report.document.user group system","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","document.group_document_manager",1,0,0,0 +"access_report_files_partner_group_system","report.files.partner group system","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","document.group_document_manager",1,0,0,0 +"access_report_document_file_group_system","report.document.file group system","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","document.group_document_manager",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 From 696ddf9aafad928dd8da8084d83a8070b23d1719 Mon Sep 17 00:00:00 2001 From: apa-tiny Date: Tue, 16 Mar 2010 11:32:12 +0530 Subject: [PATCH 28/42] [REM]:removed report_document module after merged in to the document module. bzr revid: apa@tinyerp.com-20100316060212-1xixilxdj8zaiogd --- addons/report_document/__init__.py | 23 ----------- addons/report_document/__terp__.py | 41 ------------------- .../security/ir.model.access.csv | 9 ---- 3 files changed, 73 deletions(-) delete mode 100644 addons/report_document/__init__.py delete mode 100644 addons/report_document/__terp__.py delete mode 100644 addons/report_document/security/ir.model.access.csv diff --git a/addons/report_document/__init__.py b/addons/report_document/__init__.py deleted file mode 100644 index 589836526a1..00000000000 --- a/addons/report_document/__init__.py +++ /dev/null @@ -1,23 +0,0 @@ -# -*- coding: utf-8 -*- -############################################################################## -# -# OpenERP, Open Source Management Solution -# Copyright (C) 2004-2010 Tiny SPRL (). -# -# 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 report_document -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: - diff --git a/addons/report_document/__terp__.py b/addons/report_document/__terp__.py deleted file mode 100644 index a75bccbcf05..00000000000 --- a/addons/report_document/__terp__.py +++ /dev/null @@ -1,41 +0,0 @@ -# -*- coding: utf-8 -*- -############################################################################## -# -# OpenERP, Open Source Management Solution -# Copyright (C) 2004-2010 Tiny SPRL (). -# -# 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 . -# -############################################################################## - - -{ - 'name': 'Document Management - Reporting', - 'version': '1.0', - 'category': 'Generic Modules/Document Management', - 'description': """ - Reporting for the Document Management module: - * My Files - * All users Files - """, - 'author': 'Tiny', - 'depends': ['document'], - 'init_xml': [], - 'update_xml': ['report_document_view.xml', 'security/ir.model.access.csv'], - 'demo_xml': [], - 'installable': True, - 'active': False, - 'certificate': '0068012774557', -} -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/report_document/security/ir.model.access.csv b/addons/report_document/security/ir.model.access.csv deleted file mode 100644 index b9a90b3a610..00000000000 --- a/addons/report_document/security/ir.model.access.csv +++ /dev/null @@ -1,9 +0,0 @@ -"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink" -"access_report_document_user_group_document_manager","report.document.user document manager","model_report_document_user","document.group_document_manager",1,0,0,0 -"access_report_document_user_group_system","report.document.user group system","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","document.group_document_manager",1,0,0,0 -"access_report_files_partner_group_system","report.files.partner group system","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","document.group_document_manager",1,0,0,0 -"access_report_document_file_group_system","report.document.file group system","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","document.group_document_manager",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 From 7083ee61a3e11485b31ee570e1cec73d5b2f8afb Mon Sep 17 00:00:00 2001 From: "Vir (Open ERP)" Date: Tue, 16 Mar 2010 14:19:39 +0530 Subject: [PATCH 29/42] [ADD/REMOVED] mrp : Production order report added, files from report_mrp modules are removed to mrp module bzr revid: vir@tinyerp.com-20100316084939-z3iccty0n0rrj35d --- addons/mrp/__terp__.py | 2 + addons/mrp/report/__init__.py | 6 +- addons/mrp/report/mrp_production_order.py | 64 ++++++++++ .../mrp/report/mrp_production_order_view.xml | 115 ++++++++++++++++++ .../report/mrp_report.py} | 0 .../report/mrp_report_view.xml} | 2 +- addons/mrp/security/ir.model.access.csv | 1 + 7 files changed, 187 insertions(+), 3 deletions(-) create mode 100644 addons/mrp/report/mrp_production_order.py create mode 100644 addons/mrp/report/mrp_production_order_view.xml rename addons/{report_mrp/report_mrp.py => mrp/report/mrp_report.py} (100%) rename addons/{report_mrp/report_mrp_view.xml => mrp/report/mrp_report_view.xml} (98%) diff --git a/addons/mrp/__terp__.py b/addons/mrp/__terp__.py index a147266ce1d..feabb8cc123 100644 --- a/addons/mrp/__terp__.py +++ b/addons/mrp/__terp__.py @@ -69,6 +69,8 @@ 'process/service_product_process.xml', 'process/procurement_process.xml', 'mrp_installer.xml', + 'report/mrp_report_view.xml', + 'report/mrp_production_order_view.xml', ], 'demo_xml': ['mrp_demo.xml', 'mrp_order_point.xml'], 'installable': True, diff --git a/addons/mrp/report/__init__.py b/addons/mrp/report/__init__.py index a053b3998b2..471e3440af3 100644 --- a/addons/mrp/report/__init__.py +++ b/addons/mrp/report/__init__.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- ############################################################################## -# +# # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (). # @@ -15,7 +15,7 @@ # 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 . +# along with this program. If not, see . # ############################################################################## @@ -23,6 +23,8 @@ import price import workcenter_load import order import bom_structure +import mrp_report +import mrp_production_order # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/mrp/report/mrp_production_order.py b/addons/mrp/report/mrp_production_order.py new file mode 100644 index 00000000000..ba3e9dd7730 --- /dev/null +++ b/addons/mrp/report/mrp_production_order.py @@ -0,0 +1,64 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Management Solution +# Copyright (C) 2004-2010 Tiny SPRL (). +# +# 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 tools + + +class mrp_production_order(osv.osv): + _name = "mrp.production.order" + _description = "Production Order Report" + _auto = False + _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), + 'reference': fields.char('Reference', size=64, required=True), + 'origin': fields.char('Source Document', size=64), + 'product_id': fields.many2one('product.product', 'Product', required=True, domain=[('type','<>','service')]), + 'state': fields.selection([('draft','Draft'),('picking_except', 'Picking Exception'),('confirmed','Waiting Goods'),('ready','Ready to Produce'),('in_production','In Production'),('cancel','Cancelled'),('done','Done')],'State', readonly=True), + 'scheduled_date':fields.date('Scheduled Date'), + 'location_src_id': fields.many2one('stock.location', 'Raw Materials Location', required=True), + 'location_dest_id': fields.many2one('stock.location', 'Finished Products Location', required=True), + + + } + def init(self, cr): + tools.drop_view_if_exists(cr, 'mrp_production_order') + cr.execute(""" + create or replace view mrp_production_order as ( + select + min(c.id) as id, + to_char(c.create_date, 'YYYY') as name, + to_char(c.create_date, 'MM') as month, + c.state, + c.product_id, + to_date(to_char(c.date_planned, 'dd-MM-YYYY'),'dd-MM-YYYY') as scheduled_date, + c.name as reference, + c.origin, + c.location_src_id, + c.location_dest_id + from + mrp_production c + group by to_char(c.create_date, 'YYYY'), to_char(c.create_date, 'MM'), c.state,c.product_id,to_date(to_char(c.date_planned, 'dd-MM-YYYY'),'dd-MM-YYYY'),c.name,c.location_src_id,c.location_dest_id,c.origin + )""") +mrp_production_order() +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: + diff --git a/addons/mrp/report/mrp_production_order_view.xml b/addons/mrp/report/mrp_production_order_view.xml new file mode 100644 index 00000000000..d3ef3ec82b6 --- /dev/null +++ b/addons/mrp/report/mrp_production_order_view.xml @@ -0,0 +1,115 @@ + + + + + + + mrp.production.order.tree + mrp.production.order + tree + + + + + + + + + + + + + + + + mrp.production.order.form + mrp.production.order + form + +
+ + + + + + + + +
+ + + + + + + + + + + + + + + + mrp.production.order.select + mrp.production.order + search + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Production Order + mrp.production.order + form + tree + + + + + + + tree + + + + + + + + + + + + + +
+
+ diff --git a/addons/report_mrp/report_mrp.py b/addons/mrp/report/mrp_report.py similarity index 100% rename from addons/report_mrp/report_mrp.py rename to addons/mrp/report/mrp_report.py diff --git a/addons/report_mrp/report_mrp_view.xml b/addons/mrp/report/mrp_report_view.xml similarity index 98% rename from addons/report_mrp/report_mrp_view.xml rename to addons/mrp/report/mrp_report_view.xml index c14688d9cbf..5de7c7be34b 100644 --- a/addons/report_mrp/report_mrp_view.xml +++ b/addons/mrp/report/mrp_report_view.xml @@ -98,7 +98,7 @@ form graph,tree - + diff --git a/addons/mrp/security/ir.model.access.csv b/addons/mrp/security/ir.model.access.csv index cdc658ff7c0..ea845f9db51 100644 --- a/addons/mrp/security/ir.model.access.csv +++ b/addons/mrp/security/ir.model.access.csv @@ -32,3 +32,4 @@ "access_mrp_production_stock_worker","mrp.production stock_worker","model_mrp_production","stock.group_stock_user",1,0,0,0 "access_mrp_installer","mrp.installer","model_mrp_installer","mrp.group_mrp_user",1,0,0,0 "access_mrp_product_produce","mrp.product.produce","model_mrp_product_produce","mrp.group_mrp_user",1,0,0,0 +"access_mrp_production_order","mrp.production.order","model_mrp_production_order","mrp.group_mrp_user",,,, From 9d9692ec595ad677cedc5b19dd26ef5e62813b2c Mon Sep 17 00:00:00 2001 From: "Vir (Open ERP)" Date: Tue, 16 Mar 2010 16:16:18 +0530 Subject: [PATCH 30/42] [IMP] Production : graph view added, removed unused dependacany of report_crm. added access rules bzr revid: vir@tinyerp.com-20100316104618-xi7wdoldnnc133ka --- addons/board_manufacturing/__terp__.py | 2 +- .../board_manufacturing_view.xml | 4 +- addons/mrp/report/mrp_production_order.py | 2 + .../mrp/report/mrp_production_order_view.xml | 38 +++++++++---------- addons/mrp/security/ir.model.access.csv | 4 +- addons/point_of_sale/__terp__.py | 2 +- addons/point_of_sale/statement_data.xml | 2 +- addons/report_mrp/__terp__.py | 6 +-- .../report_mrp/security/ir.model.access.csv | 4 +- 9 files changed, 33 insertions(+), 31 deletions(-) diff --git a/addons/board_manufacturing/__terp__.py b/addons/board_manufacturing/__terp__.py index 9c644262969..50afa0d6cbc 100644 --- a/addons/board_manufacturing/__terp__.py +++ b/addons/board_manufacturing/__terp__.py @@ -32,7 +32,7 @@ * List of procurement in exception """, 'author': 'Tiny', - 'depends': ['board', 'mrp', 'stock', 'report_mrp'], + 'depends': ['board', 'mrp', 'stock' ], 'update_xml': ['board_manufacturing_view.xml'], 'demo_xml': ['board_manufacturing_demo.xml'], 'installable': True, diff --git a/addons/board_manufacturing/board_manufacturing_view.xml b/addons/board_manufacturing/board_manufacturing_view.xml index 7e913209c4a..df4a6805afb 100644 --- a/addons/board_manufacturing/board_manufacturing_view.xml +++ b/addons/board_manufacturing/board_manufacturing_view.xml @@ -20,9 +20,9 @@ - + - + diff --git a/addons/mrp/report/mrp_production_order.py b/addons/mrp/report/mrp_production_order.py index ba3e9dd7730..d2299a19731 100644 --- a/addons/mrp/report/mrp_production_order.py +++ b/addons/mrp/report/mrp_production_order.py @@ -32,6 +32,7 @@ class mrp_production_order(osv.osv): ('07','July'), ('08','August'), ('09','September'), ('10','October'), ('11','November'), ('12','December')],'Month',readonly=True), 'reference': fields.char('Reference', size=64, required=True), 'origin': fields.char('Source Document', size=64), + 'nbr': fields.integer('# of Orders', readonly=True), 'product_id': fields.many2one('product.product', 'Product', required=True, domain=[('type','<>','service')]), 'state': fields.selection([('draft','Draft'),('picking_except', 'Picking Exception'),('confirmed','Waiting Goods'),('ready','Ready to Produce'),('in_production','In Production'),('cancel','Cancelled'),('done','Done')],'State', readonly=True), 'scheduled_date':fields.date('Scheduled Date'), @@ -50,6 +51,7 @@ class mrp_production_order(osv.osv): to_char(c.create_date, 'MM') as month, c.state, c.product_id, + count(*) as nbr, to_date(to_char(c.date_planned, 'dd-MM-YYYY'),'dd-MM-YYYY') as scheduled_date, c.name as reference, c.origin, diff --git a/addons/mrp/report/mrp_production_order_view.xml b/addons/mrp/report/mrp_production_order_view.xml index d3ef3ec82b6..841c1b9084e 100644 --- a/addons/mrp/report/mrp_production_order_view.xml +++ b/addons/mrp/report/mrp_production_order_view.xml @@ -17,6 +17,7 @@ + @@ -39,18 +40,17 @@ - - - - - - - - - - - - + + mrp.production.order.graph + mrp.production.order + graph + + + + + + + mrp.production.order.select @@ -89,7 +89,7 @@ Production Order mrp.production.order form - tree + tree,graph @@ -101,12 +101,12 @@ - - - - - - + + + graph + + + diff --git a/addons/mrp/security/ir.model.access.csv b/addons/mrp/security/ir.model.access.csv index ea845f9db51..9913071038c 100644 --- a/addons/mrp/security/ir.model.access.csv +++ b/addons/mrp/security/ir.model.access.csv @@ -32,4 +32,6 @@ "access_mrp_production_stock_worker","mrp.production stock_worker","model_mrp_production","stock.group_stock_user",1,0,0,0 "access_mrp_installer","mrp.installer","model_mrp_installer","mrp.group_mrp_user",1,0,0,0 "access_mrp_product_produce","mrp.product.produce","model_mrp_product_produce","mrp.group_mrp_user",1,0,0,0 -"access_mrp_production_order","mrp.production.order","model_mrp_production_order","mrp.group_mrp_user",,,, +"access_mrp_production_order","mrp.production.order","model_mrp_production_order","mrp.group_mrp_user",1,0,0,0 +"access_report_workcenter_load","report.workcenter.load","model_report_workcenter_load","mrp.group_mrp_manager",1,0,0,0 +"access_report_mrp_inout","report.mrp.inout","model_report_mrp_inout","mrp.group_mrp_manager",1,0,0,0 diff --git a/addons/point_of_sale/__terp__.py b/addons/point_of_sale/__terp__.py index 794793e3baa..e094d9dcb37 100644 --- a/addons/point_of_sale/__terp__.py +++ b/addons/point_of_sale/__terp__.py @@ -36,7 +36,7 @@ Main features : """, 'author': 'Tiny', - 'depends': ['sale', 'delivery','report_mrp'], + 'depends': ['sale', 'delivery'], # 'depends': ['sale', 'purchase', 'account', 'account_tax_include','board','mrp','board_manufacturing','delivery','profile_manufacturing','account','multi_company'], 'init_xml': [ 'security/point_of_sale_security.xml', diff --git a/addons/point_of_sale/statement_data.xml b/addons/point_of_sale/statement_data.xml index 641cb8e52cf..947348a990d 100644 --- a/addons/point_of_sale/statement_data.xml +++ b/addons/point_of_sale/statement_data.xml @@ -33,7 +33,7 @@ - + diff --git a/addons/report_mrp/__terp__.py b/addons/report_mrp/__terp__.py index b58dbd5c601..5f14cc517b8 100644 --- a/addons/report_mrp/__terp__.py +++ b/addons/report_mrp/__terp__.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- ############################################################################## -# +# # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (). # @@ -15,7 +15,7 @@ # 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 . +# along with this program. If not, see . # ############################################################################## @@ -30,7 +30,7 @@ 'website': 'http://www.openerp.com', 'depends': ['mrp'], 'init_xml': [], - 'update_xml': ['security/ir.model.access.csv', 'report_mrp_view.xml'], + 'update_xml': ['security/ir.model.access.csv', ], 'demo_xml': [], 'installable': True, 'certificate': '0071582896029', diff --git a/addons/report_mrp/security/ir.model.access.csv b/addons/report_mrp/security/ir.model.access.csv index 57029b92b13..0343f29f43a 100644 --- a/addons/report_mrp/security/ir.model.access.csv +++ b/addons/report_mrp/security/ir.model.access.csv @@ -1,3 +1 @@ -id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink -access_report_workcenter_load,report.workcenter.load,model_report_workcenter_load,mrp.group_mrp_manager,1,0,0,0 -access_report_mrp_inout,report.mrp.inout,model_report_mrp_inout,mrp.group_mrp_manager,1,0,0,0 +"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink" From d874db29929506d23e03764999888eb38477b675 Mon Sep 17 00:00:00 2001 From: apa-tiny Date: Tue, 16 Mar 2010 16:22:10 +0530 Subject: [PATCH 31/42] [ADD]:Added SQL view report for hr_recruitment. bzr revid: apa@tinyerp.com-20100316105210-gwtcjr1pdzb9un0x --- addons/hr_recruitment/__terp__.py | 2 +- addons/hr_recruitment/report/__init__.py | 2 +- .../report/hr_recruitment_report.py | 66 +++++++++++ .../report/hr_recruitment_report_view.xml | 110 ++++++++++++++++++ addons/hr_recruitment/report/report_hr_hr.py | 3 - addons/hr_recruitment/report_hr_hr_view.xml | 6 - 6 files changed, 178 insertions(+), 11 deletions(-) create mode 100644 addons/hr_recruitment/report/hr_recruitment_report.py create mode 100644 addons/hr_recruitment/report/hr_recruitment_report_view.xml delete mode 100644 addons/hr_recruitment/report/report_hr_hr.py delete mode 100644 addons/hr_recruitment/report_hr_hr_view.xml diff --git a/addons/hr_recruitment/__terp__.py b/addons/hr_recruitment/__terp__.py index e80b22bb9db..59f74ea4e69 100644 --- a/addons/hr_recruitment/__terp__.py +++ b/addons/hr_recruitment/__terp__.py @@ -42,10 +42,10 @@ system to store and search in your CV base. 'hr_hr_wizard.xml', 'hr_hr_view.xml', 'hr_hr_menu.xml', - 'report_hr_hr_view.xml', 'security/hr_hr_security.xml', 'security/ir.model.access.csv', 'board_hr_hr_statistical_view.xml', + 'report/hr_recruitment_report_view.xml' ], 'demo_xml': [ 'hr_hr_demo.xml' diff --git a/addons/hr_recruitment/report/__init__.py b/addons/hr_recruitment/report/__init__.py index 418da576c4e..86094f98916 100644 --- a/addons/hr_recruitment/report/__init__.py +++ b/addons/hr_recruitment/report/__init__.py @@ -20,6 +20,6 @@ # ############################################################################## -import report_hr_hr +import hr_recruitment_report # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/hr_recruitment/report/hr_recruitment_report.py b/addons/hr_recruitment/report/hr_recruitment_report.py new file mode 100644 index 00000000000..a3a92fb66a3 --- /dev/null +++ b/addons/hr_recruitment/report/hr_recruitment_report.py @@ -0,0 +1,66 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Management Solution +# Copyright (C) 2004-2010 Tiny SPRL (). +# +# 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 tools +from osv import fields,osv +from hr_recruitment import hr_hr + +class hr_recruitment_report(osv.osv): + _name = "hr.recruitment.report" + _description = "Recruitments Statistics" + _inherit = "crm.case.report" + _auto = False + _rec_name = 'date' + _columns = { + 'date': fields.datetime('Date', readonly=True), + 'job_id': fields.many2one('hr.job', 'Applied Job',readonly=True), + 'stage_id': fields.many2one ('crm.case.stage', 'Stage', domain="[('section_id','=',section_id),('object_id.model', '=', 'hr.applicant')]",readonly=True), + 'type_id': fields.many2one('crm.case.resource.type', 'Degree', domain="[('section_id','=',section_id),('object_id.model', '=', 'hr.applicant')]"), + 'department_id':fields.many2one('hr.department','Department',readonly=True), + 'priority': fields.selection(hr_hr.AVAILABLE_PRIORITIES, 'Appreciation'), + + } + _order = 'date desc' + def init(self, cr): + tools.drop_view_if_exists(cr, 'hr_recruitment_report') + cr.execute(""" + create or replace view hr_recruitment_report as ( + select + min(s.id) as id, + s.date as date, + to_char(s.date, 'YYYY') as name, + to_char(s.date, 'MM') as month, + s.state, + s.company_id, + s.user_id, + s.job_id, + s.type_id, + s.department_id, + s.priority, + s.stage_id + from hr_applicant s + group by + s.date,s.state,s.company_id,s.user_id,s.stage_id,s.type_id,s.priority, + s.job_id,s.department_id + ) + """) +hr_recruitment_report() + diff --git a/addons/hr_recruitment/report/hr_recruitment_report_view.xml b/addons/hr_recruitment/report/hr_recruitment_report_view.xml new file mode 100644 index 00000000000..523fd7e62a4 --- /dev/null +++ b/addons/hr_recruitment/report/hr_recruitment_report_view.xml @@ -0,0 +1,110 @@ + + + + + hr.recruitment.report.tree + hr.recruitment.report + tree + + + + + + + + + + + + + + + + + + + + hr.recruitment.report.search + hr.recruitment.report + search + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Recruitments + hr.recruitment.report + form + tree,graph + + + + + + + diff --git a/addons/hr_recruitment/report/report_hr_hr.py b/addons/hr_recruitment/report/report_hr_hr.py deleted file mode 100644 index b49de4f66d5..00000000000 --- a/addons/hr_recruitment/report/report_hr_hr.py +++ /dev/null @@ -1,3 +0,0 @@ -from osv import fields,osv -import tools - diff --git a/addons/hr_recruitment/report_hr_hr_view.xml b/addons/hr_recruitment/report_hr_hr_view.xml deleted file mode 100644 index 1fbce7663ea..00000000000 --- a/addons/hr_recruitment/report_hr_hr_view.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - From 8ea773c793398546341f31360cde91a5f23fecef Mon Sep 17 00:00:00 2001 From: apa-tiny Date: Tue, 16 Mar 2010 17:06:20 +0530 Subject: [PATCH 32/42] [FIX]:hr_holidays:Fixed the problem when run the print screen report. bzr revid: apa@tinyerp.com-20100316113620-qlvud6n1adx03uvk --- addons/hr_holidays/report/hr_holidays_report.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/addons/hr_holidays/report/hr_holidays_report.py b/addons/hr_holidays/report/hr_holidays_report.py index 3672f4e8e06..59a0a361eeb 100644 --- a/addons/hr_holidays/report/hr_holidays_report.py +++ b/addons/hr_holidays/report/hr_holidays_report.py @@ -28,7 +28,7 @@ class hr_holidays_report(osv.osv): _auto = False _rec_name = 'date' _columns = { - 'date': fields.date('Date', readonly=True), + 'date': fields.datetime('Date', readonly=True), 'year': fields.char('Year', size=4, readonly=True), 'month':fields.selection([('01','January'), ('02','February'), ('03','March'), ('04','April'), ('05','May'), ('06','June'), ('07','July'), ('08','August'), ('09','September'), @@ -52,9 +52,9 @@ class hr_holidays_report(osv.osv): create or replace view hr_holidays_report as ( select min(s.id) as id, - s.create_date as date, - to_char(s.date_from,'YYYY/mm/dd') as date_from, - to_char(s.date_to,'YYYY/mm/dd') as date_to, + date_trunc('seconds',s.create_date) as date, + date_trunc('day',s.date_from) as date_from, + date_trunc('day',s.date_to) as date_to, s.number_of_days_temp, s.employee_id, s.user_id as user_id, From 9bbc85331418090a81d2d221ce02e20bfa04677d Mon Sep 17 00:00:00 2001 From: apa-tiny Date: Tue, 16 Mar 2010 17:47:33 +0530 Subject: [PATCH 33/42] [REM]:removed report_mrp module after merged into the mrp. bzr revid: apa@tinyerp.com-20100316121733-mux7c3hklm4a1gou --- addons/report_mrp/__init__.py | 25 ------------ addons/report_mrp/__terp__.py | 38 ------------------- .../report_mrp/security/ir.model.access.csv | 1 - 3 files changed, 64 deletions(-) delete mode 100644 addons/report_mrp/__init__.py delete mode 100644 addons/report_mrp/__terp__.py delete mode 100644 addons/report_mrp/security/ir.model.access.csv diff --git a/addons/report_mrp/__init__.py b/addons/report_mrp/__init__.py deleted file mode 100644 index cac56f5f3bf..00000000000 --- a/addons/report_mrp/__init__.py +++ /dev/null @@ -1,25 +0,0 @@ -# -*- coding: utf-8 -*- -############################################################################## -# -# OpenERP, Open Source Management Solution -# Copyright (C) 2004-2010 Tiny SPRL (). -# -# 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 report_mrp - -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: - diff --git a/addons/report_mrp/__terp__.py b/addons/report_mrp/__terp__.py deleted file mode 100644 index 5f14cc517b8..00000000000 --- a/addons/report_mrp/__terp__.py +++ /dev/null @@ -1,38 +0,0 @@ -# -*- coding: utf-8 -*- -############################################################################## -# -# OpenERP, Open Source Management Solution -# Copyright (C) 2004-2010 Tiny SPRL (). -# -# 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 . -# -############################################################################## - - -{ - 'name': 'MRP Management - Reporting', - 'version': '1.0', - 'category': 'Generic Modules/Production', - 'description': """A module that adds new reports based on MRP cases. - Work Center loads, Weekly Stock value variation""", - 'author': 'Tiny', - 'website': 'http://www.openerp.com', - 'depends': ['mrp'], - 'init_xml': [], - 'update_xml': ['security/ir.model.access.csv', ], - 'demo_xml': [], - 'installable': True, - 'certificate': '0071582896029', -} -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/report_mrp/security/ir.model.access.csv b/addons/report_mrp/security/ir.model.access.csv deleted file mode 100644 index 0343f29f43a..00000000000 --- a/addons/report_mrp/security/ir.model.access.csv +++ /dev/null @@ -1 +0,0 @@ -"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink" From c9f398d390a4c6a1d61059a37ce90426f287ee2c Mon Sep 17 00:00:00 2001 From: "RCH(Open ERP)" <> Date: Tue, 16 Mar 2010 18:15:05 +0530 Subject: [PATCH 34/42] [ADD/IMP] project_issue : improved report of bug and feature. project_timeshee : report_task reports are moved to the project_timesheet. bzr revid: vir@tinyerp.com-20100316124505-qz5vyhuu4jfbqotd --- addons/crm/report/crm_report_view.xml | 18 +-- .../report/project_issue_report.py | 18 ++- .../report/project_issue_report_view.xml | 71 ++++++++--- addons/project_timesheet/__init__.py | 5 +- addons/project_timesheet/__terp__.py | 2 +- addons/project_timesheet/report/__init__.py | 23 ++++ .../report/task_report.py} | 73 +++++------ .../report/task_report_view.xml} | 116 ++++++++++-------- .../security/ir.model.access.csv | 3 + .../report_task/security/ir.model.access.csv | 4 - 10 files changed, 206 insertions(+), 127 deletions(-) create mode 100644 addons/project_timesheet/report/__init__.py rename addons/{report_task/report_task.py => project_timesheet/report/task_report.py} (70%) rename addons/{report_task/report_task_view.xml => project_timesheet/report/task_report_view.xml} (51%) create mode 100644 addons/project_timesheet/security/ir.model.access.csv delete mode 100644 addons/report_task/security/ir.model.access.csv diff --git a/addons/crm/report/crm_report_view.xml b/addons/crm/report/crm_report_view.xml index 7427fe64588..aa5eadde787 100644 --- a/addons/crm/report/crm_report_view.xml +++ b/addons/crm/report/crm_report_view.xml @@ -1,6 +1,6 @@ - + crm.case.report.tree @@ -56,11 +56,11 @@ - + - + - + + + @@ -87,12 +89,12 @@ - + - + @@ -112,7 +114,7 @@ - + @@ -162,6 +164,6 @@ [('state','=','open')] - + diff --git a/addons/project_issue/report/project_issue_report.py b/addons/project_issue/report/project_issue_report.py index 2e3bf4b2d58..74444780b57 100644 --- a/addons/project_issue/report/project_issue_report.py +++ b/addons/project_issue/report/project_issue_report.py @@ -1,15 +1,21 @@ from osv import fields,osv import tools +from crm import crm class project_issue_report(osv.osv): - _name = "project.issue.report" + _name = "project.issue.report" _auto = False _inherit = "crm.case.report" _columns = { 'categ_id': fields.many2one('crm.case.categ', 'Category', domain="[('section_id','=',section_id),('object_id.model', '=', 'project.issue.report')]"), - 'stage_id': fields.many2one ('crm.case.stage', 'Stage', domain="[('object_id.model', '=', 'project.issue.report')]"), + 'stage_id': fields.many2one ('crm.case.stage', 'Stage', domain="[('object_id.model', '=', 'project.issue.report')]"), 'nbr': fields.integer('# of Issues', reaadonly=True), 'delay_close': fields.char('Delay to close', size=20, readonly=True), + 'company_id' : fields.many2one('res.company', 'Company'), + 'priority': fields.selection(crm.AVAILABLE_PRIORITIES, 'Priority'), + 'project_id':fields.many2one('project.project', 'Project'), + 'type_id': fields.many2one('crm.case.resource.type', 'Bug Type', domain="[('object_id.model', '=', 'project.issue')]"), + 'date_closed': fields.datetime('Close Date', readonly=True), } def init(self, cr): tools.drop_view_if_exists(cr, 'project_issue_report') @@ -24,11 +30,19 @@ class project_issue_report(osv.osv): c.section_id, c.categ_id, c.stage_id, + to_char(c.date_closed, 'YYYY/mm/dd') as date_closed, + u.company_id as company_id, + c.priority as priority, + c.project_id as project_id, + c.type_id as type_id, count(*) as nbr, to_char(avg(date_closed-c.create_date), 'DD"d" HH24:MI:SS') as delay_close from project_issue c + left join + res_users u on (c.id = u.id) group by to_char(c.create_date, 'YYYY'), to_char(c.create_date, 'MM'), c.state, c.user_id,c.section_id,c.categ_id,c.stage_id + ,c.date_closed,u.company_id,c.priority,c.project_id,c.type_id )""") diff --git a/addons/project_issue/report/project_issue_report_view.xml b/addons/project_issue/report/project_issue_report_view.xml index dd379c91fe0..72d665cdff0 100644 --- a/addons/project_issue/report/project_issue_report_view.xml +++ b/addons/project_issue/report/project_issue_report_view.xml @@ -1,9 +1,7 @@ - + project.issue.report.tree project.issue.report @@ -12,19 +10,22 @@ + + + + + - - - + - + project.issue.report.graph project.issue.report @@ -43,22 +44,64 @@ search - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - Project Issue Report + Project Issue project.issue.report form graph,tree - - + + tree @@ -70,9 +113,9 @@ graph - + - + diff --git a/addons/project_timesheet/__init__.py b/addons/project_timesheet/__init__.py index 6c907cff3bf..9dd42114b9c 100644 --- a/addons/project_timesheet/__init__.py +++ b/addons/project_timesheet/__init__.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- ############################################################################## -# +# # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (). # @@ -15,9 +15,10 @@ # 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 . +# along with this program. If not, see . # ############################################################################## import project_timesheet +import report # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/project_timesheet/__terp__.py b/addons/project_timesheet/__terp__.py index 8e4cbb898a7..f98a796a935 100644 --- a/addons/project_timesheet/__terp__.py +++ b/addons/project_timesheet/__terp__.py @@ -33,7 +33,7 @@ 'website': 'http://www.openerp.com', 'depends': ['base', 'project', 'hr_timesheet_sheet'], 'init_xml': [], - 'update_xml': ["process/project_timesheet_process.xml"], + 'update_xml': ["process/project_timesheet_process.xml", "report/task_report_view.xml"], 'demo_xml': [], 'installable': True, 'active': False, diff --git a/addons/project_timesheet/report/__init__.py b/addons/project_timesheet/report/__init__.py new file mode 100644 index 00000000000..232b71a8975 --- /dev/null +++ b/addons/project_timesheet/report/__init__.py @@ -0,0 +1,23 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Management Solution +# Copyright (C) 2004-2010 Tiny SPRL (). +# +# 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 task_report +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: + diff --git a/addons/report_task/report_task.py b/addons/project_timesheet/report/task_report.py similarity index 70% rename from addons/report_task/report_task.py rename to addons/project_timesheet/report/task_report.py index 54792395053..3b2468ccd7f 100644 --- a/addons/report_task/report_task.py +++ b/addons/project_timesheet/report/task_report.py @@ -21,13 +21,14 @@ from osv import fields,osv import mx.DateTime +import tools -class report_task_user_pipeline_open (osv.osv): - _name = "report.task.user.pipeline.open" - _description = "Tasks by user and project" +class task_report(osv.osv): + _name = "task.report" + _description = "Project task report" _auto = False _columns = { - 'name': fields.char('Year',size=64,required=False, readonly=True), + 'name': fields.char('Task',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), 'user_id':fields.many2one('res.users', 'User', readonly=True), @@ -36,17 +37,36 @@ class report_task_user_pipeline_open (osv.osv): 'task_progress': fields.float('Task Progress', readonly=True), 'company_id' : fields.many2one('res.company', 'Company'), 'task_state': fields.selection([('draft', 'Draft'),('open', 'Open'),('pending', 'Pending'), ('cancelled', 'Cancelled'), ('done', 'Done'),('no','No Task')], 'Status', readonly=True), + 'project_id':fields.many2one('project.project', 'Project'), + 'year': fields.char('Year',size=64,required=False, readonly=True), + 'date_start': fields.datetime('Starting Date',readonly=True), + 'date_end': fields.datetime('Ending Date',readonly=True), + 'date_deadline': fields.date('Deadline',readonly=True), + 'type': fields.many2one('project.task.type', 'Stage'), + 'priority' : fields.selection([('4','Very Low'), ('3','Low'), ('2','Medium'), ('1','Urgent'), ('0','Very urgent')], 'Importance'), + 'assign_to': fields.many2one('res.users', 'Assigned to', readonly=True), + 'remaining_hrs': fields.float('Remaining Hours', readonly=True), } def init(self, cr): + tools.sql.drop_view_if_exists(cr, 'task_report') cr.execute(''' - create or replace view report_task_user_pipeline_open as ( + create or replace view task_report as ( select min(t.id) as id, - to_char(t.create_date, 'YYYY') as name, + to_char(t.create_date, 'YYYY') as year, to_char(t.create_date,'MM') as month, u.id as user_id, u.company_id as company_id, + t.name as name, + t.project_id as project_id, + to_char(t.date_start,'YYYY/mm/dd') as date_start, + to_char(t.date_end,'YYYY/mm/dd') as date_end, + to_char(t.date_deadline,'YYYY/mm/dd') as date_deadline, + t.type as type, + t.priority as priority, + t.user_id as assign_to, + t.remaining_hours as remaining_hrs, count(t.*) as task_nbr, sum(t.planned_hours) as task_hrs, sum(t.planned_hours * (100 - t.progress) / 100) as task_progress, @@ -59,46 +79,11 @@ class report_task_user_pipeline_open (osv.osv): u.active group by to_char(t.create_date, 'YYYY'),to_char(t.create_date,'MM'),u.id, u.company_id, t.state + ,t.name,t.project_id,t.type,t.priority, + t.user_id,t.remaining_hours,to_char(t.date_start,'YYYY/mm/dd'),to_char(t.date_end,'YYYY/mm/dd'),to_char(t.date_deadline,'YYYY/mm/dd') ) ''') -report_task_user_pipeline_open() - -class report_closed_task(osv.osv): - _name = "report.closed.task" - _description = "Closed Task Report" - _auto = False - _columns = { - 'sequence': fields.integer('Sequence', readonly=True, help="Gives the sequence order when displaying a list of closed task reports."), - 'name': fields.char('Task summary', size=128, readonly=True), - 'project_id': fields.many2one('project.project', 'Project', readonly=True), - 'user_id': fields.many2one('res.users', 'Assigned to', readonly=True), - 'date_deadline': fields.datetime('Deadline', readonly=True), - 'planned_hours': fields.float('Planned Hours', readonly=True), - 'delay_hours': fields.float('Delay Hours', readonly=True), - 'progress': fields.float('Progress (%)', readonly=True), - 'priority' : fields.selection([('4','Very Low'), ('3','Low'), ('2','Medium'), ('1','Urgent'), ('0','Very urgent')], 'Importance', readonly=True), - 'state': fields.selection([('draft', 'Draft'),('open', 'In Progress'),('pending', 'Pending'), ('cancelled', 'Cancelled'), ('done', 'Done')], 'Status', readonly=True), - 'remaining_hours': fields.float('Remaining Hours', readonly=True), - 'date_end' : fields.datetime('Date Closed', readonly=True) - } - - def init(self, cr): - cr.execute(''' - create or replace view report_closed_task as ( - select - tsk.id as id, tsk.sequence as sequence, tsk.name as name, - tsk.project_id as project_id, tsk.user_id as user_id, - tsk.date_deadline as date_deadline, tsk.planned_hours as planned_hours, - tsk.delay_hours as delay_hours, tsk.progress as progress, - tsk.priority as priority, tsk.state as state, - tsk.remaining_hours as remaining_hours, tsk.date_end as date_end - from - project_task tsk - where - (tsk.date_end <= CURRENT_DATE AND tsk.date_end > (CURRENT_DATE-15)) - ) - ''') -report_closed_task() +task_report() class report_timesheet_task_user(osv.osv): _name = "report.timesheet.task.user" diff --git a/addons/report_task/report_task_view.xml b/addons/project_timesheet/report/task_report_view.xml similarity index 51% rename from addons/report_task/report_task_view.xml rename to addons/project_timesheet/report/task_report_view.xml index 77ea6e1aa5c..732c656c92e 100644 --- a/addons/report_task/report_task_view.xml +++ b/addons/project_timesheet/report/task_report_view.xml @@ -1,6 +1,6 @@ - + - + - report.project.task.form - report.task.user.pipeline.open + task.report.form + task.report form
@@ -27,8 +27,8 @@ - report.project.task.graph - report.task.user.pipeline.open + task.report.graph + task.report graph @@ -39,14 +39,23 @@ - report.project.task.tree - report.task.user.pipeline.open + task.report.tree + task.report tree + - - + + + + + + + + + + @@ -56,67 +65,70 @@ - - report.task.user.pipeline.open.search - report.task.user.pipeline.open + + task.report.search + task.report search - + - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + - Tasks by User - report.task.user.pipeline.open + Tasks + task.report form tree,graph [] - + - - - - report.closed.task.tree - report.closed.task - tree - - - - - - - - - - - - - - - - - - - - Task Closed Within Past 15 Days - report.closed.task - form - tree,form - - - diff --git a/addons/project_timesheet/security/ir.model.access.csv b/addons/project_timesheet/security/ir.model.access.csv new file mode 100644 index 00000000000..42c3ea0d15c --- /dev/null +++ b/addons/project_timesheet/security/ir.model.access.csv @@ -0,0 +1,3 @@ +"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink" +"access_task_report","report.task.report","model_task_report","project.group_project_manager",1,0,0,0 +"access_report_timesheet_task_user","report.timesheet.task.user","model_report_timesheet_task_user","project.group_project_manager",1,0,0,0 diff --git a/addons/report_task/security/ir.model.access.csv b/addons/report_task/security/ir.model.access.csv deleted file mode 100644 index 68361fbd928..00000000000 --- a/addons/report_task/security/ir.model.access.csv +++ /dev/null @@ -1,4 +0,0 @@ -"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink" -"access_report_task_user_pipeline_open","report.task.user.pipeline.open","model_report_task_user_pipeline_open","project.group_project_manager",1,0,0,0 -"access_report_timesheet_task_user","report.timesheet.task.user","model_report_timesheet_task_user","project.group_project_manager",1,0,0,0 -"access_report_closed_task","report.closed.task","model_report_closed_task","project.group_project_manager",1,0,0,0 From 3b943b4d685085c08404ab77d43c087684ce4af5 Mon Sep 17 00:00:00 2001 From: "Vir (Open ERP)" Date: Tue, 16 Mar 2010 18:19:21 +0530 Subject: [PATCH 35/42] [REM] report_task : unused files are removed bzr revid: vir@tinyerp.com-20100316124921-7fconbhk0ny9h4s2 --- addons/report_task/__init__.py | 25 ----------------------- addons/report_task/__terp__.py | 36 ---------------------------------- 2 files changed, 61 deletions(-) delete mode 100644 addons/report_task/__init__.py delete mode 100644 addons/report_task/__terp__.py diff --git a/addons/report_task/__init__.py b/addons/report_task/__init__.py deleted file mode 100644 index 38945a471fe..00000000000 --- a/addons/report_task/__init__.py +++ /dev/null @@ -1,25 +0,0 @@ -# -*- coding: utf-8 -*- -############################################################################## -# -# OpenERP, Open Source Management Solution -# Copyright (C) 2004-2010 Tiny SPRL (). -# -# 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 report_task - -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: - diff --git a/addons/report_task/__terp__.py b/addons/report_task/__terp__.py deleted file mode 100644 index 843bfa4c79e..00000000000 --- a/addons/report_task/__terp__.py +++ /dev/null @@ -1,36 +0,0 @@ -# -*- coding: utf-8 -*- -############################################################################## -# -# OpenERP, Open Source Management Solution -# Copyright (C) 2004-2010 Tiny SPRL (). -# -# 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 . -# -############################################################################## - - -{ - 'name': 'Report on tasks by user for projects', - 'version': '1.0', - 'category': 'Generic Modules/Projects & Services', - 'description': """Gives statistics on tasks by user on projects to check the pipeline of users.""", - 'author': 'Tiny', - 'depends': ['base', 'project','hr_timesheet_sheet'], - 'init_xml': [], - 'update_xml': ['security/ir.model.access.csv', 'report_task_view.xml'], - 'installable': True, - 'active': False, - 'certificate': '0027671328157', -} -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: From 1a89fb49b3f9a75670fe9b09e31144032ad21626 Mon Sep 17 00:00:00 2001 From: apa-tiny Date: Tue, 16 Mar 2010 19:04:49 +0530 Subject: [PATCH 36/42] [IMP]:improved graph views for recruitment report. bzr revid: apa@tinyerp.com-20100316133449-sohf8brw2ayk7faq --- addons/hr_recruitment/report/hr_recruitment_report.py | 3 ++- .../hr_recruitment/report/hr_recruitment_report_view.xml | 8 ++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/addons/hr_recruitment/report/hr_recruitment_report.py b/addons/hr_recruitment/report/hr_recruitment_report.py index a3a92fb66a3..2f48dabd7a9 100644 --- a/addons/hr_recruitment/report/hr_recruitment_report.py +++ b/addons/hr_recruitment/report/hr_recruitment_report.py @@ -55,7 +55,8 @@ class hr_recruitment_report(osv.osv): s.type_id, s.department_id, s.priority, - s.stage_id + s.stage_id, + count(*) as nbr from hr_applicant s group by s.date,s.state,s.company_id,s.user_id,s.stage_id,s.type_id,s.priority, diff --git a/addons/hr_recruitment/report/hr_recruitment_report_view.xml b/addons/hr_recruitment/report/hr_recruitment_report_view.xml index 523fd7e62a4..30f1ec3d8ed 100644 --- a/addons/hr_recruitment/report/hr_recruitment_report_view.xml +++ b/addons/hr_recruitment/report/hr_recruitment_report_view.xml @@ -21,17 +21,17 @@ - + hr.recruitment.report.search From ce1563420fc4de020be06c7dd3e842968d12e73a Mon Sep 17 00:00:00 2001 From: apa-tiny Date: Wed, 17 Mar 2010 12:26:13 +0530 Subject: [PATCH 37/42] [IMP]:improved tasks report.(Not Finished Yet). bzr revid: apa@tinyerp.com-20100317065613-c09v68zwcvyx1s28 --- addons/project/__terp__.py | 1 + addons/project/report/__init__.py | 6 +- .../report/project_report.py} | 75 +++------- addons/project/report/project_report_view.xml | 93 ++++++++++++ .../project_timesheet/report/task_report.py | 122 +++++++-------- .../report/task_report_view.xml | 4 +- addons/report_project/report_project_view.xml | 139 ------------------ 7 files changed, 182 insertions(+), 258 deletions(-) rename addons/{report_project/report_project.py => project/report/project_report.py} (54%) create mode 100644 addons/project/report/project_report_view.xml delete mode 100644 addons/report_project/report_project_view.xml diff --git a/addons/project/__terp__.py b/addons/project/__terp__.py index cedeab01b4f..2af0ba122bf 100644 --- a/addons/project/__terp__.py +++ b/addons/project/__terp__.py @@ -40,6 +40,7 @@ works done on tasks, eso. It is able to render planning, order tasks, eso. "project_report.xml", "process/task_process.xml", "project_installer.xml", + "report/project_report_view.xml" ], 'demo_xml': [ 'project_demo.xml' diff --git a/addons/project/report/__init__.py b/addons/project/report/__init__.py index 2aefd8b3c11..3c104dc54ec 100644 --- a/addons/project/report/__init__.py +++ b/addons/project/report/__init__.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- ############################################################################## -# +# # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (). # @@ -15,9 +15,9 @@ # 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 . +# along with this program. If not, see . # ############################################################################## - +import project_report # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/report_project/report_project.py b/addons/project/report/project_report.py similarity index 54% rename from addons/report_project/report_project.py rename to addons/project/report/project_report.py index 183163813da..20d65aec356 100644 --- a/addons/report_project/report_project.py +++ b/addons/project/report/project_report.py @@ -29,14 +29,23 @@ class report_project_task_user(osv.osv): _columns = { 'name': fields.char('Year',size=64,required=False, readonly=True), 'user_id':fields.many2one('res.users', 'User', readonly=True), + 'date_start': fields.datetime('Starting Date'), + 'date_end': fields.datetime('Ending Date'), + 'date_deadline': fields.date('Deadline'), 'project_id':fields.many2one('project.project', 'Project', readonly=True), 'hours_planned': fields.float('Planned Hours', readonly=True), 'hours_effective': fields.float('Effective Hours', readonly=True), 'hours_delay': fields.float('Avg. Plan.-Eff.', readonly=True), 'closing_days': fields.char('Avg Closing Delay', size=64, readonly=True), - 'task_closed': fields.integer('Task Closed', readonly=True), + 'nbr': fields.integer('#Number of tasks', 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), + 'state': fields.selection([('draft', 'Draft'), + ('open', 'In Progress'), + ('pending', 'Pending'), + ('cancelled', 'Cancelled'), + ('done', 'Done')], + 'State', readonly=True), } _order = 'name desc, project_id' @@ -46,70 +55,30 @@ class report_project_task_user(osv.osv): create or replace view report_project_task_user as ( select min(t.id) as id, - to_char(date_end, 'YYYY') as name, - to_char(date_end, 'MM') as month, - count(distinct t.id) as task_closed, + to_char(date_start, 'YYYY') as name, + to_char(date_start, 'MM') as month, + count(distinct t.id) as nbr, + date_trunc('day',t.date_start) as date_start, + date_trunc('day',t.date_end) as date_end, + date_trunc('day',t.date_deadline) as date_deadline, t.user_id, t.project_id, + t.state, sum(planned_hours) as hours_planned, to_char(avg(date_end::abstime-t.create_date::timestamp), 'DD"d" HH24:MI:SS') as closing_days, sum(w.hours) as hours_effective, ((sum(planned_hours)-sum(w.hours))/count(distinct t.id))::decimal(16,2) as hours_delay from project_task t left join project_task_work w on (t.id=w.task_id) - where - t.state='done' group by - to_char(date_end, 'YYYY'),to_char(date_end, 'MM'),t.user_id,project_id + to_char(date_start, 'YYYY'), + to_char(date_start, 'MM'), + t.user_id,t.state,t.date_end, + t.date_deadline,t.date_start, + t.project_id ) """) report_project_task_user() - -class report_project_task(osv.osv): - _name = "report.project.task" - _description = "Tasks by project" - _auto = False - _columns = { - 'name': fields.char('Year',size=64,required=False, readonly=True), - 'project_id':fields.many2one('project.project', 'Project', readonly=True), - 'hours_planned': fields.float('Planned Hours', readonly=True), - 'hours_effective': fields.float('Effective Hours', readonly=True), - 'hours_delay': fields.float('Avg. Plan.-Eff.', readonly=True), - 'closing_days': fields.char('Avg Closing Delay', size=64, readonly=True), - 'task_closed': fields.integer('Task Closed', 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), - - } - _order = 'name desc, project_id' - def init(self, cr): - tools.sql.drop_view_if_exists(cr, 'report_project_task') - cr.execute(""" - create or replace view report_project_task as ( - select - min(t.id) as id, - to_char(date_end, 'YYYY') as name, - to_char(date_end, 'MM') as month, - count(distinct t.id) as task_closed, - t.project_id, - sum(planned_hours) as hours_planned, - to_char(avg(date_end::abstime-t.create_date::timestamp), 'DD"d" HH12:MI:SS') as closing_days, - sum(w.hours) as hours_effective, - ((sum(planned_hours)-sum(w.hours))/count(distinct t.id))::decimal(16,2) as hours_delay - from project_task t - left join project_task_work w on (t.id=w.task_id) - where - t.state='done' - group by - to_char(date_end, 'YYYY'),to_char(date_end, 'MM'),project_id - ) - """) -report_project_task() - - - - - # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/project/report/project_report_view.xml b/addons/project/report/project_report_view.xml new file mode 100644 index 00000000000..345b4aee2d7 --- /dev/null +++ b/addons/project/report/project_report_view.xml @@ -0,0 +1,93 @@ + + + + + + + report.project.task.user.tree + report.project.task.user + tree + + + + + + + + + + + + + + + + + + + + + report.project.task.user.search + report.project.task.user + search + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Tasks + report.project.task.user + form + tree + + + + + + diff --git a/addons/project_timesheet/report/task_report.py b/addons/project_timesheet/report/task_report.py index 3b2468ccd7f..7efe1f12746 100644 --- a/addons/project_timesheet/report/task_report.py +++ b/addons/project_timesheet/report/task_report.py @@ -23,67 +23,67 @@ from osv import fields,osv import mx.DateTime import tools -class task_report(osv.osv): - _name = "task.report" - _description = "Project task report" - _auto = False - _columns = { - 'name': fields.char('Task',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), - 'user_id':fields.many2one('res.users', 'User', readonly=True), - 'task_nbr': fields.float('Task Number', readonly=True), - 'task_hrs': fields.float('Task Hours', readonly=True), - 'task_progress': fields.float('Task Progress', readonly=True), - 'company_id' : fields.many2one('res.company', 'Company'), - 'task_state': fields.selection([('draft', 'Draft'),('open', 'Open'),('pending', 'Pending'), ('cancelled', 'Cancelled'), ('done', 'Done'),('no','No Task')], 'Status', readonly=True), - 'project_id':fields.many2one('project.project', 'Project'), - 'year': fields.char('Year',size=64,required=False, readonly=True), - 'date_start': fields.datetime('Starting Date',readonly=True), - 'date_end': fields.datetime('Ending Date',readonly=True), - 'date_deadline': fields.date('Deadline',readonly=True), - 'type': fields.many2one('project.task.type', 'Stage'), - 'priority' : fields.selection([('4','Very Low'), ('3','Low'), ('2','Medium'), ('1','Urgent'), ('0','Very urgent')], 'Importance'), - 'assign_to': fields.many2one('res.users', 'Assigned to', readonly=True), - 'remaining_hrs': fields.float('Remaining Hours', readonly=True), - } - - def init(self, cr): - tools.sql.drop_view_if_exists(cr, 'task_report') - cr.execute(''' - create or replace view task_report as ( - select - min(t.id) as id, - to_char(t.create_date, 'YYYY') as year, - to_char(t.create_date,'MM') as month, - u.id as user_id, - u.company_id as company_id, - t.name as name, - t.project_id as project_id, - to_char(t.date_start,'YYYY/mm/dd') as date_start, - to_char(t.date_end,'YYYY/mm/dd') as date_end, - to_char(t.date_deadline,'YYYY/mm/dd') as date_deadline, - t.type as type, - t.priority as priority, - t.user_id as assign_to, - t.remaining_hours as remaining_hrs, - count(t.*) as task_nbr, - sum(t.planned_hours) as task_hrs, - sum(t.planned_hours * (100 - t.progress) / 100) as task_progress, - case when t.state is null then 'no' else t.state end as task_state - from - res_users u - left join - project_task t on (u.id = t.user_id) - where - u.active - group by - to_char(t.create_date, 'YYYY'),to_char(t.create_date,'MM'),u.id, u.company_id, t.state - ,t.name,t.project_id,t.type,t.priority, - t.user_id,t.remaining_hours,to_char(t.date_start,'YYYY/mm/dd'),to_char(t.date_end,'YYYY/mm/dd'),to_char(t.date_deadline,'YYYY/mm/dd') - ) - ''') -task_report() +#class task_report(osv.osv): +# _name = "task.report" +# _description = "Project task report" +# _auto = False +# _columns = { +# 'name': fields.char('Task',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), +# 'user_id':fields.many2one('res.users', 'User', readonly=True), +# 'task_nbr': fields.float('Task Number', readonly=True), +# 'task_hrs': fields.float('Task Hours', readonly=True), +# 'task_progress': fields.float('Task Progress', readonly=True), +# 'company_id' : fields.many2one('res.company', 'Company'), +# 'task_state': fields.selection([('draft', 'Draft'),('open', 'Open'),('pending', 'Pending'), ('cancelled', 'Cancelled'), ('done', 'Done'),('no','No Task')], 'Status', readonly=True), +# 'project_id':fields.many2one('project.project', 'Project'), +# 'year': fields.char('Year',size=64,required=False, readonly=True), +# 'date_start': fields.datetime('Starting Date',readonly=True), +# 'date_end': fields.datetime('Ending Date',readonly=True), +# 'date_deadline': fields.date('Deadline',readonly=True), +# 'type': fields.many2one('project.task.type', 'Stage'), +# 'priority' : fields.selection([('4','Very Low'), ('3','Low'), ('2','Medium'), ('1','Urgent'), ('0','Very urgent')], 'Importance'), +# 'assign_to': fields.many2one('res.users', 'Assigned to', readonly=True), +# 'remaining_hrs': fields.float('Remaining Hours', readonly=True), +# } +# +# def init(self, cr): +# tools.sql.drop_view_if_exists(cr, 'task_report') +# cr.execute(''' +# create or replace view task_report as ( +# select +# min(t.id) as id, +# to_char(t.create_date, 'YYYY') as year, +# to_char(t.create_date,'MM') as month, +# u.id as user_id, +# u.company_id as company_id, +# t.name as name, +# t.project_id as project_id, +# to_char(t.date_start,'YYYY/mm/dd') as date_start, +# to_char(t.date_end,'YYYY/mm/dd') as date_end, +# to_char(t.date_deadline,'YYYY/mm/dd') as date_deadline, +# t.type as type, +# t.priority as priority, +# t.user_id as assign_to, +# t.remaining_hours as remaining_hrs, +# count(t.*) as task_nbr, +# sum(t.planned_hours) as task_hrs, +# sum(t.planned_hours * (100 - t.progress) / 100) as task_progress, +# case when t.state is null then 'no' else t.state end as task_state +# from +# res_users u +# left join +# project_task t on (u.id = t.user_id) +# where +# u.active +# group by +# to_char(t.create_date, 'YYYY'),to_char(t.create_date,'MM'),u.id, u.company_id, t.state +# ,t.name,t.project_id,t.type,t.priority, +# t.user_id,t.remaining_hours,to_char(t.date_start,'YYYY/mm/dd'),to_char(t.date_end,'YYYY/mm/dd'),to_char(t.date_deadline,'YYYY/mm/dd') +# ) +# ''') +#task_report() class report_timesheet_task_user(osv.osv): _name = "report.timesheet.task.user" diff --git a/addons/project_timesheet/report/task_report_view.xml b/addons/project_timesheet/report/task_report_view.xml index 732c656c92e..c5407d01a8a 100644 --- a/addons/project_timesheet/report/task_report_view.xml +++ b/addons/project_timesheet/report/task_report_view.xml @@ -7,7 +7,7 @@ parent="hr.menu_hr_root" sequence="40" /> - + diff --git a/addons/report_project/report_project_view.xml b/addons/report_project/report_project_view.xml deleted file mode 100644 index 58338959f2c..00000000000 --- a/addons/report_project/report_project_view.xml +++ /dev/null @@ -1,139 +0,0 @@ - - - - - - - report.project.task.user.form - report.project.task.user - form - - - - - - - - - - - - - - - - - - report.project.task.user.tree - report.project.task.user - tree - - - - - - - - - - - - - - - - - report.project.task.user.search - report.project.task.user - search - - - - - - - - - - - - - - - - - Tasks Closed by Project and User - report.project.task.user - form - tree - - - - - - - - report.project.task.form - report.project.task - form - -
- - - - - - - - - - -
- - report.project.task.tree - report.project.task - tree - - - - - - - - - - - - - - - - report.project.task.search - report.project.task - search - - - - - - - - - - - - - - - - - Tasks Closed by Project - report.project.task - form - tree - - - - -
-
From 9917c4652473763d7d146035ff35d60d69896e68 Mon Sep 17 00:00:00 2001 From: "Vir (Open ERP)" Date: Wed, 17 Mar 2010 12:32:45 +0530 Subject: [PATCH 38/42] [ADD/MOD] picking sql report, changes in comment in production report bzr revid: vir@tinyerp.com-20100317070245-nwj2iigi1ryl1qwf --- .../mrp/report/mrp_production_order_view.xml | 2 +- addons/stock/__terp__.py | 1 + addons/stock/report/__init__.py | 1 + addons/stock/report/report_stock_picking.py | 63 +++++++++ .../report/report_stock_picking_view.xml | 123 ++++++++++++++++++ 5 files changed, 189 insertions(+), 1 deletion(-) create mode 100644 addons/stock/report/report_stock_picking.py create mode 100644 addons/stock/report/report_stock_picking_view.xml diff --git a/addons/mrp/report/mrp_production_order_view.xml b/addons/mrp/report/mrp_production_order_view.xml index 841c1b9084e..abb046bd685 100644 --- a/addons/mrp/report/mrp_production_order_view.xml +++ b/addons/mrp/report/mrp_production_order_view.xml @@ -2,7 +2,7 @@ diff --git a/addons/stock/__terp__.py b/addons/stock/__terp__.py index 502ac0222a5..7a03b225dc2 100644 --- a/addons/stock/__terp__.py +++ b/addons/stock/__terp__.py @@ -53,6 +53,7 @@ Thanks to the double entry management, the inventory controlling is powerful and "product_view.xml", "partner_view.xml", "report/report_stock_view.xml", + "report/report_stock_picking_view.xml", "security/stock_security.xml", "security/ir.model.access.csv", ], diff --git a/addons/stock/report/__init__.py b/addons/stock/report/__init__.py index 3c650e3ed8c..6e0bc044d3e 100644 --- a/addons/stock/report/__init__.py +++ b/addons/stock/report/__init__.py @@ -27,6 +27,7 @@ import picking import lot_overview import lot_overview_all import report_stock +import report_stock_picking # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/stock/report/report_stock_picking.py b/addons/stock/report/report_stock_picking.py new file mode 100644 index 00000000000..2fe450d60de --- /dev/null +++ b/addons/stock/report/report_stock_picking.py @@ -0,0 +1,63 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Management Solution +# Copyright (C) 2004-2010 Tiny SPRL (). +# +# 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 tools + +class report_stock_picking(osv.osv): + _name = "report.stock.picking" + _description = "Stock Picking Report" + _auto = False + _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), + 'reference': fields.char('Reference', size=64, select=True), + 'nbr': fields.integer('# of Orders', readonly=True), + 'origin': fields.char('Origin', size=64), + 'order_date':fields.date('Order Date'), + 'state': fields.selection([('draft', 'Draft'),('auto', 'Waiting'),('confirmed', 'Confirmed'),('assigned', 'Available'),('done', 'Done'),('cancel', 'Cancelled')], 'State'), + 'type': fields.selection([('out', 'Sending Goods'), ('in', 'Getting Goods'), ('internal', 'Internal'), ('delivery', 'Delivery')], 'Shipping Type', required=True), + 'address_id': fields.many2one('res.partner.address', 'Partner'), + 'expected_date': fields.date('Expected Date'), + + } + def init(self, cr): + tools.drop_view_if_exists(cr, 'report_stock_picking') + cr.execute(""" + create or replace view report_stock_picking as ( + select + min(c.id) as id, + to_char(c.create_date, 'YYYY') as name, + to_char(c.create_date, 'MM') as month, + c.name as reference, + c.origin, + c.state, + c.type, + c.address_id, + to_date(to_char(c.date, 'MM-dd-YYYY'),'MM-dd-YYYY') as order_date, + to_date(to_char(c.min_date, 'MM-dd-YYYY'),'MM-dd-YYYY') as expected_date, + count(*) as nbr + from + stock_picking c + group by to_char(c.create_date, 'YYYY'), to_char(c.create_date, 'MM'),c.name,c.origin,c.date,c.state,c.type,c.address_id,c.min_date + )""") +report_stock_picking() +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/stock/report/report_stock_picking_view.xml b/addons/stock/report/report_stock_picking_view.xml new file mode 100644 index 00000000000..913498fde55 --- /dev/null +++ b/addons/stock/report/report_stock_picking_view.xml @@ -0,0 +1,123 @@ + + + + + + + report.stock.picking.tree + report.stock.picking + tree + + + + + + + + + + + + + + + + + + report.stock.picking.form + report.stock.picking + form + +
+ + + + + +
+ + + report.stock.picking.graph + report.stock.picking + graph + + + + + + + + + + report.stock.picking.select + report.stock.picking + search + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Picking + report.stock.picking + form + tree,graph + + + + + + + tree + + + + + + + graph + + + + + + +
+
+ From d226c241596fb61abb396d649a346ccf7afc11d4 Mon Sep 17 00:00:00 2001 From: apa-tiny Date: Wed, 17 Mar 2010 12:53:07 +0530 Subject: [PATCH 39/42] [IMP]:finished tasks report. bzr revid: apa@tinyerp.com-20100317072307-yxn10fwe7aoaq8eo --- addons/project/report/project_report_view.xml | 20 ------------------- 1 file changed, 20 deletions(-) diff --git a/addons/project/report/project_report_view.xml b/addons/project/report/project_report_view.xml index 345b4aee2d7..948ed70ef80 100644 --- a/addons/project/report/project_report_view.xml +++ b/addons/project/report/project_report_view.xml @@ -45,32 +45,12 @@ - - - From 8c165613678fb27dc1cebf4f69c6b21eab1c546a Mon Sep 17 00:00:00 2001 From: "Vir (Open ERP)" Date: Wed, 17 Mar 2010 13:00:46 +0530 Subject: [PATCH 40/42] [MOD/REMOVE] modification in picking report, removed files from report_analytic_line, report_project modules, access rules added for picking and task report bzr revid: vir@tinyerp.com-20100317073046-0rmtca2oadpo4vf0 --- addons/project/security/ir.model.access.csv | 4 +- addons/report_analytic_line/__init__.py | 24 ----------- addons/report_analytic_line/__terp__.py | 43 ------------------- .../security/ir.model.access.csv | 2 - addons/report_project/__init__.py | 25 ----------- addons/report_project/__terp__.py | 39 ----------------- .../security/ir.model.access.csv | 3 -- .../report/report_stock_picking_view.xml | 10 ++--- addons/stock/security/ir.model.access.csv | 3 +- 9 files changed, 10 insertions(+), 143 deletions(-) delete mode 100644 addons/report_analytic_line/__init__.py delete mode 100644 addons/report_analytic_line/__terp__.py delete mode 100644 addons/report_analytic_line/security/ir.model.access.csv delete mode 100644 addons/report_project/__init__.py delete mode 100644 addons/report_project/__terp__.py delete mode 100644 addons/report_project/security/ir.model.access.csv diff --git a/addons/project/security/ir.model.access.csv b/addons/project/security/ir.model.access.csv index b5877b688b7..cab4bd8eb75 100644 --- a/addons/project/security/ir.model.access.csv +++ b/addons/project/security/ir.model.access.csv @@ -12,4 +12,6 @@ "access_config_compute_remaining","project.config.compute.remaining","model_config_compute_remaining","project.group_project_user",1,1,1,1 "access_config_compute_remaining_manager","project.config.compute.remaining.manager","model_config_compute_remaining","project.group_project_manager",1,1,1,1 "access_project_message","project.message","model_project_message","project.group_project_user",1,0,0,0 -"access_project_installer","project.installer","model_project_installer","project.group_project_user",1,0,0,0 \ No newline at end of file +"access_project_installer","project.installer","model_project_installer","project.group_project_user",1,0,0,0 +"access_report_project_task_user","report.project.task.user","model_report_project_task_user","project.group_project_manager",1,0,0,0 +"access_report_project_task","report.project.task","model_report_project_task","project.group_project_manager",1,0,0,0 diff --git a/addons/report_analytic_line/__init__.py b/addons/report_analytic_line/__init__.py deleted file mode 100644 index e68279cad8d..00000000000 --- a/addons/report_analytic_line/__init__.py +++ /dev/null @@ -1,24 +0,0 @@ -# -*- coding: utf-8 -*- -############################################################################## -# -# OpenERP, Open Source Management Solution -# Copyright (C) 2004-2010 Tiny SPRL (). -# -# 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 . -# -############################################################################## - - -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: - diff --git a/addons/report_analytic_line/__terp__.py b/addons/report_analytic_line/__terp__.py deleted file mode 100644 index 28519d4cbe3..00000000000 --- a/addons/report_analytic_line/__terp__.py +++ /dev/null @@ -1,43 +0,0 @@ -# -*- coding: utf-8 -*- -############################################################################## -# -# OpenERP, Open Source Management Solution -# Copyright (C) 2004-2010 Tiny SPRL (). -# -# 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 . -# -############################################################################## - - -{ - 'name': 'Analytic lines - Reporting', - 'version': '1.0', - 'category': 'Generic Modules/Accounting', - 'description': """A report on analytic lines, costs by products, months and accounts. - - - ATTENTION: - This Module is merged into report_analytic module. so It will be removed in future""", - - 'author': 'Tiny', - 'website': 'http://www.openerp.com', - 'depends': ['account', 'hr_timesheet_invoice'], - 'init_xml': [], - 'update_xml': [], - 'demo_xml': [], - 'installable': True, - 'active': False, - 'certificate': '0075179053853', -} -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/report_analytic_line/security/ir.model.access.csv b/addons/report_analytic_line/security/ir.model.access.csv deleted file mode 100644 index 7390bda1e77..00000000000 --- a/addons/report_analytic_line/security/ir.model.access.csv +++ /dev/null @@ -1,2 +0,0 @@ -id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink -access_report_account_analytic_line_to_invoice,report.account.analytic.line.to.invoice,model_report_account_analytic_line_to_invoice,account.group_account_manager,1,0,0,0 diff --git a/addons/report_project/__init__.py b/addons/report_project/__init__.py deleted file mode 100644 index eced45af748..00000000000 --- a/addons/report_project/__init__.py +++ /dev/null @@ -1,25 +0,0 @@ -# -*- coding: utf-8 -*- -############################################################################## -# -# OpenERP, Open Source Management Solution -# Copyright (C) 2004-2010 Tiny SPRL (). -# -# 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 report_project - -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: - diff --git a/addons/report_project/__terp__.py b/addons/report_project/__terp__.py deleted file mode 100644 index 0c55a666abf..00000000000 --- a/addons/report_project/__terp__.py +++ /dev/null @@ -1,39 +0,0 @@ -# -*- coding: utf-8 -*- -############################################################################## -# -# OpenERP, Open Source Management Solution -# Copyright (C) 2004-2010 Tiny SPRL (). -# -# 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 . -# -############################################################################## - - -{ - 'name': 'Project Management - Reporting', - 'version': '1.0', - 'category': 'Generic Modules/Sales & Purchases', - 'description': """A module that adds some reports on projects. - Closed Tasks (By User and By Project), Finished Task (By User and By Project)""", - 'author': 'Tiny', - 'website': 'http://www.openerp.com', - 'depends': ['project', 'report_task'], - 'init_xml': [], - 'update_xml': ['security/ir.model.access.csv', 'report_project_view.xml'], - 'demo_xml': [], - 'installable': True, - 'active': False, - 'certificate': '0086804423149', -} -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/report_project/security/ir.model.access.csv b/addons/report_project/security/ir.model.access.csv deleted file mode 100644 index 8222c7cc0fe..00000000000 --- a/addons/report_project/security/ir.model.access.csv +++ /dev/null @@ -1,3 +0,0 @@ -id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink -access_report_project_task_user,report.project.task.user,model_report_project_task_user,project.group_project_manager,1,0,0,0 -access_report_project_task,report.project.task,model_report_project_task,project.group_project_manager,1,0,0,0 diff --git a/addons/stock/report/report_stock_picking_view.xml b/addons/stock/report/report_stock_picking_view.xml index 913498fde55..f2d4bfe4507 100644 --- a/addons/stock/report/report_stock_picking_view.xml +++ b/addons/stock/report/report_stock_picking_view.xml @@ -11,10 +11,8 @@ tree - - - + @@ -22,6 +20,8 @@ + +
@@ -61,7 +61,8 @@ - + + @@ -85,7 +86,6 @@ - diff --git a/addons/stock/security/ir.model.access.csv b/addons/stock/security/ir.model.access.csv index eea058ebde1..d00a55b0b9f 100644 --- a/addons/stock/security/ir.model.access.csv +++ b/addons/stock/security/ir.model.access.csv @@ -22,4 +22,5 @@ "access_stock_move_consume","stock.move.consume","model_stock_move_consume","stock.group_stock_user",1,0,0,0 "access_stock_move_scrap","stock.move.scrap","model_stock_move_scrap","stock.group_stock_user",1,0,0,0 "access_stock_move_split","stock.move.split","model_stock_move_split","stock.group_stock_user",1,0,0,0 -"access_stock_move_split_lines","stock.move.split.lines","model_stock_move_split_lines","stock.group_stock_user",1,0,0,0 \ No newline at end of file +"access_stock_move_split_lines","stock.move.split.lines","model_stock_move_split_lines","stock.group_stock_user",1,0,0,0 +"access_report_stock_picking","report.stock.picking","model_report_stock_picking","stock.group_stock_user",1,0,0,0 From c282b53189a3028a39cad9cd6ea7e3328087c740 Mon Sep 17 00:00:00 2001 From: apa-tiny Date: Wed, 17 Mar 2010 13:54:17 +0530 Subject: [PATCH 41/42] [IMP];improved security rule. bzr revid: apa@tinyerp.com-20100317082417-uapfkz994decbnc0 --- addons/project/security/ir.model.access.csv | 1 - 1 file changed, 1 deletion(-) diff --git a/addons/project/security/ir.model.access.csv b/addons/project/security/ir.model.access.csv index cab4bd8eb75..abedc99cfd6 100644 --- a/addons/project/security/ir.model.access.csv +++ b/addons/project/security/ir.model.access.csv @@ -14,4 +14,3 @@ "access_project_message","project.message","model_project_message","project.group_project_user",1,0,0,0 "access_project_installer","project.installer","model_project_installer","project.group_project_user",1,0,0,0 "access_report_project_task_user","report.project.task.user","model_report_project_task_user","project.group_project_manager",1,0,0,0 -"access_report_project_task","report.project.task","model_report_project_task","project.group_project_manager",1,0,0,0 From b407c51517bc874622c5dd37b88b0ace936588f7 Mon Sep 17 00:00:00 2001 From: "RCH(Open ERP)" <> Date: Wed, 17 Mar 2010 15:05:57 +0530 Subject: [PATCH 42/42] [IMP] project_timesheet : improvement in task report add month and year buttons bzr revid: vir@tinyerp.com-20100317093557-vpbma8whxrxu60hz --- .../project_timesheet/report/task_report.py | 18 ++++++++++--- .../report/task_report_view.xml | 27 ++++++++++++++++++- 2 files changed, 41 insertions(+), 4 deletions(-) diff --git a/addons/project_timesheet/report/task_report.py b/addons/project_timesheet/report/task_report.py index 7efe1f12746..fb6331dda0b 100644 --- a/addons/project_timesheet/report/task_report.py +++ b/addons/project_timesheet/report/task_report.py @@ -118,10 +118,14 @@ class report_timesheet_task_user(osv.osv): return result _columns = { - 'name': fields.date('Month',readonly=True), + 'name': fields.char('Name',size=64), + 'year': 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), 'user_id': fields.many2one('res.users', 'User',readonly=True), 'timesheet_hrs': fields.function(get_hrs_timesheet, method=True, string="Timesheet Hours"), 'task_hrs': fields.function(_get_task_hours, method=True, string="Task Hours"), + } @@ -130,7 +134,9 @@ class report_timesheet_task_user(osv.osv): select ((r.id*12)+to_number(months.m_id,'99'))::integer as id, months.name as name, - r.id as user_id + r.id as user_id, + to_char(to_date(months.name, 'YYYY/MM/DD'),'YYYY') as year, + to_char(to_date(months.name, 'YYYY/MM/DD'),'MM') as month from res_users r, (select to_char(p.date,'YYYY-MM-01') as name, to_char(p.date,'MM') as m_id @@ -139,7 +145,13 @@ class report_timesheet_task_user(osv.osv): union select to_char(h.name,'YYYY-MM-01') as name, to_char(h.name,'MM') as m_id - from hr_timesheet_sheet_sheet_day h) as months) """) + from hr_timesheet_sheet_sheet_day h) as months + + group by + r.id,months.m_id,months.name, + to_char(to_date(months.name, 'YYYY/MM/DD'),'YYYY') , + to_char(to_date(months.name, 'YYYY/MM/DD'),'MM') + ) """) report_timesheet_task_user() diff --git a/addons/project_timesheet/report/task_report_view.xml b/addons/project_timesheet/report/task_report_view.xml index c5407d01a8a..e44e399b292 100644 --- a/addons/project_timesheet/report/task_report_view.xml +++ b/addons/project_timesheet/report/task_report_view.xml @@ -138,18 +138,43 @@ + +
- + + report.timesheet.task.user.search + report.timesheet.task.user + search + + + + + + + + + + + + + + + + + + + Timesheet / Task Hours Per Month report.timesheet.task.user form tree +