Add num_orders property with deprecation warning for backward compatibility.
@@ -11,6 +11,7 @@ from django.utils.translation import pgettext_lazy
from phonenumber_field.modelfields import PhoneNumberField
from oscar.core.compat import AUTH_USER_MODEL
+from oscar.core.decorators import deprecated
from oscar.models.fields import UppercaseCharField
@@ -567,6 +568,11 @@ class AbstractUserAddress(AbstractShippingAddress):
'__all__': [_("This address is already in your address"
" book")]})
+ @property
+ @deprecated
+ def num_orders(self):
+ return self.num_orders_as_shipping_address
+
class AbstractBillingAddress(AbstractAddress):
class Meta:
