diff --git a/trytond/model/modelsql.py b/trytond/model/modelsql.py index ac5a5604bb..0ace0b7fdb 100644 --- a/trytond/model/modelsql.py +++ b/trytond/model/modelsql.py @@ -539,6 +539,8 @@ class ModelSQL(ModelStorage): '%s,%s' % (cls.__name__, id_)) except KeyError: continue + if timestamp is None: + continue sql_type = fields.Char('timestamp').sql_type().base where.append((table.id == id_) & (Extract('EPOCH', diff --git a/trytond/tests/test_modelsql.py b/trytond/tests/test_modelsql.py index 5c8b079eac..2e73b85f72 100644 --- a/trytond/tests/test_modelsql.py +++ b/trytond/tests/test_modelsql.py @@ -305,6 +305,10 @@ class ModelSQLTestCase(unittest.TestCase): self.assertRaises(ConcurrencyException, ModelsqlTimestamp.delete, [record]) + transaction.timestamp[str(record)] = None + ModelsqlTimestamp.write([record], {}) + transaction.commit() + transaction.timestamp.pop(str(record), None) ModelsqlTimestamp.write([record], {}) transaction.commit()