Preserve record id to have False value

This commit is contained in:
Cédric Krier committed 2008-08-14 11:21:31 +02:00
1 parent c6081b4266
commit d1555bc3d9
1 file changed
+3 -2
+3 -2
View File
@@ -146,11 +146,12 @@ class ModelRecord(SignalEvent):
try:
self.id = self.rpc.create(value, self.context_get())
except Exception, exception:
self.id = common.process_exception(exception, self.window, 'object',
res = common.process_exception(exception, self.window, 'object',
'execute', self.resource, 'create', value,
self.context_get())
if not self.id or self.id < 0:
if not res:
return False
self.id = res
else:
if not self.is_modified():
return self.id