Cédric Krier pushed to branch branch/default at Tryton / Tryton
Commits: 17ec28ea by Cédric Krier at 2023-03-16T13:31:20+01:00 Use instances in skip sets instead of id - - - - - 2 changed files: - modules/purchase/purchase.py - modules/sale/sale.py Changes: ===================================== modules/purchase/purchase.py ===================================== @@ -1337,6 +1337,6 @@ return if self.product.type == 'service': return - skip_ids = set(x.id for x in self.moves_ignored) + skips = set(self.moves_ignored) quantity = abs(self.quantity) for move in self.moves: @@ -1341,6 +1341,6 @@ quantity = abs(self.quantity) for move in self.moves: - if move.state == 'done' or move.id in skip_ids: + if move.state == 'done' or move in skips: quantity -= Uom.compute_qty(move.uom, move.quantity, self.unit) return quantity ===================================== modules/sale/sale.py ===================================== @@ -1366,6 +1366,6 @@ return if self.product.type == 'service': return - skip_ids = set(x.id for x in self.moves_ignored) + skips = set(self.moves_ignored) quantity = abs(self.quantity) for move in self.moves: @@ -1370,6 +1370,6 @@ quantity = abs(self.quantity) for move in self.moves: - if move.state == 'done' or move.id in skip_ids: + if move.state == 'done' or move in skips: quantity -= Uom.compute_qty(move.uom, move.quantity, self.unit) return quantity View it on Heptapod: https://foss.heptapod.net/tryton/tryton/-/commit/17ec28ea0784170159f1a04c62557c4f0814da3a -- View it on Heptapod: https://foss.heptapod.net/tryton/tryton/-/commit/17ec28ea0784170159f1a04c62557c4f0814da3a You're receiving this email because of your account on foss.heptapod.net.