Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[16.0] Missing key in search panel filter component OWL #2653

Open
DuyDangHTEN opened this issue Nov 2, 2023 · 4 comments · May be fixed by #2680
Open

[16.0] Missing key in search panel filter component OWL #2653

DuyDangHTEN opened this issue Nov 2, 2023 · 4 comments · May be fixed by #2680
Labels

Comments

@DuyDangHTEN
Copy link

Module

web_responese

Describe the bug

Missing key in search panel filter component OWL in file:
web_responsive/static/src/components/search_panel/search_panel.xml
<span t-foreach="filters" t-as="filter" class="mx-1">

This cause view with search panel filter raise error missing 't-key'.
UncaughtPromiseError > OwlError Uncaught Promise > "Directive t-foreach should always be used with a t-key!" (expression: t-foreach="filters" t-as="filter")

To Reproduce

Affected versions: 16.0

  1. Create a view tree with js_class using legacy views.
  2. Open the view.

Expected behavior
Should have 't-key'
<span t-foreach="filters" t-as="filter" t-key="filter.type" class="mx-1">

@DuyDangHTEN DuyDangHTEN added the bug label Nov 2, 2023
@idenayer
Copy link

Hello @pedrobaeza , can I work on this please?

@pedrobaeza
Copy link
Member

Of course! You don't need to ask for permission for contributing 😃

@idenayer
Copy link

idenayer commented Nov 13, 2023

Hi @DuyDangHTEN , do you have a specific legacy view tree in mind for me to reproduce the issue?

@DuyDangHTEN
Copy link
Author

@idenayer

view.js

/** @odoo-module **/

import ListView from 'web.ListView';
import legacyViewRegistry from 'web.view_registry';

legacyViewRegistry.add('list_test', ListView);

view.xml (Sale for example)

<odoo>
    <record id="view_sales_order_filter_extend" model="ir.ui.view">
            <field name="name">sale.order.view.filter.extend</field>
            <field name="model">sale.order</field>
            <field name="inherit_id" ref="sale.view_sales_order_filter"/>
            <field name="arch" type="xml">
                 <search>
                    <searchpanel>
                        <field name="state"/>
                    </searchpanel>
                </search>
            </field>
    </record>

    <record id="view_sale_order_extend" model="ir.ui.view">
        <field name="name">sale.order.tree.extend</field>
        <field name="model">sale.order</field>
        <field name="inherit_id" ref="sale.view_quotation_tree_with_onboarding"/>
        <field name="arch" type="xml">

            <xpath expr="//tree" position="attributes">
                <attribute name="js_class">list_test</attribute>
            </xpath>

        </field>
    </record>
</odoo>

idenayer added a commit to idenayer/OCA_web that referenced this issue Nov 22, 2023
idenayer added a commit to idenayer/OCA_web that referenced this issue Nov 22, 2023
Fixes OCA#2653

Owl requires the presence of a t-key directive in [t-foreach](https://github.com/odoo/owl/blob/master/doc/reference/templates.md#loops) to be able to properly reconcile renderings.

The owl template in `web_responsive/static/src/components/search_panel/search_panel.xml` missed the t-key directive. Hence the crash.

This commit introduces this `t-key` and ensures that it is unique.
idenayer added a commit to idenayer/OCA_web that referenced this issue Nov 22, 2023
Fixes OCA#2653

Owl requires the presence of a t-key directive in [t-foreach](https://github.com/odoo/owl/blob/master/doc/reference/templates.md#loops) to be able to properly reconcile renderings.

The owl template in `web_responsive/static/src/components/search_panel/search_panel.xml` missed the t-key directive. Hence the crash.

This commit introduces this `t-key` and ensures that it is unique.
idenayer added a commit to idenayer/OCA_web that referenced this issue Nov 22, 2023
Fixes OCA#2653

Owl requires the presence of a t-key directive in [t-foreach](https://github.com/odoo/owl/blob/master/doc/reference/templates.md#loops) to be able to properly reconcile renderings.

The owl template in `web_responsive/static/src/components/search_panel/search_panel.xml` missed the t-key directive. Hence the crash.

This commit introduces this `t-key` and ensures that it is unique.
idenayer added a commit to idenayer/OCA_web that referenced this issue Nov 22, 2023
Fixes OCA#2653

Owl requires the presence of a t-key directive in [t-foreach](https://github.com/odoo/owl/blob/master/doc/reference/templates.md#loops) to be able to properly reconcile renderings.

The owl template in `web_responsive/static/src/components/search_panel/search_panel.xml` missed the t-key directive. Hence the crash.

This commit introduces this `t-key` and ensures that it is unique.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants