From 8aa0e2f0c3fb406496ed2c26657d1176ca065781 Mon Sep 17 00:00:00 2001 From: vra Date: Fri, 24 Sep 2010 13:12:07 +0530 Subject: [PATCH] [IMP] account: improved analytic entries analysis report. bzr revid: vra@tinyerp.com-20100924074207-gciyn6eqq6oxpycl --- .../report/account_analytic_entries_report.py | 13 ++++---- .../account_analytic_entries_report_view.xml | 30 +++++++------------ 2 files changed, 17 insertions(+), 26 deletions(-) diff --git a/addons/account/report/account_analytic_entries_report.py b/addons/account/report/account_analytic_entries_report.py index 2a1b4ad993b..ec813b8ecd8 100644 --- a/addons/account/report/account_analytic_entries_report.py +++ b/addons/account/report/account_analytic_entries_report.py @@ -35,6 +35,7 @@ class analytic_entries_report(osv.osv): ('10','October'), ('11','November'), ('12','December')], 'Month',readonly=True), 'user_id' : fields.many2one('res.users', 'User',readonly=True), 'name': fields.char('Description', size=64, readonly=True), + 'partner_id': fields.many2one('res.partner', 'Partner'), 'company_id': fields.many2one('res.company', 'Company', required=True), 'currency_id': fields.many2one('res.currency', 'Currency', required=True), 'account_id': fields.many2one('account.analytic.account', 'Account', required=True), @@ -44,8 +45,7 @@ class analytic_entries_report(osv.osv): 'product_id': fields.many2one('product.product', 'Product', required=True), 'product_uom_id': fields.many2one('product.uom', 'Product UOM', required=True), 'amount': fields.float('Amount', readonly=True), - 'unit_amount': fields.float('Unit Amount', readonly=True), - 'amount_currency': fields.float('Amount Currency', readonly=True), + 'unit_amount': fields.float('Quantity', readonly=True), 'nbr': fields.integer('#Entries', readonly=True), } def init(self, cr): @@ -61,6 +61,7 @@ class analytic_entries_report(osv.osv): to_char(a.create_date, 'YYYY-MM-DD') as day, a.user_id as user_id, a.name as name, + analytic.partner_id as partner_id, a.company_id as company_id, a.currency_id as currency_id, a.account_id as account_id, @@ -70,12 +71,12 @@ class analytic_entries_report(osv.osv): a.product_id as product_id, a.product_uom_id as product_uom_id, sum(a.amount) as amount, - sum(a.unit_amount) as unit_amount, - sum(a.amount_currency) as amount_currency + sum(a.unit_amount) as unit_amount from - account_analytic_line a + account_analytic_line a, account_analytic_account analytic + where analytic.id = a.account_id group by - a.create_date, a.user_id,a.name,company_id,a.currency_id, + a.create_date, a.user_id,a.name,analytic.partner_id,a.company_id,a.currency_id, a.account_id,a.general_account_id,a.journal_id, a.move_id,a.product_id,a.product_uom_id ) diff --git a/addons/account/report/account_analytic_entries_report_view.xml b/addons/account/report/account_analytic_entries_report_view.xml index b837186f23c..8902f83abbd 100644 --- a/addons/account/report/account_analytic_entries_report_view.xml +++ b/addons/account/report/account_analytic_entries_report_view.xml @@ -13,6 +13,7 @@ + @@ -21,9 +22,8 @@ + - - @@ -48,20 +48,22 @@ domain="[('day','<=', time.strftime('%%Y-%%m-%%d')), ('day','>',(datetime.date.today()-datetime.timedelta(days=7)).strftime('%%Y-%%m-%%d'))]" help="Analytic Entries during last 7 days"/> + + - + - + - + - + @@ -70,17 +72,6 @@ - - - - - - - - - - - @@ -91,9 +82,8 @@ - - + @@ -102,7 +92,7 @@ analytic.entries.report form tree,graph - {'search_default_month':1,'search_default_User':1,'group_by_no_leaf':1,'group_by':[]} + {'search_default_month':1,'group_by_no_leaf':1,'group_by':['account_id','month']} A tool search lets you know statistics on your analytics records that match your needs.