Fix default value and check of last_timestamp of Sequence

The client integer widget does not allow to display float value. So the default
value of last_timestamp is replaced by None which fails later in the check.
Also the check must not validate when it is not filled because in Python3 None
and int are unorderable.

issue5591
review28571002
This commit is contained in:
Cédric Krier committed 2016-07-26 23:07:18 +02:00
1 parent cc33880308
commit c0709a7b2c
1 file changed
+3 -2
+3 -2
View File
@@ -150,7 +150,7 @@ class Sequence(ModelSQL, ModelView):
@staticmethod
def default_last_timestamp():
return 0.0
return 0
@staticmethod
def default_code():
@@ -248,7 +248,8 @@ class Sequence(ModelSQL, ModelView):
for sequence in sequences:
next_timestamp = cls._timestamp(sequence)
if sequence.last_timestamp > next_timestamp:
if (sequence.last_timestamp is not None
and sequence.last_timestamp > next_timestamp):
cls.raise_user_error('future_last_timestamp', (
sequence.rec_name,))