summaryrefslogtreecommitdiff
path: root/addons/product_matrix/static/src/xml
diff options
context:
space:
mode:
authorstephanchrst <stephanchrst@gmail.com>2022-05-10 21:51:50 +0700
committerstephanchrst <stephanchrst@gmail.com>2022-05-10 21:51:50 +0700
commit3751379f1e9a4c215fb6eb898b4ccc67659b9ace (patch)
treea44932296ef4a9b71d5f010906253d8c53727726 /addons/product_matrix/static/src/xml
parent0a15094050bfde69a06d6eff798e9a8ddf2b8c21 (diff)
initial commit 2
Diffstat (limited to 'addons/product_matrix/static/src/xml')
-rw-r--r--addons/product_matrix/static/src/xml/product_matrix.xml53
1 files changed, 53 insertions, 0 deletions
diff --git a/addons/product_matrix/static/src/xml/product_matrix.xml b/addons/product_matrix/static/src/xml/product_matrix.xml
new file mode 100644
index 00000000..09fc7ba0
--- /dev/null
+++ b/addons/product_matrix/static/src/xml/product_matrix.xml
@@ -0,0 +1,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>