From cfa09b7a58c848f4849d514f139077bb478fabfd Mon Sep 17 00:00:00 2001 From: Sergi Almacellas Abellana Date: Fri, 28 Jun 2019 10:17:32 +0200 Subject: [PATCH] Make order point's minimal quantity required issue8405 review259611017 --- tests/scenario_stock_supply_production.rst | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/tests/scenario_stock_supply_production.rst b/tests/scenario_stock_supply_production.rst index 2a31ead3db..1f933a2a84 100644 --- a/tests/scenario_stock_supply_production.rst +++ b/tests/scenario_stock_supply_production.rst @@ -82,14 +82,14 @@ There is now a production request:: >>> production.quantity 1.0 -With an order point without minimal quantity:: +Create an order point negative minimal quantity:: >>> OrderPoint = Model.get('stock.order_point') >>> order_point = OrderPoint() >>> order_point.type = 'production' >>> order_point.product = product >>> order_point.warehouse_location = warehouse_loc - >>> order_point.min_quantity = None + >>> order_point.min_quantity = -1 >>> order_point.target_quantity = 10 >>> order_point.save() @@ -123,3 +123,17 @@ There is now a production request:: True >>> production.quantity 11.0 + +Using zero as minimal quantity also creates a production request:: + + >>> order_point.min_quantity = 0 + >>> order_point.save() + >>> create_pr = Wizard('stock.supply') + >>> create_pr.execute('create_') + >>> production, = Production.find([]) + >>> production.state + 'request' + >>> production.product == product + True + >>> production.quantity + 11.0