Remove old-style of super() calls

This commit is contained in:
Nicolas Évrard
2025-04-04 00:45:18 +02:00
parent 5781a49606
commit cbdad75620
350 changed files with 1235 additions and 1235 deletions
+4 -4
View File
@@ -39,7 +39,7 @@ class Carrier(metaclass=PoolMeta):
@classmethod
def __setup__(cls):
super(Carrier, cls).__setup__()
super().__setup__()
selection = ('weight', 'Weight')
if selection not in cls.carrier_cost_method.selection:
cls.carrier_cost_method.selection.append(selection)
@@ -64,13 +64,13 @@ class Carrier(metaclass=PoolMeta):
return weight_price, self.weight_currency.id
def get_sale_price(self):
price, currency_id = super(Carrier, self).get_sale_price()
price, currency_id = super().get_sale_price()
if self.carrier_cost_method == 'weight':
price, currency_id = self._get_weight_price()
return price, currency_id
def get_purchase_price(self):
price, currency_id = super(Carrier, self).get_purchase_price()
price, currency_id = super().get_purchase_price()
if self.carrier_cost_method == 'weight':
price, currency_id = self._get_weight_price()
return price, currency_id
@@ -102,7 +102,7 @@ class WeightPriceList(ModelSQL, ModelView):
@classmethod
def __setup__(cls):
super(WeightPriceList, cls).__setup__()
super().__setup__()
cls._order.insert(0, ('weight', 'ASC'))
@fields.depends('carrier', '_parent_carrier.weight_currency')
+1 -1
View File
@@ -23,7 +23,7 @@ class Sale(metaclass=PoolMeta):
return parcel_weight(parcel, self.carrier.weight_uom, 'unit')
def _get_carrier_context(self, carrier):
context = super(Sale, self)._get_carrier_context(carrier)
context = super()._get_carrier_context(carrier)
if not carrier or carrier.carrier_cost_method != 'weight':
return context
+2 -2
View File
@@ -27,7 +27,7 @@ class ShipmentIn(metaclass=PoolMeta):
@fields.depends('carrier', 'incoming_moves',
methods=['_group_parcel_key', '_parcel_weight'])
def _get_carrier_context(self):
context = super(ShipmentIn, self)._get_carrier_context()
context = super()._get_carrier_context()
if not self.carrier:
return context
if self.carrier.carrier_cost_method != 'weight':
@@ -63,7 +63,7 @@ class ShipmentOut(metaclass=PoolMeta):
'warehouse_storage', 'warehouse_output',
methods=['_group_parcel_key', '_parcel_weight'])
def _get_carrier_context(self):
context = super(ShipmentOut, self)._get_carrier_context()
context = super()._get_carrier_context()
if not self.carrier:
return context
if self.carrier.carrier_cost_method != 'weight':