我想在更改另一个值后更新一个值 例如,如果有可用的数量,除了在odoo篮之外,它还向我显示一个类似于图像的值
这是我的代码源
<template id="assets_frontend" inherit_id="website.assets_frontend" name="Shop">
<xpath expr="." position="inside">
<script type="text/javascript" src="/website_sale_available/static/src/js/website_sale_available.js"></script>
<link rel='stylesheet' href='/website_sale_available/static/src/css/website_sale_available.css'/>
</xpath>
</template>
<!-- priority 99 for compatibility with sale options, first load sale options view and then this one -->
<template id="cart" inherit_id="website_sale.cart_lines" priority="99">
<xpath expr="//table[@id='cart_products']//thead/tr" position="inside">
<th width="40">Disponibilité</th>
<th width="10"></th>
</xpath>
<xpath expr="//t[@t-as='line']/tr" position="inside">
<td width="50" style="color: #0000ff00; font-size: 10px;" class="text-right">
<t t-if="line.product_id.virtual_available > 0">
<div class="badge btn stock_label" style="background-color:green;opacity: 0.6;filter: alpha(opacity=60);">
<span>Disponible</span>
</div>
</t>
<t t-if="line.product_id.virtual_available <= 0" style="background-color:red;">
<div class="badge btn stock_label" style="background-color:red;opacity: 0.6;filter: alpha(opacity=60);">Epuisé</div>
</t>
</td>
<td width="10" style="color: #0000ff00; font-size: 0px;" name="virtual_available" >
<t t-esc="line.product_id.virtual_available"/>
</td>
</xpath>
</template>