From b78e64f9f1e36453b3680e362069496339e9ac34 Mon Sep 17 00:00:00 2001 From: laurentbarontini Date: Mon, 6 Apr 2026 09:50:15 +0200 Subject: [PATCH] Add counter --- modules/purchase_trade/party.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/modules/purchase_trade/party.py b/modules/purchase_trade/party.py index e51c6e8..b4cb2a2 100755 --- a/modules/purchase_trade/party.py +++ b/modules/purchase_trade/party.py @@ -51,9 +51,12 @@ class PartyExecution(ModelSQL,ModelView): Shipment = Pool().get('stock.shipment.in') shipments = Shipment.search([ ('controller', '!=', None), - ('to_location.country', '!=', None), - ('to_location.country.region', 'child_of', [area.id]), ]) + execution = cls() + execution.area = area + shipments = [ + shipment for shipment in shipments + if execution.matches_shipment(shipment)] total = len(shipments) if not total: return Decimal('0')