summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRucha (Open ERP) <rpa@tinyerp.com>2011-11-17 14:59:17 +0530
committerRucha (Open ERP) <rpa@tinyerp.com>2011-11-17 14:59:17 +0530
commit73f522cbc4b2dae974c4e1dc9e3733df416634d0 (patch)
tree3fa5f51302ad1a6fa08af7e427ffb43d2a8ffa7b
parentb93c997fedf57969d60bccb11e0356914f04ec36 (diff)
[IMP]: mrp_operations: Improvements in test cases to test effect of cancelling production order on related work orders
bzr revid: rpa@tinyerp.com-20111117092917-gt2w0og2glqa3bca
-rw-r--r--addons/mrp_operations/test/mrp_operation_test.yml39
1 files changed, 12 insertions, 27 deletions
diff --git a/addons/mrp_operations/test/mrp_operation_test.yml b/addons/mrp_operations/test/mrp_operation_test.yml
index 9cb81abebde..c285877f2c3 100644
--- a/addons/mrp_operations/test/mrp_operation_test.yml
+++ b/addons/mrp_operations/test/mrp_operation_test.yml
@@ -1,16 +1,10 @@
-
- In order to test mrp_operations module in OpenERP,
- I create a production order.
+ Now I will check how cancelling production order will affect its work orders.
-
!record {model: mrp.production, id: mrp_production_mo1}:
- company_id: base.main_company
- date_planned: !eval datetime.today().strftime("%Y-%m-%d %H:%M:%S")
- location_dest_id: stock.stock_location_stock
location_src_id: stock.stock_location_stock
- name: MO/01234567
- product_id: product.product_product_pc1
+ product_id: product.product_product_cpu_gen
product_qty: 5.0
- product_uom: product.product_uom_unit
product_uos_qty: 5.0
-
Now I confirm the production order.
@@ -24,31 +18,22 @@
order_id = self.search(cr, uid, [('production_id','=', ref('mrp_production_mo1')),('state','=','draft')])
assert order_id, _('No work order defined for this production order!')
-
- The scheduler runs.
+ In order to cancel the production order, I first cancel its picking.
-
- !function {model: procurement.order, name: run_scheduler}:
- - model: procurement.order
- search: "[('state','=','confirmed')]"
+ !function {model: stock.picking, name: action_cancel}:
+ - model: mrp.production
+ eval: "[obj(ref('mrp_production_mo1')).picking_id.id]"
-
- I am checking Internal picking.
+ Now I cancel the production order.
-
- !python {model: mrp.production}: |
- from tools.translate import _
- pick_ids = self.browse(cr, uid, ref("mrp_production_mo1"))
- assert pick_ids.picking_id.id, _('No Internal Picking generated!')
--
- In order to cancel the MO, first cancel its picking
--
- !python {model: stock.picking}: |
- mrp_obj = self.pool.get('mrp.production')
- mo = mrp_obj.browse(cr, uid, ref("mrp_production_mo1"))
- self.action_cancel(cr, uid, [mo.picking_id.id], context=None)
+ !workflow {model: mrp.production, action: button_cancel, ref: mrp_production_mo1}
-
- Then cancel The Manufacturing order.
+ Now I check that the production order is cancelled.
-
- !workflow {model: mrp.production, action: button_cancel, ref: mrp_production_mo1}
+ !assert {model: mrp.production, id: mrp_production_mo1}:
+ - state == 'cancel'
-
- I check that there is one Work order generated related to the production order that is cancelled or not.
+ I check that the work order related to the production order that is cancelled or not.
-
!python {model: mrp.production.workcenter.line}: |
from tools.translate import _