details:   https://code.tryton.org/tryton/commit/513e76b6b3dc
branch:    7.0
user:      Cédric Krier <[email protected]>
date:      Fri Jun 12 23:42:19 2026 +0200
description:
        Set shipment address only when empty when changing party of sale 
amendment

        Closes #14796
        (grafted from 1a003fa7e62b9f5c0cda4494197e6553a585f7b9)
diffstat:

 modules/sale_amendment/sale.py |  4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diffs (21 lines):

diff -r f1e58ee5f34d -r 513e76b6b3dc modules/sale_amendment/sale.py
--- a/modules/sale_amendment/sale.py    Fri Jun 12 23:44:04 2026 +0200
+++ b/modules/sale_amendment/sale.py    Fri Jun 12 23:42:19 2026 +0200
@@ -403,7 +403,7 @@
 
     @fields.depends(
         'party', 'invoice_party', 'invoice_address',
-        'shipment_party', 'warehouse')
+        'shipment_party', 'shipment_address', 'warehouse')
     def on_change_party(self):
         if not self.invoice_party:
             self.invoice_address = None
@@ -412,7 +412,7 @@
         if self.party:
             if not self.invoice_address:
                 self.invoice_address = self.party.address_get(type='invoice')
-            if not self.shipment_party:
+            if not self.shipment_address:
                 with Transaction().set_context(
                         warehouse=(
                             self.warehouse.id if self.warehouse else None)):

Reply via email to