From d181c63d07178119b691b89dda2202e09a6dff72 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thibault=20Delavall=C3=A9e?= Date: Thu, 5 Dec 2013 15:45:05 +0100 Subject: [PATCH] [CLEAN] sale_crm: cleaning before merging - sales report: the group by salesteam was wrongly placed in the view - sale_crm: fixed computation for sparklines, now bar graph should display the same result as the sales analysis - added a forgottent cursor: pointer for a gauge - moved the gauges in the dom - sale_crm: report: removed extra content not necessary bzr revid: tde@openerp.com-20131205144505-jfsd8lh91r1b13a1 --- addons/sale_crm/report/sale_report.py | 25 +++------------------ addons/sale_crm/report/sale_report_view.xml | 2 +- addons/sale_crm/sale_crm.py | 6 ++--- addons/sale_crm/sale_crm_view.xml | 10 +++++---- 4 files changed, 13 insertions(+), 30 deletions(-) diff --git a/addons/sale_crm/report/sale_report.py b/addons/sale_crm/report/sale_report.py index f8fae28f600..eca020f82ad 100644 --- a/addons/sale_crm/report/sale_report.py +++ b/addons/sale_crm/report/sale_report.py @@ -1,26 +1,7 @@ # -*- 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 openerp.osv import fields, osv -from openerp import tools + class sale_report(osv.osv): _inherit = "sale.report" @@ -29,7 +10,7 @@ class sale_report(osv.osv): } def _select(self): - return super(sale_report, self)._select() + ", s.section_id as section_id" + return super(sale_report, self)._select() + ", s.section_id as section_id" def _group_by(self): return super(sale_report, self)._group_by() + ", s.section_id" diff --git a/addons/sale_crm/report/sale_report_view.xml b/addons/sale_crm/report/sale_report_view.xml index 8661d13c470..0d8243c1275 100644 --- a/addons/sale_crm/report/sale_report_view.xml +++ b/addons/sale_crm/report/sale_report_view.xml @@ -17,7 +17,7 @@ sale.report - + diff --git a/addons/sale_crm/sale_crm.py b/addons/sale_crm/sale_crm.py index a2c2b7e2af3..f1370841fe9 100644 --- a/addons/sale_crm/sale_crm.py +++ b/addons/sale_crm/sale_crm.py @@ -53,10 +53,10 @@ class crm_case_section(osv.osv): date_end = month_begin.replace(day=calendar.monthrange(month_begin.year, month_begin.month)[1]).strftime(tools.DEFAULT_SERVER_DATE_FORMAT) for id in ids: res[id] = dict() - created_domain = [('section_id', '=', id), ('state', 'in', ['draft', 'sent']), ('date_order', '>=', date_begin), ('date_order', '<=', date_end)] + created_domain = [('section_id', '=', id), ('state', '=', ['draft']), ('date_order', '>=', date_begin), ('date_order', '<=', date_end)] res[id]['monthly_quoted'] = self.__get_bar_values(cr, uid, obj, created_domain, ['amount_total', 'date_order'], 'amount_total', 'date_order', context=context) - validated_domain = [('section_id', '=', id), ('state', 'not in', ['draft', 'sent']), ('date_confirm', '>=', date_begin), ('date_order', '<=', date_end)] - res[id]['monthly_confirmed'] = self.__get_bar_values(cr, uid, obj, validated_domain, ['amount_total', 'date_confirm'], 'amount_total', 'date_confirm', context=context) + validated_domain = [('section_id', '=', id), ('state', 'not in', ['draft', 'sent', 'cancel']), ('date_order', '>=', date_begin), ('date_order', '<=', date_end)] + res[id]['monthly_confirmed'] = self.__get_bar_values(cr, uid, obj, validated_domain, ['amount_total', 'date_order'], 'amount_total', 'date_order', context=context) return res def _get_invoices_data(self, cr, uid, ids, field_name, arg, context=None): diff --git a/addons/sale_crm/sale_crm_view.xml b/addons/sale_crm/sale_crm_view.xml index 4669f669276..8c3c98c3f97 100644 --- a/addons/sale_crm/sale_crm_view.xml +++ b/addons/sale_crm/sale_crm_view.xml @@ -296,10 +296,12 @@ - -
- Invoiced - Forecast + +
+ Invoiced + Forecast

Define an invoicing target in the sales team settings to see the period's achievement and forecast at a glance.