server-ux
server-ux copied to clipboard
[18.0] reviews module – duplicate t-key error when multiple reviewers have same sequence
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.
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:
- Create a record that requires tier validation.
- Add two or more reviewers with the same sequence number.
- Open that record in form view.
- Activate debug/developer mode.
- 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.