Check self.id against None before comparing to 0

issue5590
review23151002
This commit is contained in:
Nicolas Évrard
2016-06-03 13:02:55 +02:00
parent fbc8c97d72
commit abdc25bbd4
+1 -1
View File
@@ -32,7 +32,7 @@ class SaleLine:
pattern = super(SaleLine, self)._get_tax_rule_pattern()
from_country, to_country = None, None
if self.id < 0:
if self.id is None or self.id < 0:
warehouse = self.get_warehouse('warehouse')
if warehouse:
warehouse = Location(warehouse)