Skip to content

[20.0][FIX] web_dialog_size: show a single expand button in the full composer - #3763

Open
cristina-hidalgo-tecnativa wants to merge 1 commit into
OCA:20.0from
Tecnativa:20.0-fix-web_dialog_size-single_expand_button
Open

cristina-hidalgo-tecnativa wants to merge 1 commit into
OCA:20.0from
Tecnativa:20.0-fix-web_dialog_size-single_expand_button

Conversation

@cristina-hidalgo-tecnativa

Copy link
Copy Markdown

Odoo added an expand/compress button to the full message composer (odoo/odoo#242468), with its own state. This module already adds one to every dialog, so the composer showed two buttons, and with web_dialog_size.default_maximize enabled Odoo's icon didn't match the dialog size.

  • Hide core's button so only this module's is shown.
  • Use core's fs size and icons (expand_content / close_fullscreen).

Core's button only exists in ActionDialog, so extending it wouldn't cover the other dialogs.

@Tecnativa TT64890
@pedrobaeza @carlos-lopez-tecnativa

@pedrobaeza pedrobaeza added this to the 20.0 milestone Oct 28, 2026

@pedrobaeza pedrobaeza left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested and working.

@Andrii9090-tecnativa Andrii9090-tecnativa left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested on runboat

@carlos-lopez-tecnativa carlos-lopez-tecnativa left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I also see two buttons in other dialogs, for example, when you use Create and edit... in a many2one field:

Image

This makes me think that Odoo already supports this in the core Dialog, but only displays the button when onExpand is defined:
https://github.com/odoo/odoo/blob/dd797414fa250a039c6bf494cfb281d67b4bf83c/addons/web/static/src/core/dialog/dialog.xml#L39

@carlos-lopez-tecnativa carlos-lopez-tecnativa left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure whether resizing the dialog re-renders the whole view and reloads the record, but when I try to add a custom filter, this popup is very slow. Other dialogs work fine, but this one is very slow.

Could you check this? Or is this standard Odoo behavior?

2026-10-28.09-37-29.mp4

@cristina-hidalgo-tecnativa

Copy link
Copy Markdown
Author

I'm not sure whether resizing the dialog re-renders the whole view and reloads the record, but when I try to add a custom filter, this popup is very slow. Other dialogs work fine, but this one is very slow.

Could you check this? Or is this standard Odoo behavior?
2026-10-28.09-37-29.mp4

I noticed the URL has debug=assets, which makes everything noticeably slower in Odoo, and the "Loading..." indicator also shows up when navigating menus with no dialog involved.

Could you check whether it's still slow without debug=assets, and compare with the module uninstalled? If it's still slow only with the module, I'll look into it.

@carlos-lopez-tecnativa

Copy link
Copy Markdown
Contributor

I noticed the URL has debug=assets, which makes everything noticeably slower in Odoo, and the "Loading..." indicator also shows up when navigating menus with no dialog involved.

Could you check whether it's still slow without debug=assets, and compare with the module uninstalled? If it's still slow only with the module, I'll look into it.

OK, I tested it without debug mode in three different environments, in this order: Odoo runbot, locally, and OCA runboat.

On runbot, even with network latency, it works fine: I dragged and dropped the popup, and it rendered quickly.
Locally, it's the same: it renders quickly.
But on OCA runboat, rendering is slow even though I didn't install this module, so please ignore my comment. The slowness comes from something else (hardware, network latency, etc.).

2026-10-28.11-09-36.mp4

Anyway, please check my other comment:
#3763 (review)

@pedrobaeza

Copy link
Copy Markdown
Member

I think it has to do with being http. Switch the URL to https (accepting the warning), and please try again.

@carlos-lopez-tecnativa

Copy link
Copy Markdown
Contributor

I think it has to do with being http. Switch the URL to https (accepting the warning), and please try again.

You're right! With https, it works as expected.

@cristina-hidalgo-tecnativa
cristina-hidalgo-tecnativa force-pushed the 20.0-fix-web_dialog_size-single_expand_button branch from 3fd0747 to 4b4b466 Compare October 29, 2026 07:03
@cristina-hidalgo-tecnativa

Copy link
Copy Markdown
Author

I also see two buttons in other dialogs, for example, when you use Create and edit... in a many2one field:
Image

This makes me think that Odoo already supports this in the core Dialog, but only displays the button when onExpand is defined: https://github.com/odoo/odoo/blob/dd797414fa250a039c6bf494cfb281d67b4bf83c/addons/web/static/src/core/dialog/dialog.xml#L39

In "Create and edit..." the two buttons do different things: the core one (shown because FormViewDialog passes onExpand) opens the record in the full form view (see FormViewDialog.onExpand, and the core tests, where a middle click opens it in a new window). This module's one maximizes the dialog.

You're right that onExpand is a generic Dialog prop, though: e.g. html_editor's history dialog uses it to toggle fullscreen. So extending core's button would mean reusing it per dialog, and we couldn't do it for the ones where it already means something else: FormViewDialog (L116) uses it to open the full form view, while html_editor's history dialog (xml, js) uses it to toggle fullscreen.

@carlos-lopez-tecnativa carlos-lopez-tecnativa left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In short, we're going back to the original icons instead of using the Odoo icons, to avoid displaying the same icon twice.
In some dialogs, two different icons are displayed; this could be added to the ROADMAP. Anyway, it works in the full composer, which was the initial request, so let's move forward to avoid blocking this.

@cristina-hidalgo-tecnativa
cristina-hidalgo-tecnativa force-pushed the 20.0-fix-web_dialog_size-single_expand_button branch from 4b4b466 to 0fc24ac Compare October 29, 2026 10:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants