Commit efaea8fe authored by Rafael Monnerat's avatar Rafael Monnerat

erp5_open_trade: Don't archive already archived Open Orders

See merge request !1766
parents dd00c75c c0676d7d
......@@ -11,4 +11,7 @@ for open_order in sci.getPortal().portal_catalog.searchResults(
reference=open_order.getReference(),
validation_state='validated'):
if this_uid != open_order.uid:
# The object could be already archived on this transaction, and not
# reindexed yet.
if open_order.getValidationState() != "archived":
open_order.getObject().archive()
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