File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 22
33## 2025-11-20
44
5+ ### 2025-11-20 10:24:55 - [ FIX] add safety check to prevent reload on wrong page after navigation
6+
7+ - Added URL verification before executing scheduled page reload
8+ - Prevents reload on wrong page if user navigates away during 100ms timeout
9+ - Only reloads if user is still on ir.model.fields page
10+ - Protects against data loss on unrelated pages
11+
512### 2025-11-20 10:12:34 - [ FIX] remove meaningless return after page reload in custom fields UI
13+
614- Fixed bug where return statement after window.location.reload() was unreachable
715- For existing records, reload happens immediately before return, destroying page context
816- For new records, setTimeout creates race condition where return value is meaningless
917- Added proper handling for result === false case without reload
1018- Added comments explaining control flow in reload scenarios
11-
Original file line number Diff line number Diff line change @@ -29,7 +29,11 @@ patch(FormController.prototype, {
2929 // For new records, wait a bit for URL to update, then reload
3030 // This ensures the URL contains the new record ID
3131 setTimeout ( ( ) => {
32- window . location . reload ( ) ;
32+ // Safety check: only reload if still on ir.model.fields page
33+ // Prevents unwanted reloads if user navigated away during timeout
34+ if ( window . location . href . includes ( "ir.model.fields" ) ) {
35+ window . location . reload ( ) ;
36+ }
3337 } , 100 ) ;
3438 // Don't return - page will reload soon, making return value meaningless
3539 } else {
You can’t perform that action at this time.
0 commit comments