summaryrefslogtreecommitdiff
path: root/addons/web/static/src/js
diff options
context:
space:
mode:
authorNans Lefebvre <len@odoo.com>2019-10-31 10:01:03 +0000
committerfw-bot <otis@odoo.com>2019-10-31 18:26:54 +0000
commitf2a16187582ed697ffeea1522e4f0c745bf77016 (patch)
tree2c8711534b296de9e82edd35f858c8d277bf82a1 /addons/web/static/src/js
parent6901adbe9851f62f451f272d629ede6e4dcb71e8 (diff)
[FIX] models: manage environment when loading records
When testing the import of records, a flush should be done to check all databases constraints and fields computations. Moreover, in case an exception is raised within a savepoint, the environment should be cleaned up, to avoid tricky bugs (see below). We replace the manual handling of savepoints with the savepoint context manager, which already handles all of this. This code predates the context manager, so in a way it was archaic. When testing the import of records, the following could happen: "An unknown issue occurred during import (possibly lost connection, data limit exceeded or memory limits exceeded)." This would happen on project tasks; the fields 'working_hours_open', 'working_hours_close', 'working_days_open', 'working_days_close', all depend on the computation of _compute_elapsed. Because this is a test import, the records would raise a MissingError, and fields_to_compute would always contain 3 of the fields. The resulting is an infinite loop giving this error. opw 2092134 closes odoo/odoo#39682 X-original-commit: 1a315e87b05fcbdefcb3db6d8d4837f6cc3e835c Signed-off-by: Nans Lefebvre (len) <len@odoo.com> Co-authored-by: Raphael Collet <rco@odoo.com>
Diffstat (limited to 'addons/web/static/src/js')
0 files changed, 0 insertions, 0 deletions