changeset 1361b4f271f3 in modules/sale_opportunity:6.0
details: 
https://hg.tryton.org/modules/sale_opportunity?cmd=changeset&node=1361b4f271f3
description:
        Avoid processing duplicate opportunities

        issue10496
        review338311002
        (grafted from d1009566d3149fcd209dd6836a87dafab5d64307)
diffstat:

 sale.py |  5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diffs (15 lines):

diff -r 5e94f1bc731d -r 1361b4f271f3 sale.py
--- a/sale.py   Mon May 03 15:58:35 2021 +0200
+++ b/sale.py   Fri Jun 11 09:43:54 2021 +0200
@@ -14,8 +14,9 @@
         pool = Pool()
         Opportunity = pool.get('sale.opportunity')
         with Transaction().set_context(_check_access=False):
-            opportunities = [s.origin for s in cls.browse(sales)
-                if isinstance(s.origin, Opportunity)]
+            opportunities = Opportunity.browse(
+                set(s.origin for s in cls.browse(sales)
+                    if isinstance(s.origin, Opportunity)))
         func(cls, sales)
         with Transaction().set_context(_check_access=False):
             Opportunity.process(opportunities)

Reply via email to