[FIX] website_sale_delivery: Compute summary total amount on delivery update

Issue

	- Connect on smartphone (or use chrome debug mode to switch to mobile view)
	- Install "Ecommerce" module
	- Add a delivery method D with a price on product P
	  and publish it
	- Go to shop and add product P to your cart
	- Go to payment and switch delivery method

	Total amount above the summary is not updated.

Cause

	Update is done on JS when delivery method is changed.
	No targeting Total Amount in summary head card (seen only on small device).

Solution

	Add ID on Total Amount in summary head card element and update it with JS
	in same time as other fields (taxes, total, ...).

opw-2424355

closes odoo/odoo#64808

X-original-commit: 7ab63d323680a6a69e77dcc59819928aa7872582
Signed-off-by: bon-odoo <nboulif@users.noreply.github.com>
This commit is contained in:
Nasreddin (bon)
2021-01-20 14:25:11 +00:00
parent e34dbd9d9c
commit e34d710a64
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -1580,7 +1580,7 @@
<div class="card">
<div class="card-body p-xl-0">
<div class="toggle_summary d-xl-none">
<b>Your order: </b> <span t-field="website_sale_order.amount_total" t-options='{"widget": "monetary", "display_currency": website_sale_order.pricelist_id.currency_id}'/>
<b>Your order: </b> <span id="amount_total_summary" class="monetary_field" t-field="website_sale_order.amount_total" t-options='{"widget": "monetary", "display_currency": website_sale_order.pricelist_id.currency_id}'/>
<span class='fa fa-chevron-down fa-border float-right' role="img" aria-label="Details" title="Details"></span>
</div>
<div t-if="not website_sale_order or not website_sale_order.website_order_line" class="alert alert-info">
@@ -70,7 +70,7 @@ publicWidget.registry.websiteSaleDelivery = publicWidget.Widget.extend({
var $amountDelivery = $('#order_delivery .monetary_field');
var $amountUntaxed = $('#order_total_untaxed .monetary_field');
var $amountTax = $('#order_total_taxes .monetary_field');
var $amountTotal = $('#order_total .monetary_field');
var $amountTotal = $('#order_total .monetary_field, #amount_total_summary.monetary_field');
if (result.status === true) {
$amountDelivery.html(result.new_amount_delivery);