Commit 3075accf authored by Titouan Soulard's avatar Titouan Soulard

erp5_trade: fix tests

It is now needed to precompute inventories. Workflow has a new transition.
parent 2d36be26
Pipeline #39542 failed with stage
in 0 seconds
...@@ -206,7 +206,10 @@ class TestInventory(TestOrderMixin, ERP5TypeTestCase): ...@@ -206,7 +206,10 @@ class TestInventory(TestOrderMixin, ERP5TypeTestCase):
# Now, quantity is not defined any more automatically. # Now, quantity is not defined any more automatically.
inventory_line.edit(quantity=sum([x.getQuantity() for x in \ inventory_line.edit(quantity=sum([x.getQuantity() for x in \
aggregate_value_list])) aggregate_value_list]))
inventory.Inventory_computeOffsetAction()
self.tic()
inventory.deliver() inventory.deliver()
self.tic()
inventory_list.append(inventory) inventory_list.append(inventory)
sequence.edit(inventory_list = inventory_list) sequence.edit(inventory_list = inventory_list)
...@@ -240,7 +243,10 @@ class TestInventory(TestOrderMixin, ERP5TypeTestCase): ...@@ -240,7 +243,10 @@ class TestInventory(TestOrderMixin, ERP5TypeTestCase):
inventory_line.edit(resource_value = sequence.get('resource'), inventory_line.edit(resource_value = sequence.get('resource'),
inventory = 24. inventory = 24.
) )
inventory.Inventory_computeOffsetAction()
self.tic()
inventory.deliver() inventory.deliver()
self.tic()
inventory_list.append(inventory) inventory_list.append(inventory)
sequence.edit(inventory_list=inventory_list) sequence.edit(inventory_list=inventory_list)
...@@ -255,7 +261,10 @@ class TestInventory(TestOrderMixin, ERP5TypeTestCase): ...@@ -255,7 +261,10 @@ class TestInventory(TestOrderMixin, ERP5TypeTestCase):
portal_type = self.inventory_line_portal_type, portal_type = self.inventory_line_portal_type,
resource_value = sequence.get("second_resource"), resource_value = sequence.get("second_resource"),
inventory = 101) inventory = 101)
inventory.Inventory_computeOffsetAction()
self.tic()
inventory.deliver() inventory.deliver()
self.tic()
inventory_list.append(inventory) inventory_list.append(inventory)
sequence.edit(inventory_list=inventory_list) sequence.edit(inventory_list=inventory_list)
...@@ -270,7 +279,10 @@ class TestInventory(TestOrderMixin, ERP5TypeTestCase): ...@@ -270,7 +279,10 @@ class TestInventory(TestOrderMixin, ERP5TypeTestCase):
portal_type = self.inventory_line_portal_type, portal_type = self.inventory_line_portal_type,
resource_value = sequence.get("second_resource"), resource_value = sequence.get("second_resource"),
inventory = 101) inventory = 101)
inventory.Inventory_computeOffsetAction()
self.tic()
inventory.deliver() inventory.deliver()
self.tic()
inventory_list.append(inventory) inventory_list.append(inventory)
sequence.edit(inventory_list=inventory_list) sequence.edit(inventory_list=inventory_list)
...@@ -323,8 +335,10 @@ class TestInventory(TestOrderMixin, ERP5TypeTestCase): ...@@ -323,8 +335,10 @@ class TestInventory(TestOrderMixin, ERP5TypeTestCase):
) )
# When checking the not full inventory function, quantity must remain the same if # When checking the not full inventory function, quantity must remain the same if
# no inventory line defined for a variation # no inventory line defined for a variation
inventory.Inventory_computeOffsetAction()
self.tic()
inventory.deliver() inventory.deliver()
self.tic()
def stepCreateFullVariatedInventory(self, sequence=None, sequence_list=None, **kw): def stepCreateFullVariatedInventory(self, sequence=None, sequence_list=None, **kw):
""" """
...@@ -347,7 +361,10 @@ class TestInventory(TestOrderMixin, ERP5TypeTestCase): ...@@ -347,7 +361,10 @@ class TestInventory(TestOrderMixin, ERP5TypeTestCase):
portal_type = self.inventory_line_portal_type, portal_type = self.inventory_line_portal_type,
resource_value = sequence.get("second_resource"), resource_value = sequence.get("second_resource"),
inventory = 101) inventory = 101)
inventory.Inventory_computeOffsetAction()
self.tic()
inventory.deliver() inventory.deliver()
self.tic()
def stepCreatePackingListForModule(self, sequence=None, def stepCreatePackingListForModule(self, sequence=None,
sequence_list=None, **kw): sequence_list=None, **kw):
...@@ -2072,7 +2089,10 @@ class TestInventory(TestOrderMixin, ERP5TypeTestCase): ...@@ -2072,7 +2089,10 @@ class TestInventory(TestOrderMixin, ERP5TypeTestCase):
portal_type = self.inventory_line_portal_type, portal_type = self.inventory_line_portal_type,
resource_value = resource_value, resource_value = resource_value,
inventory = 100) inventory = 100)
inventory.Inventory_computeOffsetAction()
self.tic()
inventory.deliver() inventory.deliver()
self.tic()
inventory_list.append(inventory) inventory_list.append(inventory)
sequence.edit(inventory_list=inventory_list) sequence.edit(inventory_list=inventory_list)
...@@ -2276,7 +2296,10 @@ class TestInventory(TestOrderMixin, ERP5TypeTestCase): ...@@ -2276,7 +2296,10 @@ class TestInventory(TestOrderMixin, ERP5TypeTestCase):
portal_type=self.inventory_line_portal_type, portal_type=self.inventory_line_portal_type,
resource_value=resource_value, resource_value=resource_value,
inventory=inventory_quantity) inventory=inventory_quantity)
inventory.Inventory_computeOffsetAction()
self.tic()
inventory.deliver() inventory.deliver()
self.tic()
inventory_list.append(inventory) inventory_list.append(inventory)
sequence.edit(inventory_list=inventory_list) sequence.edit(inventory_list=inventory_list)
...@@ -2395,7 +2418,10 @@ class TestInventory(TestOrderMixin, ERP5TypeTestCase): ...@@ -2395,7 +2418,10 @@ class TestInventory(TestOrderMixin, ERP5TypeTestCase):
portal_type = self.inventory_line_portal_type, portal_type = self.inventory_line_portal_type,
resource_value = sequence.get("second_resource"), resource_value = sequence.get("second_resource"),
inventory = 100) inventory = 100)
inventory.Inventory_computeOffsetAction()
self.tic()
inventory.deliver() inventory.deliver()
self.tic()
inventory_list.append(inventory) inventory_list.append(inventory)
sequence.edit(inventory_list=inventory_list) sequence.edit(inventory_list=inventory_list)
...@@ -2428,7 +2454,10 @@ class TestInventory(TestOrderMixin, ERP5TypeTestCase): ...@@ -2428,7 +2454,10 @@ class TestInventory(TestOrderMixin, ERP5TypeTestCase):
portal_type = self.inventory_line_portal_type, portal_type = self.inventory_line_portal_type,
resource_value = sequence.get("second_resource"), resource_value = sequence.get("second_resource"),
inventory = inventory2) inventory = inventory2)
inventory.Inventory_computeOffsetAction()
self.tic()
inventory.deliver() inventory.deliver()
self.tic()
inventory_list.append(inventory) inventory_list.append(inventory)
sequence.edit(inventory_list=inventory_list) sequence.edit(inventory_list=inventory_list)
...@@ -2736,6 +2765,8 @@ class TestInventory(TestOrderMixin, ERP5TypeTestCase): ...@@ -2736,6 +2765,8 @@ class TestInventory(TestOrderMixin, ERP5TypeTestCase):
resource_uid=product.getUid()), resource_uid=product.getUid()),
0) 0)
inventory.Inventory_computeOffsetAction()
self.tic()
inventory.deliver() inventory.deliver()
self.tic() self.tic()
......
...@@ -506,6 +506,8 @@ class TestOrderBuilder(TestOrderBuilderMixin, ERP5TypeTestCase): ...@@ -506,6 +506,8 @@ class TestOrderBuilder(TestOrderBuilderMixin, ERP5TypeTestCase):
start_date=DateTime('2018/01/12'), start_date=DateTime('2018/01/12'),
destination_value=node_1, destination_value=node_1,
full_inventory=1) full_inventory=1)
inventory.Inventory_computeOffsetAction()
self.tic()
inventory.deliver() inventory.deliver()
self.tic() self.tic()
# keep in stock only movements coming from inventory. It is intentional to # keep in stock only movements coming from inventory. It is intentional to
......
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