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
......@@ -30,22 +30,25 @@ for _ in range(10):
def makeSaleOrder():
sale_order = portal.sale_order_module.newContent(
portal_type='Sale Order',
title='Scalability Test Sale Order %s %s' % (random_seed, rng.randrange(10000)),
start_date=DateTime() + (rng.random() * 100.),
specialise_value=sale_trade_condition,
portal_type='Sale Order',
title='Scalability Test Sale Order %s %s' % (random_seed, rng.randrange(10000)),
start_date=DateTime() + (rng.random() * 100.),
specialise_value=sale_trade_condition,
)
sale_order.setStopDate(sale_order.getStopDate() + (rng.random() * 100.))
sale_order.setDestinationSectionValue(rng.choice(customers))
sale_order.setDestinationValue(rng.choice(customers))
# note: we use "edit" to have multiple entries in edit_workflow, like when
# a real user inputs data.
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()
for i in range(rng.randint(1, 10)):
sale_order.newContent(
portal_type='Sale Order Line',
int_index=i,
resource_value=rng.choice(resources),
quantity=1 + rng.random() * 20,
price=rng.random() * 100,
portal_type='Sale Order Line',
resource_value=rng.choice(resources),
quantity=1 + rng.random() * 20,
price=rng.random() * 100,
).edit(
int_index=i,
)
sale_order.Base_checkConsistency()
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