Always use the shipment address of the sale as delivery address for the shipment

The warehouse on the sale is not always filled instead it is the the warehouse
of the shipment that must be used for the comparison. But this makes the test
useless as the shipment address is always used ad delivery address.

Closes #14954
(grafted from d414eccc0ad58a86ba4083f5c5f427b4e41edee7)

--HG--
branch : 7.0
This commit is contained in:
Cédric Krier committed 2026-07-13 18:26:34 +02:00
1 parent 932e84c870
commit 0fb76cda0e
1 file changed
+1 -4
+1 -4
View File
@@ -932,10 +932,7 @@ class Sale(
shipment = Shipment(**values)
shipment.on_change_warehouse()
if Shipment.__name__ == 'stock.shipment.out':
if self.shipment_address == self.warehouse.address:
shipment.delivery_address = shipment.warehouse.address
else:
shipment.delivery_address = self.shipment_address
shipment.delivery_address = self.shipment_address
elif Shipment.__name__ == 'stock.shipment.out.return':
shipment.contact_address = values['customer'].address_get()
return shipment