[FIX] models: update field transient only, and do not modify state

Fixes regression introduced at 4d9e36a459
that caused all custom (manual) models to be reset to "base" models.

This prevented the creation and proper use of custom models.

opw-657017
Closes #9670

Partial version of #9663
This commit is contained in:
Raphael Collet
2015-11-20 17:36:23 +01:00
committed by Olivier Dony
parent 9f2b6e00ef
commit baa3ce58fd
+2 -2
View File
@@ -374,10 +374,10 @@ class BaseModel(object):
context = {}
cr.execute("""
UPDATE ir_model
SET name=%s, info=%s, state='base', transient=%s
SET transient=%s
WHERE model=%s
RETURNING id
""", [self._description, self.__doc__, self._transient, self._name])
""", [self._transient, self._name])
if not cr.rowcount:
cr.execute('SELECT nextval(%s)', ('ir_model_id_seq',))
model_id = cr.fetchone()[0]