diff --git a/trytond/model/modelsql.py b/trytond/model/modelsql.py index 5bd72ab17f..5536a70681 100644 --- a/trytond/model/modelsql.py +++ b/trytond/model/modelsql.py @@ -539,7 +539,7 @@ class ModelSQL(ModelStorage): '%s,%s' % (cls.__name__, id_)) except KeyError: continue - sql_type = fields.Numeric('timestamp').sql_type().base + sql_type = fields.Float('timestamp').sql_type().base where.append((table.id == id_) & (Extract('EPOCH', Coalesce(table.write_date, table.create_date) diff --git a/trytond/tests/test_modelsql.py b/trytond/tests/test_modelsql.py index 18c72238cd..5c8b079eac 100644 --- a/trytond/tests/test_modelsql.py +++ b/trytond/tests/test_modelsql.py @@ -293,6 +293,7 @@ class ModelSQLTestCase(unittest.TestCase): # timestamp precision of sqlite is the second time.sleep(1) + transaction.timestamp[str(record)] = timestamp ModelsqlTimestamp.write([record], {}) transaction.commit()