From 30848b25abbf792ca156b605afcb01d8d09bd82b Mon Sep 17 00:00:00 2001 From: Leonardo Pistone Date: Tue, 17 Mar 2015 17:57:34 +0100 Subject: [PATCH] use context when creating the wizard Because the context is used in the default methods now. --- stock_reserve_sale/test/sale_line_reserve.yml | 16 ++++------------ stock_reserve_sale/test/sale_reserve.yml | 6 ++---- 2 files changed, 6 insertions(+), 16 deletions(-) diff --git a/stock_reserve_sale/test/sale_line_reserve.yml b/stock_reserve_sale/test/sale_line_reserve.yml index 421d5da2f..0a798c3c2 100644 --- a/stock_reserve_sale/test/sale_line_reserve.yml +++ b/stock_reserve_sale/test/sale_line_reserve.yml @@ -41,18 +41,14 @@ order_id: sale_reserve_02 - And I create a stock reserve for this line -- - !record {model: sale.stock.reserve, id: wizard_reserve_02_01}: - note: Reservation for the sales order line -- - I call the wizard to reserve the products of the sales order - !python {model: sale.stock.reserve}: | active_id = ref('sale_line_reserve_02_01') context['active_id'] = active_id context['active_ids'] = [active_id] context['active_model'] = 'sale.order.line' - self.button_reserve(cr, uid, [ref('wizard_reserve_02_01')], context=context) + wizard_id = self.create(cr, uid, {}, context=context) + self.button_reserve(cr, uid, [wizard_id], context=context) - I check Virtual stock of yogurt after update reservation - @@ -83,18 +79,14 @@ product_uom: product.product_uom_unit - And I try to create a stock reserve for this MTO line -- - !record {model: sale.stock.reserve, id: wizard_reserve_02_02}: - note: Reservation for the sales order line -- - I call the wizard to reserve the products of the sales order - !python {model: sale.stock.reserve}: | active_id = ref('sale_line_reserve_02_02') context['active_id'] = active_id context['active_ids'] = [active_id] context['active_model'] = 'sale.order.line' - self.button_reserve(cr, uid, [ref('wizard_reserve_02_02')], context=context) + wizard_id = self.create(cr, uid, {}, context=context) + self.button_reserve(cr, uid, [wizard_id], context=context) - I should not have a stock reservation for a MTO line - diff --git a/stock_reserve_sale/test/sale_reserve.yml b/stock_reserve_sale/test/sale_reserve.yml index 2671f40e1..81ec9e277 100644 --- a/stock_reserve_sale/test/sale_reserve.yml +++ b/stock_reserve_sale/test/sale_reserve.yml @@ -35,16 +35,14 @@ product_uom_qty: 4 - I call the wizard to reserve the products of the sales order -- - !record {model: sale.stock.reserve, id: wizard_reserve_01}: - note: Reservation for the sales order - !python {model: sale.stock.reserve}: | active_id = ref('sale_reserve_01') context['active_id'] = active_id context['active_ids'] = [active_id] context['active_model'] = 'sale.order' - self.button_reserve(cr, uid, [ref('wizard_reserve_01')], context=context) + wizard_id = self.create(cr, uid, {}, context=context) + self.button_reserve(cr, uid, [wizard_id], context=context) - I check Virtual stock of Gelato after update reservation -