changeset fbb0dcccd9c5 in modules/stock_supply_production:default
details:
https://hg.tryton.org/modules/stock_supply_production?cmd=changeset;node=fbb0dcccd9c5
description:
Make order point's minimal quantity required
issue8405
review259611017
diffstat:
tests/scenario_stock_supply_production.rst | 18 ++++++++++++++++--
1 files changed, 16 insertions(+), 2 deletions(-)
diffs (38 lines):
diff -r e0301c4cc765 -r fbb0dcccd9c5 tests/scenario_stock_supply_production.rst
--- a/tests/scenario_stock_supply_production.rst Thu Jun 06 19:22:13
2019 +0200
+++ b/tests/scenario_stock_supply_production.rst Fri Jun 28 10:17:32
2019 +0200
@@ -82,14 +82,14 @@
>>> 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 @@
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