Skip to content

Conversation

@fw-bot
Copy link
Contributor

@fw-bot fw-bot commented Oct 17, 2025

Steps to Reproduce:

  • Open a Repair Order form view in Odoo 17 or 18.
  • Navigate to the Parts tab.
  • In the list view of parts, click the Smart Button on any part line.
  • A pop-up form view opens showing detailed operations.
  • Click the “Pick From” field value, but don't change its value.
  • Click the Save button in the pop-up.
  • Observe the browser console for the error: TypeError: Cannot read properties of null (reading 'querySelector') at ListRenderer.focusCell

Traceback:

TypeError: Cannot read properties of null (reading 'querySelector')
    at ListRenderer.focusCell (https://91307582-17-0-all.runbot219.odoo.com/web/assets/15b4f47/web.assets_web.min.js:9519:80)
    at ListRenderer.<anonymous> (https://91307582-17-0-all.runbot219.odoo.com/web/assets/15b4f47/web.assets_web.min.js:9477:272)

Root Cause:

  • Asynchronous patching in OWL (onPatched with await Promise.resolve()) continues execution after the next tick, even if the component is destroyed.
  • When the component is destroyed, OWL sets status(this) = 3 (DESTROYED).
  • focusCell() accesses DOM using querySelector, which fails if the component is destroyed.
  • The code did not check the component status before calling focusCell().

Fix:

  • Added if (status(this) === destroyed) return; to stop focusCell() execution on destroyed components.
  • Ensured async patching is handled safely with await Promise.resolve().
  • Added onWillDestroy to clean up dialog callbacks, preventing memory leaks.

OPW - 5154694
PAD
Localhost issue reproduction steps

17:


18:

Description of the issue/feature this PR addresses:
Current behavior before PR:
Desired behavior after PR is merged:


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

Forward-Port-Of: #232097

@robodoo
Copy link
Contributor

robodoo commented Oct 17, 2025

Pull request status dashboard

@fw-bot
Copy link
Contributor Author

fw-bot commented Oct 17, 2025

@shku-odoo @aab-odoo cherrypicking of pull request #232097 failed.

stdout:

Auto-merging addons/web/static/src/views/list/list_renderer.js
CONFLICT (content): Merge conflict in addons/web/static/src/views/list/list_renderer.js

Either perform the forward-port manually (and push to this branch, proceeding as usual) or close this PR (maybe?).

In the former case, you may want to edit this PR message as well.

⚠️ after resolving this conflict, you will need to merge it via @robodoo.

More info at https://github.com/odoo/odoo/wiki/Mergebot#forward-port

@robodoo robodoo added forwardport This PR was created by @fw-bot conflict There was an error while creating this forward-port PR labels Oct 17, 2025
@fw-bot
Copy link
Contributor Author

fw-bot commented Oct 25, 2025

@shku-odoo @aab-odoo this forward port of #232097 is awaiting action (not merged or closed).

@aab-odoo
Copy link
Contributor

@shku-odoo don't forget this forwardport. There's a small conflict to resolve. Thanks

@fw-bot
Copy link
Contributor Author

fw-bot commented Nov 1, 2025

@shku-odoo @aab-odoo this forward port of #232097 is awaiting action (not merged or closed).

@shku-odoo shku-odoo force-pushed the 18.0-17.0-fix-repair-order-focuscell-destroyed-471248-fw branch from cfffaf1 to ab0cfb1 Compare November 3, 2025 07:12
@C3POdoo C3POdoo requested review from a team, BastienFafchamps and aab-odoo and removed request for a team November 3, 2025 07:14
Copy link
Contributor

@aab-odoo aab-odoo left a comment

Choose a reason for hiding this comment

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

robodoo r+

@robodoo
Copy link
Contributor

robodoo commented Nov 3, 2025

@shku-odoo @aab-odoo 'ci/runbot' failed on this reviewed PR.

@shku-odoo shku-odoo force-pushed the 18.0-17.0-fix-repair-order-focuscell-destroyed-471248-fw branch from ab0cfb1 to 0bc73ce Compare November 3, 2025 08:58
Steps to Reproduce:
- Open a Repair Order form view in Odoo 17 or 18.
- Navigate to the Parts tab.
- In the list view of parts, click the Smart Button on any part line.
- A pop-up form view opens showing detailed operations.
- Click the “Pick From” field value, but don't change its value.
- Click the Save button in the pop-up.
- Observe the browser console for the error:
    TypeError: Cannot read properties of null (reading 'querySelector')
    at ListRenderer.focusCell

Root Cause:
- Asynchronous patching in OWL (onPatched with await Promise.resolve())
continues execution after the next tick, even if the component is destroyed.
- When the component is destroyed, OWL sets status(this) = 3 (DESTROYED).
- focusCell() accesses DOM using querySelector, which fails if the component is
destroyed.
- The code did not check the component status before calling focusCell().

Fix:
- Added `if (status(this) === destroyed) return;` to stop focusCell()
execution on destroyed components.
- Ensured async patching is handled safely with await Promise.resolve().

17: https://github.com/odoo/odoo/blob/f9726cfe93e8850a38d9de06acfa5d78473b50b0/addons/web/static/src/views/list/list_renderer.js#L223
18: https://github.com/odoo/odoo/blob/1cac54db8634267a780b4011291f1e8a80ac5f5b/addons/web/static/src/views/list/list_renderer.js#L213

X-original-commit: c4ec69a
@shku-odoo shku-odoo force-pushed the 18.0-17.0-fix-repair-order-focuscell-destroyed-471248-fw branch from 0bc73ce to a1d7cc1 Compare November 4, 2025 07:11
Copy link
Contributor

@aab-odoo aab-odoo left a comment

Choose a reason for hiding this comment

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

robodoo r+

robodoo pushed a commit that referenced this pull request Nov 4, 2025
Steps to Reproduce:
- Open a Repair Order form view in Odoo 17 or 18.
- Navigate to the Parts tab.
- In the list view of parts, click the Smart Button on any part line.
- A pop-up form view opens showing detailed operations.
- Click the “Pick From” field value, but don't change its value.
- Click the Save button in the pop-up.
- Observe the browser console for the error:
    TypeError: Cannot read properties of null (reading 'querySelector')
    at ListRenderer.focusCell

Root Cause:
- Asynchronous patching in OWL (onPatched with await Promise.resolve())
continues execution after the next tick, even if the component is destroyed.
- When the component is destroyed, OWL sets status(this) = 3 (DESTROYED).
- focusCell() accesses DOM using querySelector, which fails if the component is
destroyed.
- The code did not check the component status before calling focusCell().

Fix:
- Added `if (status(this) === destroyed) return;` to stop focusCell()
execution on destroyed components.
- Ensured async patching is handled safely with await Promise.resolve().

17: https://github.com/odoo/odoo/blob/f9726cfe93e8850a38d9de06acfa5d78473b50b0/addons/web/static/src/views/list/list_renderer.js#L223
18: https://github.com/odoo/odoo/blob/1cac54db8634267a780b4011291f1e8a80ac5f5b/addons/web/static/src/views/list/list_renderer.js#L213

closes #232156

X-original-commit: c4ec69a
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
@robodoo robodoo closed this Nov 4, 2025
Wajih-Wanis pushed a commit to odoo-dev/odoo that referenced this pull request Nov 4, 2025
Steps to Reproduce:
- Open a Repair Order form view in Odoo 17 or 18.
- Navigate to the Parts tab.
- In the list view of parts, click the Smart Button on any part line.
- A pop-up form view opens showing detailed operations.
- Click the “Pick From” field value, but don't change its value.
- Click the Save button in the pop-up.
- Observe the browser console for the error:
    TypeError: Cannot read properties of null (reading 'querySelector')
    at ListRenderer.focusCell

Root Cause:
- Asynchronous patching in OWL (onPatched with await Promise.resolve())
continues execution after the next tick, even if the component is destroyed.
- When the component is destroyed, OWL sets status(this) = 3 (DESTROYED).
- focusCell() accesses DOM using querySelector, which fails if the component is
destroyed.
- The code did not check the component status before calling focusCell().

Fix:
- Added `if (status(this) === destroyed) return;` to stop focusCell()
execution on destroyed components.
- Ensured async patching is handled safely with await Promise.resolve().

17: https://github.com/odoo/odoo/blob/f9726cfe93e8850a38d9de06acfa5d78473b50b0/addons/web/static/src/views/list/list_renderer.js#L223
18: https://github.com/odoo/odoo/blob/1cac54db8634267a780b4011291f1e8a80ac5f5b/addons/web/static/src/views/list/list_renderer.js#L213

closes odoo#232156

X-original-commit: c4ec69a
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Wajih-Wanis pushed a commit to odoo-dev/odoo that referenced this pull request Nov 6, 2025
Steps to Reproduce:
- Open a Repair Order form view in Odoo 17 or 18.
- Navigate to the Parts tab.
- In the list view of parts, click the Smart Button on any part line.
- A pop-up form view opens showing detailed operations.
- Click the “Pick From” field value, but don't change its value.
- Click the Save button in the pop-up.
- Observe the browser console for the error:
    TypeError: Cannot read properties of null (reading 'querySelector')
    at ListRenderer.focusCell

Root Cause:
- Asynchronous patching in OWL (onPatched with await Promise.resolve())
continues execution after the next tick, even if the component is destroyed.
- When the component is destroyed, OWL sets status(this) = 3 (DESTROYED).
- focusCell() accesses DOM using querySelector, which fails if the component is
destroyed.
- The code did not check the component status before calling focusCell().

Fix:
- Added `if (status(this) === destroyed) return;` to stop focusCell()
execution on destroyed components.
- Ensured async patching is handled safely with await Promise.resolve().

17: https://github.com/odoo/odoo/blob/f9726cfe93e8850a38d9de06acfa5d78473b50b0/addons/web/static/src/views/list/list_renderer.js#L223
18: https://github.com/odoo/odoo/blob/1cac54db8634267a780b4011291f1e8a80ac5f5b/addons/web/static/src/views/list/list_renderer.js#L213

closes odoo#232156

X-original-commit: c4ec69a
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Wajih-Wanis pushed a commit to odoo-dev/odoo that referenced this pull request Nov 6, 2025
Steps to Reproduce:
- Open a Repair Order form view in Odoo 17 or 18.
- Navigate to the Parts tab.
- In the list view of parts, click the Smart Button on any part line.
- A pop-up form view opens showing detailed operations.
- Click the “Pick From” field value, but don't change its value.
- Click the Save button in the pop-up.
- Observe the browser console for the error:
    TypeError: Cannot read properties of null (reading 'querySelector')
    at ListRenderer.focusCell

Root Cause:
- Asynchronous patching in OWL (onPatched with await Promise.resolve())
continues execution after the next tick, even if the component is destroyed.
- When the component is destroyed, OWL sets status(this) = 3 (DESTROYED).
- focusCell() accesses DOM using querySelector, which fails if the component is
destroyed.
- The code did not check the component status before calling focusCell().

Fix:
- Added `if (status(this) === destroyed) return;` to stop focusCell()
execution on destroyed components.
- Ensured async patching is handled safely with await Promise.resolve().

17: https://github.com/odoo/odoo/blob/f9726cfe93e8850a38d9de06acfa5d78473b50b0/addons/web/static/src/views/list/list_renderer.js#L223
18: https://github.com/odoo/odoo/blob/1cac54db8634267a780b4011291f1e8a80ac5f5b/addons/web/static/src/views/list/list_renderer.js#L213

closes odoo#232156

X-original-commit: c4ec69a
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
@fw-bot fw-bot deleted the 18.0-17.0-fix-repair-order-focuscell-destroyed-471248-fw branch November 11, 2025 11:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

conflict There was an error while creating this forward-port PR forwardport This PR was created by @fw-bot

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants