From 90f2184e938835d545397bb625e625fc9345e4b4 Mon Sep 17 00:00:00 2001 From: Gery Debongnie Date: Wed, 29 Jan 2014 13:47:39 +0100 Subject: [PATCH] [IMP] improves the Purchase Analysis reporting view, removes old Day, Month, Year field from the postgres view and updates the dashboard graph view (addon purchase) bzr revid: ged@openerp.com-20140129124739-6sir9fz6jak9ic0y --- addons/purchase/board_purchase_view.xml | 11 ++-- addons/purchase/report/purchase_report.py | 12 +--- .../purchase/report/purchase_report_view.xml | 55 +++---------------- 3 files changed, 14 insertions(+), 64 deletions(-) diff --git a/addons/purchase/board_purchase_view.xml b/addons/purchase/board_purchase_view.xml index d491985cf52..a317138a310 100644 --- a/addons/purchase/board_purchase_view.xml +++ b/addons/purchase/board_purchase_view.xml @@ -17,15 +17,12 @@ purchase.report - - - @@ -39,9 +36,9 @@ purchase.report - - - + + + @@ -50,7 +47,7 @@ purchase.report form graph,tree - {'group_by':['month','category_id'],'group_by_no_leaf':1} + {'group_by_no_leaf':1} [('state','in',('approved','except_picking','except_invoice','done'))] diff --git a/addons/purchase/report/purchase_report.py b/addons/purchase/report/purchase_report.py index f6a37bb37a7..ada1d83cdaf 100644 --- a/addons/purchase/report/purchase_report.py +++ b/addons/purchase/report/purchase_report.py @@ -32,8 +32,6 @@ class purchase_report(osv.osv): _auto = False _columns = { 'date': fields.date('Order Date', readonly=True, help="Date on which this document has been created"), - 'name': fields.char('Year',size=64,required=False, readonly=True), - 'day': fields.char('Day', size=128, readonly=True), 'state': fields.selection([('draft', 'Request for Quotation'), ('confirmed', 'Waiting Supplier Ack'), ('approved', 'Approved'), @@ -60,12 +58,10 @@ class purchase_report(osv.osv): 'negociation': fields.float('Purchase-Standard Price', readonly=True, group_operator="avg"), 'price_standard': fields.float('Products Value', readonly=True, group_operator="sum"), 'nbr': 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), 'category_id': fields.many2one('product.category', 'Category', readonly=True) } - _order = 'name desc,price_total desc' + _order = 'date desc, price_total desc' def init(self, cr): tools.sql.drop_view_if_exists(cr, 'purchase_report') cr.execute(""" @@ -73,9 +69,6 @@ class purchase_report(osv.osv): 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, - to_char(s.date_order, 'YYYY-MM-DD') as day, s.state, s.date_approve, s.minimum_planned_date as expected_date, @@ -121,9 +114,6 @@ class purchase_report(osv.osv): l.product_id, t.categ_id, s.date_order, - to_char(s.date_order, 'YYYY'), - to_char(s.date_order, 'MM'), - to_char(s.date_order, 'YYYY-MM-DD'), s.state, s.warehouse_id, u.uom_type, diff --git a/addons/purchase/report/purchase_report_view.xml b/addons/purchase/report/purchase_report_view.xml index baaf2f8312c..d7700e5fca7 100644 --- a/addons/purchase/report/purchase_report_view.xml +++ b/addons/purchase/report/purchase_report_view.xml @@ -6,7 +6,12 @@ purchase.report + + + + + @@ -43,66 +48,24 @@ - - - + + + - - purchase.order.qty.amount.graph - purchase.report - - - - - - - - - - - purchase.order.by.user.graph - purchase.report - - - - - - - - - - Purchase Analysis purchase.report form graph - {'search_default_year':1,'search_default_month':1,'search_default_group_partner_id':1,'search_default_group_product_id': 1, 'search_default_orders': 1, 'group_by_no_leaf':1,'group_by':[]} + {'search_default_year':1,'search_default_month':1, 'search_default_orders': 1, 'group_by_no_leaf':1,'group_by':[]} Purchase Analysis allows you to easily check and analyse your company purchase history and performance. From this menu you can track your negotiation performance, the delivery performance of your suppliers, etc. - - Total Qty and Amount by month - purchase.report - form - graph - - - - - Total Orders by User per month - purchase.report - form - graph - - - -