Skip to content

Commit

Permalink
Merge PR #514 into 13.0
Browse files Browse the repository at this point in the history
Signed-off-by pedrobaeza
  • Loading branch information
OCA-git-bot committed Mar 12, 2021
2 parents c7e3753 + 768b0a8 commit b539b60
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
Expand Up @@ -39,15 +39,15 @@ odoo.define("website_sale_stock_available_display.tour", function(require) {
{
trigger: "span:contains('Process Checkout')",
extra_trigger:
".availability_messages:has(span:contains('10.0 Units in stock'))",
".availability_messages:has(span:contains('10.000 Units in stock'))",
},
{
trigger: ".btn-primary:contains('Confirm Order')",
},
{
trigger: "a[href='/shop']",
extra_trigger:
".availability_messages:has(span:contains('10.0 Units in stock'))",
".availability_messages:has(span:contains('10.000 Units in stock'))",
},
];
tour.register(
Expand Down
Expand Up @@ -9,7 +9,10 @@
t-attf-class="availability_message_#{product_template} text-#{virtual_available gt 0.0 and 'success' or 'danger'} mt16"
>
<span>
<t t-if="virtual_available gt 0.0" t-esc="virtual_available" />
<t
t-if="virtual_available gt 0.0"
t-esc="virtual_available_formatted"
/>
<t t-else="1" t-esc="0.0" />
<t t-esc="uom_name" /> in stock</span>
</div>
Expand Down
6 changes: 5 additions & 1 deletion website_sale_stock_available_display/templates/templates.xml
Expand Up @@ -12,14 +12,18 @@
t-set="virtual_available"
t-value="line.product_id.with_context(website_sale_stock_available=True).virtual_available"
/>
<t
t-set="virtual_available_formatted"
t-value="env['ir.qweb.field.float'].value_to_html(virtual_available, {'decimal_precision': 'Product Unit of Measure'})"
/>
<div
t-attf-class="availability_messages text-#{virtual_available &gt; 0.0 and 'success' or 'danger'}"
>
<t
t-set="virtual_available"
t-value="virtual_available if virtual_available > 0.0 else 0.0"
/>
<span><t t-esc="virtual_available" /> <t
<span><t t-esc="virtual_available_formatted" /> <t
t-esc="line.product_uom.name"
/> in stock</span>
</div>
Expand Down

0 comments on commit b539b60

Please sign in to comment.