From 5d5ab9c9f99a3dd80401bd850de82ad3aaa6ebca Mon Sep 17 00:00:00 2001 From: "Ajay Chauhan (OpenERP)" Date: Mon, 11 Jun 2012 17:49:40 +0530 Subject: [PATCH 1/3] [FIX]stock : add value to the field year & month bzr revid: cha@tinyerp.com-20120611121940-ynw03liych1gj2df --- addons/stock/report/report_stock_move.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/addons/stock/report/report_stock_move.py b/addons/stock/report/report_stock_move.py index afd6bd4d1f4..894d82534a2 100644 --- a/addons/stock/report/report_stock_move.py +++ b/addons/stock/report/report_stock_move.py @@ -153,7 +153,7 @@ class report_stock_inventory(osv.osv): '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')]), + ('05','May'), ('06','June'), ('07','July'), ('08','August'), ('09','September')],'Month'), 'partner_id':fields.many2one('res.partner', 'Partner', readonly=True), 'product_id':fields.many2one('product.product', 'Product', readonly=True), 'product_categ_id':fields.many2one('product.category', 'Product Category', readonly=True), @@ -173,6 +173,8 @@ class report_stock_inventory(osv.osv): CREATE OR REPLACE view report_stock_inventory AS ( (SELECT min(m.id) as id, m.date as date, + to_char(m.date, 'YYYY') as year, + to_char(m.date, 'MM') as month, m.partner_id as partner_id, m.location_id as location_id, m.product_id as product_id, pt.categ_id as product_categ_id, l.usage as location_type, m.company_id, @@ -195,6 +197,8 @@ CREATE OR REPLACE view report_stock_inventory AS ( ) UNION ALL ( SELECT -m.id as id, m.date as date, + to_char(m.date, 'YYYY') as year, + to_char(m.date, 'MM') as month, m.partner_id as partner_id, m.location_dest_id as location_id, m.product_id as product_id, pt.categ_id as product_categ_id, l.usage as location_type, m.company_id, From 25917cf9b1a28a9915a1b4c633ba2c7695b99d34 Mon Sep 17 00:00:00 2001 From: "Ajay Chauhan (OpenERP)" Date: Tue, 21 Aug 2012 13:10:51 +0530 Subject: [PATCH 2/3] [IMP] stock: add remaining months in selection of month and add group by month & year in search bzr revid: cha@tinyerp.com-20120821074051-vz24ihn7d9u87usb --- addons/stock/report/report_stock_move.py | 7 ++++--- addons/stock/report/report_stock_move_view.xml | 4 +++- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/addons/stock/report/report_stock_move.py b/addons/stock/report/report_stock_move.py index 894d82534a2..aeb34d4265e 100644 --- a/addons/stock/report/report_stock_move.py +++ b/addons/stock/report/report_stock_move.py @@ -153,7 +153,8 @@ class report_stock_inventory(osv.osv): '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')],'Month'), + ('05','May'), ('06','June'), ('07','July'), ('08','August'), ('09','September'), + ('10','October'), ('11','November'), ('12','December')], 'Month', readonly=True), 'partner_id':fields.many2one('res.partner', 'Partner', readonly=True), 'product_id':fields.many2one('product.product', 'Product', readonly=True), 'product_categ_id':fields.many2one('product.category', 'Product Category', readonly=True), @@ -193,7 +194,7 @@ CREATE OR REPLACE view report_stock_inventory AS ( LEFT JOIN stock_location l ON (m.location_id=l.id) GROUP BY m.id, m.product_id, m.product_uom, pt.categ_id, m.partner_id, m.location_id, m.location_dest_id, - m.prodlot_id, m.date, m.state, l.usage, m.company_id, pt.uom_id + m.prodlot_id, m.date, m.state, l.usage, m.company_id, pt.uom_id, to_char(m.date, 'YYYY'), to_char(m.date, 'MM') ) UNION ALL ( SELECT -m.id as id, m.date as date, @@ -216,7 +217,7 @@ CREATE OR REPLACE view report_stock_inventory AS ( LEFT JOIN stock_location l ON (m.location_dest_id=l.id) GROUP BY m.id, m.product_id, m.product_uom, pt.categ_id, m.partner_id, m.location_id, m.location_dest_id, - m.prodlot_id, m.date, m.state, l.usage, m.company_id, pt.uom_id + m.prodlot_id, m.date, m.state, l.usage, m.company_id, pt.uom_id, to_char(m.date, 'YYYY'), to_char(m.date, 'MM') ) ); """) diff --git a/addons/stock/report/report_stock_move_view.xml b/addons/stock/report/report_stock_move_view.xml index a0227788d97..e95cb9e0e42 100644 --- a/addons/stock/report/report_stock_move_view.xml +++ b/addons/stock/report/report_stock_move_view.xml @@ -163,8 +163,10 @@ - + + + From b2af1abc5e380263244e1ec60fe091b69cb96f64 Mon Sep 17 00:00:00 2001 From: "Ajay Chauhan (OpenERP)" Date: Tue, 21 Aug 2012 14:17:22 +0530 Subject: [PATCH 3/3] [IMP] stock: remove unwanted code bzr revid: cha@tinyerp.com-20120821084722-9aml07fk8fs2lxd6 --- addons/stock/report/report_stock_move_view.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/stock/report/report_stock_move_view.xml b/addons/stock/report/report_stock_move_view.xml index e95cb9e0e42..a78a506cefe 100644 --- a/addons/stock/report/report_stock_move_view.xml +++ b/addons/stock/report/report_stock_move_view.xml @@ -165,8 +165,8 @@ - - + +