From 354d311b3ca57e950f19cd87b39b84626f59ddcb Mon Sep 17 00:00:00 2001 From: FrancoisGe Date: Tue, 7 Feb 2023 13:58:13 +0000 Subject: [PATCH] [FIX] web: click on button doesn't save MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Problem: In a list view, editing a record and then clicking an action button on that record does not save the edited field values. Expected behaviour: Changes applied to the record must be saved before executing the button action. Solution: The 46bd694c8a67f25470a911c1eb04e0bf2e17a5f7 commit in master solves this problem (TaskID-3132960). We will backport it and add a test for our use case. How to reproduce: - Go to a list view with one text field and one button action per record - Edit the text field - Click on the button action Before this commit: The value of the text field has been restored. We lost our modification. After this commit: The record has been saved. closes odoo/odoo#113120 Taskid: 3168517 X-original-commit: 5f5040730707e62885757aa6a39345a46cda9b48 Signed-off-by: Aaron Bohy (aab) Signed-off-by: Georis François (fge) --- .../web/static/tests/views/list_view_tests.js | 44 +++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/addons/web/static/tests/views/list_view_tests.js b/addons/web/static/tests/views/list_view_tests.js index 5e93d99c72f..d0ee8679358 100644 --- a/addons/web/static/tests/views/list_view_tests.js +++ b/addons/web/static/tests/views/list_view_tests.js @@ -1005,6 +1005,50 @@ QUnit.module("Views", (hooks) => { } ); + QUnit.test( + "list view: click on an action button saves the record before executing the action", + async function (assert) { + await makeView({ + type: "list", + resModel: "foo", + serverData, + arch: ` + + +