changeset 6fc17145b303 in modules/sale_shipment_cost:default
details: 
https://hg.tryton.org/modules/sale_shipment_cost?cmd=changeset;node=6fc17145b303
description:
        Use depends on methods

        It is no more needed to maintain manually the dependencies of
        on_change_with_available_carriers.

        issue8263
        review273251002
diffstat:

 sale.py |  9 +++------
 1 files changed, 3 insertions(+), 6 deletions(-)

diffs (33 lines):

diff -r 86ffa16d5166 -r 6fc17145b303 sale.py
--- a/sale.py   Sun Apr 07 19:50:04 2019 +0200
+++ b/sale.py   Mon Apr 15 22:08:18 2019 +0200
@@ -127,10 +127,7 @@
         carriers = CarrierSelection.get_carriers(pattern)
         return [c.id for c in carriers]
 
-    # XXX We must have the same depends than on_change_with_available_carriers,
-    # for now it is maintain manually until we can specify cross-kind depends
-    # on on_changes
-    @fields.depends('carrier', 'warehouse', 'shipment_address')
+    @fields.depends('carrier', methods=['on_change_with_available_carriers'])
     def on_change_party(self):
         super(Sale, self).on_change_party()
         self.available_carriers = self.on_change_with_available_carriers()
@@ -140,7 +137,7 @@
         elif not self.available_carriers:
             self.carrier = None
 
-    @fields.depends('carrier', 'warehouse', 'shipment_address')
+    @fields.depends('carrier', methods=['on_change_with_available_carriers'])
     def on_change_shipment_party(self):
         super(Sale, self).on_change_shipment_party()
         self.available_carriers = self.on_change_with_available_carriers()
@@ -150,7 +147,7 @@
         elif not self.available_carriers:
             self.carrier = None
 
-    @fields.depends('carrier', 'warehouse', 'shipment_address')
+    @fields.depends('carrier', methods=['on_change_with_available_carriers'])
     def on_change_shipment_address(self):
         try:
             super_on_change = super(Sale, self).on_change_shipment_address

Reply via email to