From 4db8aa5f94c75312b39810a3545493a4e7977b2e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Thu, 30 Jan 2025 12:25:14 +0100 Subject: [PATCH] Update the URL when creating new record When record saved is new, the URL must be updated just like if the view was switched. Closes #13849 (grafted from 49cbc9b99ed8883aac4bd1f252d6100a20cc9864) --HG-- branch : 7.0 --- sao/src/screen.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sao/src/screen.js b/sao/src/screen.js index 9f90b14256..ed21775bb9 100644 --- a/sao/src/screen.js +++ b/sao/src/screen.js @@ -1589,6 +1589,7 @@ }, save_current: function() { var current_record = this.current_record; + let new_record = current_record.id < 0; if (!current_record) { if (this.current_view && (this.current_view.view_type == 'tree') && @@ -1626,6 +1627,9 @@ path.splice(-1, 1, [path[path.length - 1][0], current_record.id]); } + if (new_record && this.switch_callback) { + this.switch_callback(); + } return this.group.get_by_path(path).then(record => { this.current_record = record; });