Do not compare sequence which are None
In Python3, it is no more allowed to compare None with None or any numeric. issue7874 review70451002
This commit is contained in:
+5
-1
@@ -63,7 +63,11 @@ class Invoice(metaclass=PoolMeta):
|
||||
if amount < 0:
|
||||
line = self._get_deposit_recall_invoice_line(
|
||||
amount, account, description)
|
||||
line.sequence = max(l.sequence for l in self.lines)
|
||||
try:
|
||||
line.sequence = max(l.sequence for l in self.lines
|
||||
if l.sequence is not None)
|
||||
except ValueError:
|
||||
pass
|
||||
line.save()
|
||||
if to_delete:
|
||||
InvoiceLine.delete(to_delete)
|
||||
|
||||
Reference in New Issue
Block a user