diff --git a/product/ERP5/MovementGroup.py b/product/ERP5/MovementGroup.py index b5e998df6b22a49ce6058bbf692a2ddde74d32bf..2d3529a5ccf58b2aa1eaa9abf79393a9fbd8edfd 100644 --- a/product/ERP5/MovementGroup.py +++ b/product/ERP5/MovementGroup.py @@ -149,17 +149,17 @@ class MovementGroupNode: property_list = [] if len(divergence_list): divergence_scope = self._movement_group.getDivergenceScope() - if divergence_scope is None: - # Update anyway (eg. CausalityAssignmentMovementGroup etc.) - pass - else: - related_divergence_list = [ - x for x in divergence_list \ - if divergence_scope == x.divergence_scope and \ - self.hasSimulationMovement(x.simulation_movement)] - if not len(related_divergence_list): + if divergence_scope is not None: + for divergence in divergence_list: + if (divergence_scope == getattr(divergence, 'divergence_scope', + # assume match if missing + # (e.g. for new simulation) + divergence_scope) and + self.hasSimulationMovement(divergence.simulation_movement)): + property_list.append(divergence.tested_property) + if not property_list: return True, {} - property_list = [x.tested_property for x in related_divergence_list] + # else update anyway (eg. CausalityAssignmentMovementGroup etc.) return self._movement_group.test(movement, self._property_dict, property_list=property_list) else: diff --git a/product/ERP5/tests/testAdvancedInvoicing.py b/product/ERP5/tests/testAdvancedInvoicing.py index 55a8808e0011a340ef0939250b9e0863c2dc8eeb..fe12765d571f7e162961ca68e0573310450ad87f 100644 --- a/product/ERP5/tests/testAdvancedInvoicing.py +++ b/product/ERP5/tests/testAdvancedInvoicing.py @@ -311,7 +311,6 @@ class TestAdvancedInvoice(TestSaleInvoiceMixin, ERP5TypeTestCase): self.assertEquals([], packing_list.getDivergenceList()) self.assertEquals('solved', packing_list.getCausalityState()) - @newSimulationExpectedFailure def test_AdoptQuantityDivergenceOnInvoiceLineWithStoppedPackingList(self, quiet=quiet, run=RUN_ALL_TESTS): """Adopt quantity with stopped packing list""" @@ -1040,7 +1039,6 @@ class TestAdvancedSaleInvoice(TestAdvancedInvoice): """) sequence_list.play(self, quiet=quiet) - @newSimulationExpectedFailure def test_13_acceptQuantityDivergenceOnInvoiceWithStartedPackingList( self, quiet=quiet, run=RUN_ALL_TESTS): if not run: return