Monday, March 23, 2026
1 change · master
New functionality added to Odoo
Users can now generate images with AI directly from the media dialog and use them in website, email, product, and editor workflows. Product image editing now opens the media manager, giving users more options to reuse existing assets, upload files, import by URL, or create AI-generated images.
Original PR description
[IMP] *: allow AI image generation on media dialog *: html_editor, html_builder, mail, product, web_splash, website, website_sale - Extract the MediaDialog save logic into media_dialog_utils so that…
[IMP] *: allow AI image generation on media dialog *: html_editor, html_builder, mail, product, web_splash, website, website_sale - Extract the MediaDialog save logic into media_dialog_utils so that it can be reused from 'ai_chat' channels to save generated images. - Extract the X2ManyImageField and X2ManyMediaViewer save logic into image_library to be reused from 'ai_chat' channels to save generated images. - Create a new ImageFieldWithMediaDialog to be used with Many2One fields and use it with product.template model. When editing the image of a product, the media manager will appear instead of the file browser. This will give users the ability to select from images already stored in the media manager, upload images, use URLs to retrieve images or generate images using AI. - Some plugin actions open the media dialog in the load function and sets the save function of the media dialog to a dummy save function that only assigns the selected images from the media dialog to a variable and the actual save logic is done in the apply method (which takes the assigned variable of the load function as an input). Given that the save logic is passed from the media dialog to the 'ai_chat' channel (which is a dummy function in this case), it is not possible to save AI generated images. So, these actions are refactored such that the load method is removed and the media dialog is opened in the apply method with the full save logic. SEE https://github.com/odoo/enterprise/pull/104712 task-5153846