Add support of timestamp field on client

issue6463
review50521002
This commit is contained in:
Cédric Krier committed 2018-08-01 11:37:09 +02:00
1 parent 3158279cb3
commit c3d2be19f5
2 files changed
+2 -1

No files matched your search

+1
View File
@@ -99,6 +99,7 @@ class Timestamp(Field):
'''
_type = 'timestamp'
_sql_type = 'TIMESTAMP'
format = '%H:%M:%S.%f'
def sql_format(self, value):
if value is None:
+1 -1
View File
@@ -322,7 +322,7 @@ class Model(WarningErrorMixin, URLMixin, PoolBase, metaclass=ModelMeta):
# Set relation_field only if there is no ambiguity
if len(relation_fields) == 1:
res[field]['relation_field'], = relation_fields
if res[field]['type'] in ('datetime', 'time'):
if res[field]['type'] in ('datetime', 'time', 'timestamp'):
res[field]['format'] = copy.copy(cls._fields[field].format)
if res[field]['type'] == 'selection':
res[field]['context'] = copy.copy(cls._fields[field].context)