From fcb6377b210fa8403188cf5416d6c8de38693b49 Mon Sep 17 00:00:00 2001 From: laurentbarontini Date: Tue, 20 Jan 2026 20:19:56 +0100 Subject: [PATCH] 20.01.26 --- modules/purchase_trade/weight_report.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/modules/purchase_trade/weight_report.py b/modules/purchase_trade/weight_report.py index 95ffeaa..68b6faa 100644 --- a/modules/purchase_trade/weight_report.py +++ b/modules/purchase_trade/weight_report.py @@ -106,17 +106,17 @@ class WeightReport(ModelSQL, ModelView): # Recherche ou création des parties seller_name = parties_data.get('seller', '') if seller_name: - seller = Party.find_or_create_by_name(seller_name) + seller = Party.getPartyByName(seller_name) report['seller'] = seller.id if seller else None buyer_name = parties_data.get('buyer', '') if buyer_name: - buyer = Party.find_or_create_by_name(buyer_name) + buyer = Party.getPartyByName(buyer_name) report['buyer'] = buyer.id if buyer else None carrier_name = parties_data.get('carrier', '') if carrier_name: - carrier = Party.find_or_create_by_name(carrier_name) + carrier = Party.getPartyByName(carrier_name) report['carrier'] = carrier.id if carrier else None # 5. Shipment Information @@ -143,7 +143,7 @@ class WeightReport(ModelSQL, ModelView): if port_loading_name: port_loading = Location.search([ ('name', '=', port_loading_name), - ('type', '=', 'storage') + ('type', '=', 'supplier') ], limit=1) report['port_loading'] = port_loading[0].id if port_loading else None @@ -151,7 +151,7 @@ class WeightReport(ModelSQL, ModelView): if port_destination_name: port_destination = Location.search([ ('name', '=', port_destination_name), - ('type', '=', 'storage') + ('type', '=', 'customer') ], limit=1) report['port_destination'] = port_destination[0].id if port_destination else None