diff --git a/addons/stock/__openerp__.py b/addons/stock/__openerp__.py index e60c3edf90a..ffe888c1d2b 100644 --- a/addons/stock/__openerp__.py +++ b/addons/stock/__openerp__.py @@ -85,8 +85,8 @@ Thanks to the double entry management, the inventory controlling is powerful and 'test/process/update_stock.yml', #'test/stock_report.yml', #'test/stock_test_wizard.yml', - #'test/process/stock_demo_backorder.yml', - #'test/process/stock_incoming_shipment.yml', + 'test/process/stock_demo_backorder.yml', + 'test/process/scrap_move.yml', ], 'installable': True, 'active': False, diff --git a/addons/stock/test/process/scrap_move.yml b/addons/stock/test/process/scrap_move.yml new file mode 100644 index 00000000000..129982586e1 --- /dev/null +++ b/addons/stock/test/process/scrap_move.yml @@ -0,0 +1,24 @@ +- + In order to test the scrap move, I add create a new move line in draft state with FAN2 +- + !record {model: stock.move, id: stock_move_4}: + product_id: product.product_product_fan2 + product_qty: 4.0 + location_dest_id: stock.stock_location_customers + location_id: stock.stock_location_stock +- + Now, withe help of 'Scrap Move' wizard, I scap the move of same Quantity. +- + !python {model: stock.move.scrap}: | + context = {'active_model':'stock.move', 'active_id': ref('stock_move_4'), 'active_ids': [ref('stock_move_4')]} + values = self.default_get(cr, uid, ['location_id','product_id','product_uom','product_qty'], context) + ids = self.create(cr, uid, values) + self.move_scrap(cr, uid, [ids], context) +- + I check Scraped Move details. +- + !python {model: stock.move}: | + ids = self.search(cr, uid, [('product_id','=',ref('product.product_product_fan2'))]) + for scrap_move in self.browse(cr, uid, ids): + if scrap_move.product_qty == 4.0 and scrap_move.location_dest_id == ref('stock_location_scrapped'): + assert scrap_move.state == 'done',"The scraped move should be in Done state" diff --git a/addons/stock/test/process/stock_demo_backorder.yml b/addons/stock/test/process/stock_demo_backorder.yml index 986a59c7349..8b17c6380c9 100644 --- a/addons/stock/test/process/stock_demo_backorder.yml +++ b/addons/stock/test/process/stock_demo_backorder.yml @@ -11,12 +11,9 @@ - !record {model: stock.move, id: stock_move_3}: product_id: product.product_product_fan2 - product_uom: product.product_uom_unit - product_uos_qty: 7.0 product_qty: 7.0 location_dest_id: stock.stock_location_customers location_id: stock.stock_location_stock - name: CPU3, Processor AMD Athlon XP 1800 picking_id: stock_picking_1 - | I click on 'Process Now' to process the delivery order and I change quantities to: