server-ux icon indicating copy to clipboard operation
server-ux copied to clipboard

[18.0] reviews module – duplicate t-key error when multiple reviewers have same sequence

Open jaydeep32 opened this issue 3 months ago • 1 comments

Module

base_tier_validation

Describe the bug

When a record has multiple reviewers assigned with the same sequence, opening the form view in debug mode raises an Owl client error due to duplicate keys in a t-foreach loop.

Image Image

Odoo Client Error UncaughtPromiseError > OwlError Uncaught Promise > Got duplicate key in t-foreach: 1

To Reproduce

Affected versions: 18.0

Steps to reproduce the behavior:

  1. Create a record that requires tier validation.
  2. Add two or more reviewers with the same sequence number.
  3. Open that record in form view.
  4. Activate debug/developer mode.
  5. The error appears immediately.

Expected behavior The form view should display all reviewers correctly, regardless of whether they share the same sequence.

Additional context For testing purposes, I updated the line in base_tier_validation.Collapse to have t-key='review.id' instead of the existing value, and with this change the error no longer occurs. Based on this, I believe the issue is caused by the use of a non-unique key (such as sequence) in the t-foreach loop.

If this assumption is correct, then adjusting the template to use a unique identifier (e.g., review.id or a combination of fields) should resolve the error permanently.

However, if this is not the right approach and the problem lies elsewhere, I would appreciate guidance on the actual root cause and the recommended solution.

jaydeep32 avatar Sep 03 '25 19:09 jaydeep32