Daily updates from Odoo
Tuesday, April 21, 2026
2 changes
1 change
Code cleanup and technical improvements
This update simplifies the AI image generation flow and makes it more reliable when users create or enhance images. It also preserves product image actions after form refreshes, so users can continue working with AI image tools without losing available options.
Original PR description
- The renderAndSaveMedia function was only a wrapper around 2 function calls renderMedia and saveFunction which made it not very useful. So, renderAndSaveMedia function is removed and renderMedia and…
- The renderAndSaveMedia function was only a wrapper around 2 function calls renderMedia and saveFunction which made it not very useful. So, renderAndSaveMedia function is removed and renderMedia and saveFunction are used directly. - In the original image generation PR, a closeParams dict was introduced to store the closeReason of the MediaDialog such as "save", "discard" or "ai" and the id of the ai chat channel opened from the MediaDialog if any. This was mainly introduced to handle the following case: 1. Go to the website. 2. Insert an 'Image' snippet from the 'Inner Content' section. 3. Click on the AI button from the media dialog. 4. The media dialog will be closed and the snippet placeholder will be removed. Clicking on 'UseThis' button under AI generated images will do nothing because the snippet placeholder was removed. Extra logic was introduced when the closeReason is "ai" to keep the snippet placeholder. However, this complicated the close logic because the logic needs to take into account the newly introduced "ai" state in addition to the other 2 states of "save" and "discard". This commit removes the closeParams dict and introduces aiBeforeCloseHandler logic that will replace the snippet placeholder by a dummy image before closing the media dialog and which can then be replaced by the AI. See also: Community PR: https://github.com/odoo/odoo/pull/259148 Image generation original commits: - Enterprise commit 99f76c1c - Community commit 63c0b17e Image generation original PRs: - Enterprise https://github.com/odoo/enterprise/pull/104712 - Community https://github.com/odoo/odoo/pull/244419
1 change
Code cleanup and technical improvements
This change renames an internal method so its name better matches what it actually does. It should reduce confusion for developers maintaining the system, while keeping the existing behavior for users the same.
Original PR description
The method `get_formview_action` in `ir_ui_view.py` is primarily used by M2O UI fields to open views of a linked record. However, because it is frequently overridden across the codebase to open various other view types (such as kanban and list views), the original name is misleading. Rename the method to `get_defaultview_action` to better reflect its actual behavior and prevent developer confusion. task-6068437