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