Skip to content

[FIX] mail: fix runbot error 231582 (no web_save when manually saving) - #227484

Closed
KevGerard wants to merge 1 commit into
odoo:18.0from
odoo-dev:18.0-fix-runbot-error-231582-kege
Closed

[FIX] mail: fix runbot error 231582 (no web_save when manually saving)#227484
KevGerard wants to merge 1 commit into
odoo:18.0from
odoo-dev:18.0-fix-runbot-error-231582-kege

Conversation

@KevGerard

@KevGerard KevGerard commented Sep 16, 2025

Copy link
Copy Markdown

This commit tries to solve runbot issues with mail html fields widget.

It seems clicking on the save button manually is not generating a call
to the backend. This could be due to the fact the button is not enabled
due to the data being invalid. Therefore using the clickSave util could
be useful in those situation since waiting that the button becomes
enabled.

This solution is not 100% sure to fix the issue in all cases but
manually disabling the button is creating the issue we can observe in
those runbots. There is a good chance it might work.

fixes-runbot-231582
fixes-runbot-233049


I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr

@robodoo

robodoo commented Sep 16, 2025

Copy link
Copy Markdown
Contributor

Pull request status dashboard

@KevGerard
KevGerard marked this pull request as ready for review September 16, 2025 14:48
@C3POdoo
C3POdoo requested review from a team September 16, 2025 14:51

@seb-odoo seb-odoo 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 surprised there are many occurrences of click on o_form_button_save in tests and none of them have this pattern.

Are other tests failing too, and were never fixed?

And if not, what makes this test different?

@seb-odoo

Copy link
Copy Markdown
Contributor

Also it might be easier for all of those PR to have the actual test name in the commit title (or something that helps in this regard), because having many runbot-{id} in my inbox doesn't really help seeing what each PR is about.

@KevGerard

Copy link
Copy Markdown
Author

I'm surprised there are many occurrences of click on o_form_button_save in tests and none of them have this pattern.

Are other tests failing too, and were never fixed?

And if not, what makes this test different?

I will investigate a bit more, though my feeling is that the html editor is taking more time than other tests to notify of a change and therefore the save button could be not available right away.

@KevGerard

Copy link
Copy Markdown
Author

I'm surprised there are many occurrences of click on o_form_button_save in tests and none of them have this pattern.
Are other tests failing too, and were never fixed?
And if not, what makes this test different?

I will investigate a bit more, though my feeling is that the html editor is taking more time than other tests to notify of a change and therefore the save button could be not available right away.

So indeed, after investigation the HtmlField is using an the internal bus to send notification that the icon has been chosen in this test, and is resetting the dirty flag of the form that shows the save button while choosing the icon.

It is definitely possible that hoot is returning before this bus notification and is therefore pushing on the save button being not ready.

This commit solves this issue because the dirty flag is a dependency to make the save button visible.

@seb-odoo

Copy link
Copy Markdown
Contributor

Ok I found another one: https://runbot.odoo.com/odoo/error/161256

I think then all usages of o_form_button_save in tests should be covered by visibility check (and in all versions).

