<?xml version="1.0" encoding="utf-8"?>
<templates>
    <t
        t-name="sale.ListRenderer.RecordRow"
        t-inherit="account.SectionAndNoteListRenderer.RecordRow"
        t-inherit-mode="primary"
    >
        <t t-set="isInvisible" position="attributes">
            <attribute
                name="t-value"
                separator=" or "
                add="isCombo(record) and !this.comboColumns.includes(column.name)"
            />
        </t>

        <xpath expr="//td[hasclass('o_list_record_remove')]" position="attributes">
            <attribute name="t-if" separator=" and " add="!isCombo(record)"/>
        </xpath>

        <xpath expr="//td[hasclass('o_list_section_options')]" position="before">
            <td t-elif="isCombo(record)" class="o_list_section_options w-print-0 p-print-0 text-center">
                <Dropdown position="'bottom-end'" t-if="!props.readonly">
                    <button class="btn d-table-cell border-0 py-0 px-1 cursor-pointer">
                        <i class="fa fa-ellipsis-v"/>
                    </button>
                    <t t-set-slot="content">
                        <DropdownItem
                            t-if="this.getPreviousRecords(record)"
                            onSelected="() => this.moveCombo(record, 'up')"
                        >
                            <i class="me-1 fa fa-fw fa-arrow-up"/>
                            <span>Move Up</span>
                        </DropdownItem>
                        <DropdownItem
                            t-if="this.getNextRecords(record)"
                            onSelected="() => this.moveCombo(record, 'down')"
                        >
                            <i class="me-1 fa fa-fw fa-arrow-down"/>
                            <span>Move Down</span>
                        </DropdownItem>
                        <t t-if="hasDeleteButton">
                            <DropdownItem
                                onSelected="() => this.onDeleteRecord(record)"
                                class="'text-danger'"
                            >
                                <i class="me-1 fa fa-fw fa-trash"/>
                                <span>Delete</span>
                            </DropdownItem>
                        </t>
                    </t>
                </Dropdown>
            </td>
        </xpath>
    </t>
</templates>
