From de26cc6f011b17cb61ef7d386047b5f3d23d3c99 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=80ngel=20=C3=80lvarez?= Date: Sun, 29 Nov 2020 11:00:07 +0100 Subject: [PATCH] fix test introduced on stock_quantity_to_zero patch --- series | 3 ++ stock_quantity_to_zero_pass_test.diff | 65 +++++++++++++++++++++++++++ 2 files changed, 68 insertions(+) create mode 100644 stock_quantity_to_zero_pass_test.diff diff --git a/series b/series index d17a972..e67c6ed 100644 --- a/series +++ b/series @@ -19,7 +19,10 @@ sale_copy.diff # [sale] set _cache fields to null when copy issue4482.diff # [stock] stock inventory misses company access rule search_warehouse.diff # [stock] search function for warehouse issue239_630.diff # [stock] get location quantity by product, product template or lot + stock_quantity_to_zero.diff # [stock] Ensure to sum with value. +stock_quantity_to_zero_pass_test.diff # [stock] Ensure to sum with value. +# issue9737.diff # [stock] Delete outgoing_moves with zero quantity on packing customer shipment [not best solution for bug, solved on stock_quantity_to_zero] issue10467.diff # [stock_lot] add lot to grouping when assign try if lot it's required on product production_view.diff #[production] Split inputs and outputs on pages diff --git a/stock_quantity_to_zero_pass_test.diff b/stock_quantity_to_zero_pass_test.diff new file mode 100644 index 0000000..7a5c68b --- /dev/null +++ b/stock_quantity_to_zero_pass_test.diff @@ -0,0 +1,65 @@ +diff --git a/trytond/trytond/modules/stock/tests/scenario_stock_shipment_out.rst b/trytond/trytond/modules/stock/tests/scenario_stock_shipment_out.rst +index 52d5b22..09a29ae 100644 +--- a/trytond/trytond/modules/stock/tests/scenario_stock_shipment_out.rst ++++ b/trytond/trytond/modules/stock/tests/scenario_stock_shipment_out.rst +@@ -172,7 +172,7 @@ Delete the draft move, assign and pack shipment:: + >>> all(m.state == 'assigned' for m in shipment_out.outgoing_moves) + True + >>> len(shipment_out.outgoing_moves) +- 2 ++ 1 + >>> len(shipment_out.inventory_moves) + 1 + >>> shipment_out.inventory_moves[0].state +@@ -190,14 +190,14 @@ Set the state as Done:: + True + >>> planned_dates = [m.planned_date for m in + ... shipment_out.outgoing_moves] +- >>> planned_dates == [today, today] ++ >>> planned_dates == [today] + True + >>> effective_dates = [m.effective_date for m in + ... shipment_out.outgoing_moves] + >>> len(set(effective_dates)) + 1 + >>> len(shipment_out.outgoing_moves) +- 2 ++ 1 + >>> len(shipment_out.inventory_moves) + 1 + >>> shipment_out.inventory_moves[0].state + +diff --git a/trytond/trytond/modules/stock_lot/tests/scenario_stock_lot_shipment_out.rst b/trytond/trytond/modules/stock_lot/tests/scenario_stock_lot_shipment_out.rst +index ea2b371..edaba40 100644 +--- a/trytond/trytond/modules/stock_lot/tests/scenario_stock_lot_shipment_out.rst ++++ b/trytond/trytond/modules/stock_lot/tests/scenario_stock_lot_shipment_out.rst +@@ -118,13 +118,13 @@ Pack the shipment:: + >>> shipment_out.state + 'packed' + >>> len(shipment_out.outgoing_moves) +- 3 ++ 2 + >>> sorted([m.quantity for m in shipment_out.outgoing_moves]) +- [0.0, 3.0, 7.0] ++ [3.0, 7.0] + >>> lot_quantities = {} + >>> for move in shipment_out.outgoing_moves: + ... number = move.lot.number if move.lot else '' + ... quantity = lot_quantities.setdefault(number, 0) + ... lot_quantities[number] += move.quantity + >>> sorted(lot_quantities.items()) +- [('', 0.0), ('00001', 3.0), ('00002', 7.0)] ++ [('00001', 3.0), ('00002', 7.0)] + +diff --git a/trytond/trytond/modules/stock_partial_shipment_out/ests/scenario_stock_shipment_out.rst b/trytond/trytond/modules/stock_partial_shipment_out/tests/scenario_stock_shipment_out.rst +index 321b6a9..4991c9d 100644 +--- a/trytond/trytond/modules/stock_partial_shipment_out/tests/scenario_stock_shipment_out.rst ++++ b/trytond/trytond/modules/stock_partial_shipment_out/tests/scenario_stock_shipment_out.rst +@@ -127,7 +127,3 @@ Create Shipment Out:: + 1 + >>> len(shipment_out.outgoing_moves) + 2 +- >>> shipment_out.click('pack') +- >>> outgoing_move1, outgoing_move2 = shipment_out.outgoing_moves +- >>> outgoing_move1.quantity == 0 +- True