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')