Skip to content

Conversation

@ypapouin
Copy link
Contributor

@ypapouin ypapouin commented Oct 13, 2025

Big headache for a basic thing.

Demo pictures have been added:
image

My first idea was to use a combination of a wildcard expression expr=".../*" (aka: select all children) with position="replace".
But Odoo is not working like this, node locate only returns the first value (return nodes[0] if nodes else None)

    <record id="hr_equipment_view_kanban" model="ir.ui.view">
        <field name="model">maintenance.equipment</field>
        <field name="inherit_id" ref="maintenance.hr_equipment_view_kanban" />
        <field name="arch" type="xml">
            <xpath expr="//t[@t-name='card']/*" position="replace" >
                <t t-name="card" class="flex-row">
                    <aside class="o_kanban_aside_full">
                        <field
                            name="image_128"
                            options="{
                                'placeholder': '/base/static/img/company_image.png',
                                'size': [150, 150],
                                'img_class': 'object-fit-cover'
                            }"
                            widget="image"
                        />
                    </aside>
                    <main class="ps-2 ms-1">$0</main>
                </t>
            </xpath>
        </field>
    </record>

Since there is no way to use an XPath expression to replace/move all children at once. I had to do it manually for each child.

pedrocs-exo and others added 18 commits October 13, 2025 10:27
Currently translated at 100.0% (10 of 10 strings)

Translation: maintenance-14.0/maintenance-14.0-maintenance_equipment_image
Translate-URL: https://translation.odoo-community.org/projects/maintenance-14-0/maintenance-14-0-maintenance_equipment_image/it/
Currently translated at 100.0% (7 of 7 strings)

Translation: maintenance-16.0/maintenance-16.0-maintenance_equipment_image
Translate-URL: https://translation.odoo-community.org/projects/maintenance-16-0/maintenance-16-0-maintenance_equipment_image/es/
Currently translated at 100.0% (10 of 10 strings)

Translation: maintenance-16.0/maintenance-16.0-maintenance_equipment_image
Translate-URL: https://translation.odoo-community.org/projects/maintenance-16-0/maintenance-16-0-maintenance_equipment_image/it/
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: maintenance-16.0/maintenance-16.0-maintenance_equipment_image
Translate-URL: https://translation.odoo-community.org/projects/maintenance-16-0/maintenance-16-0-maintenance_equipment_image/
Currently translated at 100.0% (7 of 7 strings)

Translation: maintenance-16.0/maintenance-16.0-maintenance_equipment_image
Translate-URL: https://translation.odoo-community.org/projects/maintenance-16-0/maintenance-16-0-maintenance_equipment_image/fr/
@ypapouin ypapouin force-pushed the 18.0-mig-maintenance_equipment_image branch from c1a157b to 17df205 Compare October 13, 2025 14:32
@ypapouin ypapouin mentioned this pull request Oct 21, 2025
16 tasks
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.

8 participants