Commit 346b7073 authored by Jérome Perrin's avatar Jérome Perrin

fixup! fixup! fixup! scalability_test: script to create some sales order

parent d59b731f
Pipeline #26590 failed with stage
in 0 seconds
...@@ -35,17 +35,20 @@ def makeSaleOrder(): ...@@ -35,17 +35,20 @@ def makeSaleOrder():
start_date=DateTime() + (rng.random() * 100.), start_date=DateTime() + (rng.random() * 100.),
specialise_value=sale_trade_condition, specialise_value=sale_trade_condition,
) )
sale_order.setStopDate(sale_order.getStopDate() + (rng.random() * 100.)) # note: we use "edit" to have multiple entries in edit_workflow, like when
sale_order.setDestinationSectionValue(rng.choice(customers)) # a real user inputs data.
sale_order.setDestinationValue(rng.choice(customers)) sale_order.edit(stop_date=sale_order.getStopDate() + (rng.random() * 100.))
sale_order.edit(destination_section_value=rng.choice(customers))
sale_order.edit(destination_value=rng.choice(customers))
sale_order.SaleOrder_applySaleTradeCondition() sale_order.SaleOrder_applySaleTradeCondition()
for i in range(rng.randint(1, 10)): for i in range(rng.randint(1, 10)):
sale_order.newContent( sale_order.newContent(
portal_type='Sale Order Line', portal_type='Sale Order Line',
int_index=i,
resource_value=rng.choice(resources), resource_value=rng.choice(resources),
quantity=1 + rng.random() * 20, quantity=1 + rng.random() * 20,
price=rng.random() * 100, price=rng.random() * 100,
).edit(
int_index=i,
) )
sale_order.Base_checkConsistency() sale_order.Base_checkConsistency()
sale_order.confirm() sale_order.confirm()
......
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