20.01.26
This commit is contained in:
@@ -106,17 +106,17 @@ class WeightReport(ModelSQL, ModelView):
|
|||||||
# Recherche ou création des parties
|
# Recherche ou création des parties
|
||||||
seller_name = parties_data.get('seller', '')
|
seller_name = parties_data.get('seller', '')
|
||||||
if seller_name:
|
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
|
report['seller'] = seller.id if seller else None
|
||||||
|
|
||||||
buyer_name = parties_data.get('buyer', '')
|
buyer_name = parties_data.get('buyer', '')
|
||||||
if buyer_name:
|
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
|
report['buyer'] = buyer.id if buyer else None
|
||||||
|
|
||||||
carrier_name = parties_data.get('carrier', '')
|
carrier_name = parties_data.get('carrier', '')
|
||||||
if carrier_name:
|
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
|
report['carrier'] = carrier.id if carrier else None
|
||||||
|
|
||||||
# 5. Shipment Information
|
# 5. Shipment Information
|
||||||
@@ -143,7 +143,7 @@ class WeightReport(ModelSQL, ModelView):
|
|||||||
if port_loading_name:
|
if port_loading_name:
|
||||||
port_loading = Location.search([
|
port_loading = Location.search([
|
||||||
('name', '=', port_loading_name),
|
('name', '=', port_loading_name),
|
||||||
('type', '=', 'storage')
|
('type', '=', 'supplier')
|
||||||
], limit=1)
|
], limit=1)
|
||||||
report['port_loading'] = port_loading[0].id if port_loading else None
|
report['port_loading'] = port_loading[0].id if port_loading else None
|
||||||
|
|
||||||
@@ -151,7 +151,7 @@ class WeightReport(ModelSQL, ModelView):
|
|||||||
if port_destination_name:
|
if port_destination_name:
|
||||||
port_destination = Location.search([
|
port_destination = Location.search([
|
||||||
('name', '=', port_destination_name),
|
('name', '=', port_destination_name),
|
||||||
('type', '=', 'storage')
|
('type', '=', 'customer')
|
||||||
], limit=1)
|
], limit=1)
|
||||||
report['port_destination'] = port_destination[0].id if port_destination else None
|
report['port_destination'] = port_destination[0].id if port_destination else None
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user