Monday, April 14, 2025
1 change · saas-18.1
Resolved issues and error corrections
Closing the AI text generator dialog in Website editing no longer triggers an error. This prevents an unexpected traceback for users editing page snippets and keeps the editing flow uninterrupted.
Original PR description
Steps to reproduce the bug: - Enter Website Edit mode. - Drag and drop a snippet onto the page. - Click on the text in the snippet and then click on the AI text generator button in the editor toolbar. - Close the dialog. - A traceback occurs. The `onClose` handler in the `openChatGPTDialog` function was previously passing the `restore` function directly. This caused a TypeError when `closeParams` was introduced as an argument in the `onClose` function of the `dialogService` since this commit [1]. The bug comes from the fact that the `preserveCursor` function's `restore` expects a Map object, but `closeParams` is an object. To fix this, the `onClose` handler now calls `restore` inside an anonymous function (`() => restore()`) to avoid passing unexpected values and prevent the TypeError. [1]: https://github.com/odoo/odoo/commit/31c00161fd3a77c9fbd260754cb8c142fcb0d652 task-4708314