From 4173003bf41c78cb07a8217f6d1d4f677344bff5 Mon Sep 17 00:00:00 2001 From: "DBR (OpenERP)" Date: Fri, 9 Dec 2011 12:25:10 +0530 Subject: [PATCH] [REM]stock: Remove stock_report.yml and include it's code in stock_update.yml bzr revid: dbr@tinyerp.com-20111209065510-h1pl3v5pbwoa2zkf --- addons/stock/__openerp__.py | 1 - addons/stock/test/stock_report.yml | 40 ----------------------- addons/stock/test/stock_update.yml | 51 +++++++++++++++++++++++++++--- 3 files changed, 46 insertions(+), 46 deletions(-) delete mode 100644 addons/stock/test/stock_report.yml diff --git a/addons/stock/__openerp__.py b/addons/stock/__openerp__.py index a3e9a2b9963..d29b83caff6 100644 --- a/addons/stock/__openerp__.py +++ b/addons/stock/__openerp__.py @@ -86,7 +86,6 @@ Thanks to the double entry management, the inventory controlling is powerful and 'test/stock_update.yml', 'test/stock_chain_location.yml', 'test/stock_demo_backorder.yml', - 'test/stock_report.yml', 'test/delete_stock.yml', 'test/cancel_stock.yml', ], diff --git a/addons/stock/test/stock_report.yml b/addons/stock/test/stock_report.yml deleted file mode 100644 index 61c902c2b0e..00000000000 --- a/addons/stock/test/stock_report.yml +++ /dev/null @@ -1,40 +0,0 @@ -- - In order to test the PDF reports defined on a stock, we will print a Stock Overviewall(children) report. -- - !python {model: stock.location}: | - import netsvc, tools, os - (data, format) = netsvc.LocalService('report.lot.stock.overview_all').create(cr, uid, [ref('stock.stock_location_stock')], {}, {}) - if tools.config['test_report_directory']: - file(os.path.join(tools.config['test_report_directory'], 'stock-overviewall'+format), 'wb+').write(data) -- - In order to test the PDF reports defined on stock inventory, we will print a Stock Inventory Move report. -- - !python {model: stock.inventory}: | - import netsvc, tools, os - (data, format) = netsvc.LocalService('report.stock.inventory.move').create(cr, uid, [ref('stock.stock_inventory_0')], {}, {}) - if tools.config['test_report_directory']: - file(os.path.join(tools.config['test_report_directory'], 'stock-stock_inventory_move.'+format), 'wb+').write(data) -- - In order to test the PDF reports defined on a stock, we will print a stock overview report. -- - !python {model: stock.location}: | - import netsvc, tools, os - (data, format) = netsvc.LocalService('report.lot.stock.overview').create(cr, uid, [ref('stock.stock_location_14')], {}, {}) - if tools.config['test_report_directory']: - file(os.path.join(tools.config['test_report_directory'], 'stock-overview'+format), 'wb+').write(data) -- - In order to test the PDF reports defined on a stock, we will print a Delivery order List report. -- - !python {model: stock.picking}: | - import netsvc, tools, os - (data, format) = netsvc.LocalService('report.stock.picking.list').create(cr, uid, [ref('stock.stock_picking_1')], {}, {}) - if tools.config['test_report_directory']: - file(os.path.join(tools.config['test_report_directory'], 'stock-picking_list'+format), 'wb+').write(data) -- - In order to test the PDF reports defined on a stock, we will print product stock Report. -- - !python {model: product.product}: | - import netsvc, tools, os - (data, format) = netsvc.LocalService('report.stock.product.history').create(cr, uid, [ref('product.product_product_pc1')], {}, {}) - if tools.config['test_report_directory']: - file(os.path.join(tools.config['test_report_directory'], 'stock-product_stock_report.'+format), 'wb+').write(data) diff --git a/addons/stock/test/stock_update.yml b/addons/stock/test/stock_update.yml index 6638748d6f8..a814654a1dd 100644 --- a/addons/stock/test/stock_update.yml +++ b/addons/stock/test/stock_update.yml @@ -1,19 +1,19 @@ - - I update the current stock of the product '[CPU2]High speed processor config'. + I update the current stock of the product. - I assign the location. - !record {model: stock.warehouse, id: stock.warehouse0}: lot_stock_id: stock_location_stock - - I create stock production lot for product '[CPU2]High speed processor config'. + I create stock production lot for product. - !record {model: stock.production.lot, id: stock_production_lot0}: product_id: product.product_product_cpu2 date: !eval time.strftime('%Y-%m-%d %H:%M:%S') name: 0000001 - - I take '[CPU2]High speed processor config' product and with the help of 'Change Product Quantity' wizard update the product stock. + I take product and with the help of 'Change Product Quantity' wizard update the product stock. - !python {model: product.product}: | change_qty = self.pool.get('stock.change.product.qty') @@ -22,7 +22,7 @@ change_qty.change_product_qty(cr, uid, [ids], {'active_model':'product.product', 'active_id': product.id, 'active_ids':[product.id]}) assert product.qty_available == 5,'Product Quantity is not Updated' - - I trace the stock production lot for '[CPU2]High speed processor config' product. + I trace the stock production lot for product. - !python {model: stock.production.lot }: | self.action_traceability(cr,uid,[ref('stock_production_lot0')], {'lang': 'en_US', 'tz': False, 'active_model': 'ir.ui.menu', 'field': '', 'type': ''}) @@ -50,7 +50,7 @@ new_id = self.copy(cr, uid, ref('stock.stock_picking_1'), context) context.update({'new_id':new_id}) - - Now,I return the products. + Now,I return the product. - !python {model: stock.picking}: | copy_id = context.get('new_id') @@ -62,3 +62,44 @@ stock_partial_picking.do_partial(cr, uid, [partial_id], context) return_pick_id = self.pool.get('stock.return.picking').create(cr, uid,{}, context) self.pool.get('stock.return.picking').create_returns(cr, uid, [return_pick_id], context) + +- + In order to test the PDF reports defined on a stock, we will print a Stock Overviewall(children) report. +- + !python {model: stock.location}: | + import netsvc, tools, os + (data, format) = netsvc.LocalService('report.lot.stock.overview_all').create(cr, uid, [ref('stock.stock_location_stock')], {}, {}) + if tools.config['test_report_directory']: + file(os.path.join(tools.config['test_report_directory'], 'stock-overviewall'+format), 'wb+').write(data) +- + In order to test the PDF reports defined on stock inventory, we will print a Stock Inventory Move report. +- + !python {model: stock.inventory}: | + import netsvc, tools, os + (data, format) = netsvc.LocalService('report.stock.inventory.move').create(cr, uid, [ref('stock.stock_inventory_0')], {}, {}) + if tools.config['test_report_directory']: + file(os.path.join(tools.config['test_report_directory'], 'stock-stock_inventory_move.'+format), 'wb+').write(data) +- + In order to test the PDF reports defined on a stock, we will print a stock overview report. +- + !python {model: stock.location}: | + import netsvc, tools, os + (data, format) = netsvc.LocalService('report.lot.stock.overview').create(cr, uid, [ref('stock.stock_location_14')], {}, {}) + if tools.config['test_report_directory']: + file(os.path.join(tools.config['test_report_directory'], 'stock-overview'+format), 'wb+').write(data) +- + In order to test the PDF reports defined on a stock, we will print a Delivery order List report. +- + !python {model: stock.picking}: | + import netsvc, tools, os + (data, format) = netsvc.LocalService('report.stock.picking.list').create(cr, uid, [ref('stock.stock_picking_1')], {}, {}) + if tools.config['test_report_directory']: + file(os.path.join(tools.config['test_report_directory'], 'stock-picking_list'+format), 'wb+').write(data) +- + In order to test the PDF reports defined on a stock, we will print product stock Report. +- + !python {model: product.product}: | + import netsvc, tools, os + (data, format) = netsvc.LocalService('report.stock.product.history').create(cr, uid, [ref('product.product_product_pc1')], {}, {}) + if tools.config['test_report_directory']: + file(os.path.join(tools.config['test_report_directory'], 'stock-product_stock_report.'+format), 'wb+').write(data)