summaryrefslogtreecommitdiff
path: root/addons/product_matrix/static/src/xml/product_matrix.xml
blob: 09fc7ba06c72b74d1e3b8d4950b15ec53a2d7801 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
<template>
    <div t-name="product_matrix.matrix">
        <table class="o_matrix_input_table o_product_variant_matrix table table-sm table-striped table-bordered">
            <thead>
                <tr>
                    <t t-foreach="header" t-as="column_header">
                        <th t-attf-class="o_matrix_title_header {{column_header_first?'text-left':'text-center'}}">
                            <span t-esc="column_header.name"/>
                            <t t-call="product_matrix.extra_price">
                                <t t-set="price" t-value="column_header.price"/>
                            </t>
                        </th>
                    </t>
                </tr>
            </thead>
            <tbody>
                <tr t-foreach="rows" t-as="row">
                    <t t-foreach="row" t-as="cell">
                        <td t-if="cell.name" class="text-left">
                            <strong t-esc="cell.name"/>
                            <t t-call="product_matrix.extra_price">
                                <t t-set="price" t-value="cell.price"/>
                            </t>
                        </td>
                        <td t-else="">
                            <div t-if="cell.is_possible_combination" class="input-group">
                                <input type="number"
                                  class="o_matrix_input"
                                  t-att-ptav_ids="cell.ptav_ids"
                                  t-att-value="cell.qty"/>
                            </div>
                            <span t-else="" class="o_matrix_cell o_matrix_text_muted o_matrix_nocontent_container"> Not available </span>
                        </td>
                    </t>
                </tr>
            </tbody>
        </table>
    </div>
    <span t-name="product_matrix.extra_price" t-if="price" class="badge badge-pill badge-secondary">
            <!--
                price_extra is displayed as catalog price instead of
                price after pricelist because it is impossible to
                compute. Indeed, the pricelist rule might depend on the
                selected variant, so the price_extra will be different
                depending on the selected combination. The price of an
                attribute is therefore variable and it's not very
                accurate to display it.
                -->
            <span class="variant_price_extra" style="white-space: nowrap;">
                <t t-raw="price"/>
            </span>
        </span>
</template>