@@ -147,6 +147,6 @@ test("HtmlMail add icon and save inline html", async function () {
await contains("a.nav-link:contains('Icons')").click();
await contains("span.fa-glass").click();

await contains(".o_form_button_save").click();
await contains(".o_form_button_save:not(.invisible)").click();

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 think :visible is possible, there are some occurrences in code.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Might actually be better to use clickSave() from @web/../tests/web_test_helpers and stepUtils.saveForm() from @web_tour/tour_service/tour_utils for tours, that way we don't have to modify our tests every change.

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 wasn't aware of these helpers, if it's their preferred way then yes I suppose this is what should be used. The :enabled state is properly linked to the :visible state?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Actually no, but we can add a modifier in the clickSave({ modifier: "visible" }) which might be useful and more readable anyway. For the tours, we'll have to do it manually though.

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.

Do we really need a param? It looks like it should be the default, always checked?

@seb-odoo

seb-odoo commented Sep 16, 2025

Copy link
Copy Markdown
Contributor

https://runbot.odoo.com/odoo/error/230493 looks related?

https://runbot.odoo.com/odoo/error/232486 why would it click when not visible instead???

@seb-odoo

seb-odoo commented Sep 16, 2025

Copy link
Copy Markdown
Contributor

And potentially 105 other race conditions where this selector is potentially the problem:

image

This has many old ones, but at least 20 are from this year.

@seb-odoo

seb-odoo commented Sep 16, 2025

Copy link
Copy Markdown
Contributor

According to the template, click on o_form_button_cancel should be similarly covered.
And also checking code making use of o_form_status_indicator_buttons for good measure.

@KevGerard

KevGerard commented Sep 17, 2025

Copy link
Copy Markdown
Author

https://runbot.odoo.com/odoo/error/232486 why would it click when not visible instead???

I guess to click on an invisible button to save something that was already saved 2 steps before...

@KevGerard

Copy link
Copy Markdown
Author

https://runbot.odoo.com/odoo/error/230493 looks related?

It does not look related to this problem. Looks like a UI issue, the tab should be there in all cases (saved form or not).

@seb-odoo

Copy link
Copy Markdown
Contributor

Right, I just saw it only happens in single ln10 country ch, so probably just a bad override in that module.
We can still add :visible in there to be safe, but then we don't mark the issue as closed by this PR.

@KevGerard KevGerard changed the title [FIX] mail: fix runbot error 231582 [FIX] mail: fix runbot error 231582 (no web_save when manually saving) Sep 23, 2025
@KevGerard

KevGerard commented Sep 23, 2025

Copy link
Copy Markdown
Author

So after some more investigation, I was wrong and this is actually not the problem. The contains function is actually already checking the button is visible, so this visible tag is actually useless.

On top of that, the issue here is that the web_save http call is not received when clicking manually on the save button.

I am looking further to try and find the real reason this issue could happen. It might just be that the added icon is not yet added to the record and therefore no changes is yet found, hence no save.

@seb-odoo

Copy link
Copy Markdown
Contributor

Thank you for the follow up, let us know when you find a solution.

This commit tries to solve runbot issues with mail html fields widget.

It seems clicking on the save button manually is not generating a call
to the backend. This could be due to the fact the button is not enabled
due to the data being invalid. Therefore using the clickSave util could
be useful in those situation since waiting that the button becomes
enabled.

This solution is not 100% sure to fix the issue in all cases but
manually disabling the button is creating the issue we can observe in
those runbots. There is a good chance it might work.

fixes-runbot-231582
fixes-runbot-233049
@KevGerard
KevGerard force-pushed the 18.0-fix-runbot-error-231582-kege branch from f4796d2 to 6b41e1b Compare October 3, 2025 14:21
@KevGerard

KevGerard commented Oct 3, 2025

Copy link
Copy Markdown
Author

@seb-odoo As said in the description, the new update should be solving the 2 runbot issues even though not 100% sure. In any case it is better/safer than the previous solution.

@seb-odoo seb-odoo 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.

robodoo pushed a commit that referenced this pull request Oct 7, 2025
This commit tries to solve runbot issues with mail html fields widget.

It seems clicking on the save button manually is not generating a call
to the backend. This could be due to the fact the button is not enabled
due to the data being invalid. Therefore using the clickSave util could
be useful in those situation since waiting that the button becomes
enabled.

This solution is not 100% sure to fix the issue in all cases but
manually disabling the button is creating the issue we can observe in
those runbots. There is a good chance it might work.

fixes-runbot-231582
fixes-runbot-233049

closes #227484

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
@robodoo robodoo closed this Oct 7, 2025
@fw-bot
fw-bot deleted the 18.0-fix-runbot-error-231582-kege branch October 14, 2025 13:21
gamarino pushed a commit to numaes/numa-public-odoo that referenced this pull request Oct 31, 2025
This commit tries to solve runbot issues with mail html fields widget.

It seems clicking on the save button manually is not generating a call
to the backend. This could be due to the fact the button is not enabled
due to the data being invalid. Therefore using the clickSave util could
be useful in those situation since waiting that the button becomes
enabled.

This solution is not 100% sure to fix the issue in all cases but
manually disabling the button is creating the issue we can observe in
those runbots. There is a good chance it might work.

fixes-runbot-231582
fixes-runbot-233049

closes odoo/odoo#227484

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
sbejaoui pushed a commit to acsone/odoo that referenced this pull request Feb 16, 2026
This commit tries to solve runbot issues with mail html fields widget.

It seems clicking on the save button manually is not generating a call
to the backend. This could be due to the fact the button is not enabled
due to the data being invalid. Therefore using the clickSave util could
be useful in those situation since waiting that the button becomes
enabled.

This solution is not 100% sure to fix the issue in all cases but
manually disabling the button is creating the issue we can observe in
those runbots. There is a good chance it might work.

fixes-runbot-231582
fixes-runbot-233049

closes odoo#227484

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
sergio-teruel pushed a commit to Tecnativa/odoo that referenced this pull request Jul 8, 2026
This commit tries to solve runbot issues with mail html fields widget.

It seems clicking on the save button manually is not generating a call
to the backend. This could be due to the fact the button is not enabled
due to the data being invalid. Therefore using the clickSave util could
be useful in those situation since waiting that the button becomes
enabled.

This solution is not 100% sure to fix the issue in all cases but
manually disabling the button is creating the issue we can observe in
those runbots. There is a good chance it might work.

fixes-runbot-231582
fixes-runbot-233049

closes odoo#227484

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants