← Back to team overview

openerp-community-reviewer team mailing list archive

[Merge] lp:kmsistemas-openerp-addons into lp:ocb-addons/6.1

 

Jordi Llinares - KM Sistemas has proposed merging lp:kmsistemas-openerp-addons into lp:ocb-addons/6.1.

Requested reviews:
  OpenERP Community Backports Team (ocb)
Related bugs:
  Bug #1256619 in OpenERP Community Backports (Addons): "[6.1] report_stock_inventory wrongly declared column & SQL"
  https://bugs.launchpad.net/ocb-addons/+bug/1256619

For more details, see:
https://code.launchpad.net/~jorgellinares/ocb-addons/6.1/+merge/197352

Fix for bug lp:1256619, where report_stock_inventory class had 'month' field wrongly declared and two fields missing in SQL view.
-- 
https://code.launchpad.net/~jorgellinares/ocb-addons/6.1/+merge/197352
Your team OpenERP Community Backports Team is requested to review the proposed merge of lp:kmsistemas-openerp-addons into lp:ocb-addons/6.1.
=== modified file 'stock/report/report_stock_move.py'
--- stock/report/report_stock_move.py	2013-04-04 12:46:09 +0000
+++ stock/report/report_stock_move.py	2013-12-02 12:14:12 +0000
@@ -20,7 +20,7 @@
 ##############################################################################
 
 import tools
-from osv import fields,osv
+from osv import fields, osv
 from decimal_precision import decimal_precision as dp
 
 
@@ -29,29 +29,29 @@
     _description = "Moves Statistics"
     _auto = False
     _columns = {
-        'date': fields.date('Date', readonly=True),
-        'year': fields.char('Year', size=4, readonly=True),
-        'day': fields.char('Day', size=128, 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),
-        'partner_id':fields.many2one('res.partner.address', 'Partner', readonly=True),
-        'product_id':fields.many2one('product.product', 'Product', readonly=True),
-        'company_id':fields.many2one('res.company', 'Company', readonly=True),
-        'picking_id':fields.many2one('stock.picking', 'Packing', readonly=True),
-        'type': fields.selection([('out', 'Sending Goods'), ('in', 'Getting Goods'), ('internal', 'Internal'), ('other', 'Others')], 'Shipping Type', required=True, select=True, help="Shipping type specify, goods coming in or going out."),
-        'location_id': fields.many2one('stock.location', 'Source Location', readonly=True, select=True, help="Sets a location if you produce at a fixed location. This can be a partner location if you subcontract the manufacturing operations."),
-        'location_dest_id': fields.many2one('stock.location', 'Dest. Location', readonly=True, select=True, help="Location where the system will stock the finished products."),
-        'state': fields.selection([('draft', 'Draft'), ('waiting', 'Waiting'), ('confirmed', 'Confirmed'), ('assigned', 'Available'), ('done', 'Done'), ('cancel', 'Cancelled')], 'State', readonly=True, select=True),
-        'product_qty':fields.integer('Quantity',readonly=True),
-        'categ_id': fields.many2one('product.category', 'Product Category', ),
-        'product_qty_in':fields.integer('In Qty',readonly=True),
-        'product_qty_out':fields.integer('Out Qty',readonly=True),
-        'value' : fields.float('Total Value', required=True),
-        'day_diff2':fields.float('Lag (Days)',readonly=True,  digits_compute=dp.get_precision('Shipping Delay'), group_operator="avg"),
-        'day_diff1':fields.float('Planned Lead Time (Days)',readonly=True, digits_compute=dp.get_precision('Shipping Delay'), group_operator="avg"),
-        'day_diff':fields.float('Execution Lead Time (Days)',readonly=True,  digits_compute=dp.get_precision('Shipping Delay'), group_operator="avg"),
-        'stock_journal': fields.many2one('stock.journal','Stock Journal', select=True),
+        'date': fields.date('Date', readonly = True),
+        'year': fields.char('Year', size = 4, readonly = True),
+        'day': fields.char('Day', size = 128, 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),
+        'partner_id':fields.many2one('res.partner.address', 'Partner', readonly = True),
+        'product_id':fields.many2one('product.product', 'Product', readonly = True),
+        'company_id':fields.many2one('res.company', 'Company', readonly = True),
+        'picking_id':fields.many2one('stock.picking', 'Packing', readonly = True),
+        'type': fields.selection([('out', 'Sending Goods'), ('in', 'Getting Goods'), ('internal', 'Internal'), ('other', 'Others')], 'Shipping Type', required = True, select = True, help = "Shipping type specify, goods coming in or going out."),
+        'location_id': fields.many2one('stock.location', 'Source Location', readonly = True, select = True, help = "Sets a location if you produce at a fixed location. This can be a partner location if you subcontract the manufacturing operations."),
+        'location_dest_id': fields.many2one('stock.location', 'Dest. Location', readonly = True, select = True, help = "Location where the system will stock the finished products."),
+        'state': fields.selection([('draft', 'Draft'), ('waiting', 'Waiting'), ('confirmed', 'Confirmed'), ('assigned', 'Available'), ('done', 'Done'), ('cancel', 'Cancelled')], 'State', readonly = True, select = True),
+        'product_qty':fields.integer('Quantity', readonly = True),
+        'categ_id': fields.many2one('product.category', 'Product Category',),
+        'product_qty_in':fields.integer('In Qty', readonly = True),
+        'product_qty_out':fields.integer('Out Qty', readonly = True),
+        'value' : fields.float('Total Value', required = True),
+        'day_diff2':fields.float('Lag (Days)', readonly = True, digits_compute = dp.get_precision('Shipping Delay'), group_operator = "avg"),
+        'day_diff1':fields.float('Planned Lead Time (Days)', readonly = True, digits_compute = dp.get_precision('Shipping Delay'), group_operator = "avg"),
+        'day_diff':fields.float('Execution Lead Time (Days)', readonly = True, digits_compute = dp.get_precision('Shipping Delay'), group_operator = "avg"),
+        'stock_journal': fields.many2one('stock.journal', 'Stock Journal', select = True),
 
 
     }
@@ -150,22 +150,23 @@
     _description = "Stock Statistics"
     _auto = False
     _columns = {
-        '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')]),
-        'partner_id':fields.many2one('res.partner.address', 'Partner', readonly=True),
-        'product_id':fields.many2one('product.product', 'Product', readonly=True),
-        'product_categ_id':fields.many2one('product.category', 'Product Category', readonly=True),
-        'location_id': fields.many2one('stock.location', 'Location', readonly=True),
-        'prodlot_id': fields.many2one('stock.production.lot', 'Lot', readonly=True),
-        'company_id': fields.many2one('res.company', 'Company', readonly=True),
-        'product_qty':fields.float('Quantity',  digits_compute=dp.get_precision('Product UoM'), readonly=True),
-        'value' : fields.float('Total Value',  digits_compute=dp.get_precision('Account'), required=True),
-        'state': fields.selection([('draft', 'Draft'), ('waiting', 'Waiting'), ('confirmed', 'Confirmed'), ('assigned', 'Available'), ('done', 'Done'), ('cancel', 'Cancelled')], 'State', readonly=True, select=True,
-              help='When the stock move is created it is in the \'Draft\' state.\n After that it is set to \'Confirmed\' state.\n If stock is available state is set to \'Avaiable\'.\n When the picking it done the state is \'Done\'.\
+        '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'),
+            ('10', 'October'), ('11', 'November'), ('12', 'December')], 'Month', readonly = True),
+        'partner_id':fields.many2one('res.partner.address', 'Partner', readonly = True),
+        'product_id':fields.many2one('product.product', 'Product', readonly = True),
+        'product_categ_id':fields.many2one('product.category', 'Product Category', readonly = True),
+        'location_id': fields.many2one('stock.location', 'Location', readonly = True),
+        'prodlot_id': fields.many2one('stock.production.lot', 'Lot', readonly = True),
+        'company_id': fields.many2one('res.company', 'Company', readonly = True),
+        'product_qty':fields.float('Quantity', digits_compute = dp.get_precision('Product UoM'), readonly = True),
+        'value' : fields.float('Total Value', digits_compute = dp.get_precision('Account'), required = True),
+        'state': fields.selection([('draft', 'Draft'), ('waiting', 'Waiting'), ('confirmed', 'Confirmed'), ('assigned', 'Available'), ('done', 'Done'), ('cancel', 'Cancelled')], 'State', readonly = True, select = True,
+              help = 'When the stock move is created it is in the \'Draft\' state.\n After that it is set to \'Confirmed\' state.\n If stock is available state is set to \'Avaiable\'.\n When the picking it done the state is \'Done\'.\
               \nThe state is \'Waiting\' if the move is waiting for another one.'),
-        'location_type': fields.selection([('supplier', 'Supplier Location'), ('view', 'View'), ('internal', 'Internal Location'), ('customer', 'Customer Location'), ('inventory', 'Inventory'), ('procurement', 'Procurement'), ('production', 'Production'), ('transit', 'Transit Location for Inter-Companies Transfers')], 'Location Type', required=True),
+        'location_type': fields.selection([('supplier', 'Supplier Location'), ('view', 'View'), ('internal', 'Internal Location'), ('customer', 'Customer Location'), ('inventory', 'Inventory'), ('procurement', 'Procurement'), ('production', 'Production'), ('transit', 'Transit Location for Inter-Companies Transfers')], 'Location Type', required = True),
     }
     def init(self, cr):
         tools.drop_view_if_exists(cr, 'report_stock_inventory')
@@ -173,6 +174,8 @@
 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.address_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,
@@ -196,6 +199,8 @@
 ) 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.address_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,


Follow ups