Commit 16e85631 authored by Romain Courteaud's avatar Romain Courteaud

erp5_open_trade: do not rely on the deprecated movement table

parent 06e62455
...@@ -17,10 +17,12 @@ for open_order_line in context.objectValues(): ...@@ -17,10 +17,12 @@ for open_order_line in context.objectValues():
# no new simulation movement to create # no new simulation movement to create
# (expand always reindex the full simulation tree, # (expand always reindex the full simulation tree,
# which can be cpu costly when we have many hosting subscription) # which can be cpu costly when we have many hosting subscription)
simulation_movement = portal.portal_catalog.getResultValue( simulation_movement_list = portal.portal_simulation.getMovementHistoryList(
portal_type="Simulation Movement", portal_type='Simulation Movement',
aggregate__uid=item.getUid(), aggregate__uid=item.getUid(),
**{'movement.stop_date': stop_date} from_date=stop_date,
at_date=stop_date,
only_accountable=False,
) )
if simulation_movement is None: if len(simulation_movement_list) == 0:
item.updateSimulation(expand_root=1) item.updateSimulation(expand_root=1)
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