From bf5585851a1ba47ad35fb9c7d0ca79c8afaad9fe Mon Sep 17 00:00:00 2001 From: Josse Colpaert Date: Thu, 24 Apr 2014 11:36:54 +0200 Subject: [PATCH] [IMP] Make sure tests pass without procurement_jit installation bzr revid: jco@openerp.com-20140424093654-r04xvcp544du1lkj --- addons/sale_mrp/test/cancellation_propagated.yml | 9 +++++++-- addons/sale_mrp/test/sale_mrp.yml | 6 +++--- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/addons/sale_mrp/test/cancellation_propagated.yml b/addons/sale_mrp/test/cancellation_propagated.yml index 770601bac6d..0005e15db53 100644 --- a/addons/sale_mrp/test/cancellation_propagated.yml +++ b/addons/sale_mrp/test/cancellation_propagated.yml @@ -51,12 +51,17 @@ Confirm sales order - !workflow {model: sale.order, action: order_confirm, ref: sale_order_product_manu} +- + I run scheduler. +- + !python {model: procurement.order}: | + self.run_scheduler(cr, uid) - Check the propagation when we cancel the main procurement * Retrieve related procurements and check that there are all running * Check that the purchase order has been well created * Cancel the main procurement - * Check that all procurements related and the purchase order has been well cancelled + * Check that all procurements related and the purchase order has been well cancelled - !python {model: procurement.order}: | # Retrieve related procu @@ -65,7 +70,7 @@ assert len(procu_ids)>0, 'No procurements are found for sale order "%s" (with id : %d)' %(so.name, so.id) # Check that all procurements are running - for procu in self.browse(cr, uid, procu_ids, context=context): + for procu in self.browse(cr, uid, procu_ids, context=context): assert procu.state == u'running', 'Procurement with id %d should be "running" but is with a state : %s!' %(procu.id, procu.state) # Check that one production order exist diff --git a/addons/sale_mrp/test/sale_mrp.yml b/addons/sale_mrp/test/sale_mrp.yml index 82c8b6e8b12..85e25b502f3 100644 --- a/addons/sale_mrp/test/sale_mrp.yml +++ b/addons/sale_mrp/test/sale_mrp.yml @@ -100,7 +100,7 @@ !python {model: procurement.order}: | sale_order_obj = self.pool.get('sale.order') so = sale_order_obj.browse(cr, uid, ref("sale_order_so0")) - proc_ids = self.search(cr, uid, [('origin','=',so.name)]) + proc_ids = self.search(cr, uid, [('origin','like',so.name)]) self.run(cr, uid, proc_ids) - I verify that a procurement state is "running" @@ -108,8 +108,8 @@ !python {model: procurement.order}: | sale_order_obj = self.pool.get('sale.order') so = sale_order_obj.browse(cr, uid, ref("sale_order_so0")) - proc_ids = self.search(cr, uid, [('origin','like',so.name), ('state','=','running')]) - # Check that all procurement are running + proc_ids = self.search(cr, uid, [('origin','like',so.name)]) + # Check that all procurement are running for procu in self.browse(cr,uid,proc_ids,context=context): assert procu.state == u'running', 'Procurement with id %d should be with a state "running" but is with a state : %s!' %(procu.id,procu.state) -