Commit 167e4417 authored by Tatuya Kamada's avatar Tatuya Kamada

Inventory: Fix a issue actual stocks are not cancelled when cancelling inventories.

parent 9368a860
......@@ -96,7 +96,11 @@ class Inventory(Delivery):
sql_catalog_id = kw.pop("sql_catalog_id", None)
disable_archive = kw.pop("disable_archive", 0)
if self.getSimulationState() in self.getPortalDraftOrderStateList():
draft_state_list = list(self.getPortalDraftOrderStateList())
# we need reindex when we do cancelling inventories
if 'cancelled' in draft_state_list:
draft_state_list.remove('cancelled')
if self.getSimulationState() in draft_state_list:
# this prevent from trying to calculate stock
# with not all properties defined and thus making
# request with no condition in mysql
......
......@@ -2657,7 +2657,6 @@ class TestInventory(TestOrderMixin, ERP5TypeTestCase):
sequence_list.addSequenceString(sequence_string)
sequence_list.play(self)
@expectedFailure
def test_05_CancelInventoryAfterDelivered(self, quiet=0, run=run_all_test):
"""
Make sure that changing workflow state after delivered changes
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment