Saturday, February 10, 2024
1 change · master
Resolved issues and error corrections
Odoo now handles errors while opening views in a consistent way, such as returning users to a list or previous screen instead of showing an empty page or behaving differently depending on how they navigated. This makes the web interface more reliable and less confusing when records are missing or cannot be loaded.
Original PR description
Before this commit, there are multiples different behaviours, handled by different parts of the code, when an error occurs when loading a view : - If we loaded a faulty form view (wrong id) from the…
Before this commit, there are multiples different behaviours, handled by different parts of the code, when an error occurs when loading a view : - If we loaded a faulty form view (wrong id) from the url, the page is reloaded on the multi-record view of the same action. - If we loaded a faulty form view (error in loading) from the url, an empty page is shown. - If we clicked on a deleted record (form view) on the breadcrumb, we stay on the current view. - If we clicked on the back button of the browser, that it lead us to a deleted record (form view), the page is reloaded on the multi-record view of the same action. - If we clicked on a previously deleted record in a multi-record view, we stay on the multi-record view. These multiple behaviours for handling errors when loading a view is confusing and error-prone. Now, the action service will handle all the behaviour when an error occurs when loading a view consistently : - If an error occurs when clicking on the breadcrumb, the previous view of the faulty one is loaded. - If an error occurs when loading a new view, from an url or from the back button, a multi-record view will be loaded. - If an error occurs when loading a new view, from another view, we stay on that view. Note that, this commit also fixes an issue in fetchRecordErrorHandler. Since [1], the handler was not working properly, it was raising another error because of a typographical error. This commit also fix the tests that weren't failing because they were doing a doAction and not a loadState. [1] : 016a72bae9c3194459b1f25d9ae5678ce50aead7