[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:
committed by
Olivier Dony
parent
9f2b6e00ef
commit
baa3ce58fd
+2
-2
@@ -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]
|
||||
|
||||
Reference in New Issue
Block a user