[FIX] delivery: zip code comparison

Some countries, such as Canada, are using letters in their zip code.
When we check if the zip code is within the accepted range, we should
make sure to normalize it by making it case insensitive.

opw-767866
This commit is contained in:
Nicolas Martinelli
2017-09-06 17:31:02 +02:00
parent 60dbf05750
commit 18d63d4717
+2 -2
View File
@@ -201,9 +201,9 @@ class DeliveryCarrier(models.Model):
return False
if self.state_ids and contact.state_id not in self.state_ids:
return False
if self.zip_from and (contact.zip or '') < self.zip_from:
if self.zip_from and (contact.zip or '').upper() < self.zip_from.upper():
return False
if self.zip_to and (contact.zip or '') > self.zip_to:
if self.zip_to and (contact.zip or '').upper() > self.zip_to.upper():
return False
return self