[FIX] core: SSF should re-read from the record after saving

Before this change, the SSF would read from the record after
creation but wouldn't do so after a write.

This doesn't conform to the behaviour of the web client (which does a
read() after saving a form), and means the effect of field
inverses (when the dependencies of a writable field are also in the
form) or overrides to write wouldn't be visible afterwards.

It's always possible to just re-create the form from scratch, but the
intention has always been that the form would work correctly after a
save.

closes odoo/odoo#50363

X-original-commit: 45398c09c0231e61b83d378d5939ec12d7465844
Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
This commit is contained in:
Ronald Portier
2020-04-29 07:31:00 +00:00
parent c2d5a4beaf
commit eae51e5fa8
+3 -3
View File
@@ -1823,9 +1823,9 @@ class Form(object):
r.write(values)
else:
r = self._model.create(values)
self._values.update(
record_to_values(self._view['fields'], r)
)
self._values.update(
record_to_values(self._view['fields'], r)
)
self._changed.clear()
self._model.flush()
self._model.env.clear() # discard cache and pending recomputations