summaryrefslogtreecommitdiff
path: root/addons/website_sale
diff options
context:
space:
mode:
authorAndrea Grazioso (agr-odoo) <agr@odoo.com>2021-01-27 16:09:03 +0000
committerAndrea Grazioso (agr-odoo) <agr@odoo.com>2021-01-28 16:40:44 +0000
commitb54f981908e6c7f67b97ea858c1d093dc09596f5 (patch)
treeb32b4ef7daf6b946dbe76f010ce94bc417190d8d /addons/website_sale
parent1a556da32c31f262ca5d115b8c0cf26bafe14f82 (diff)
[FIX] website_sale: send confirmation email when no amount
As user access the ecommerce and add to cart a free product (0$ total) Checkout and Confirm No email will be sent for confirmation This occur because the confirmation email is normally sent in the transaction callback, which is not created when the amount is 0 opw-2440335 closes odoo/odoo#65233 X-original-commit: ed3e69df1564eca3becdc57181608bc0211ca4c5 Signed-off-by: agr-odoo <agr-odoo@users.noreply.github.com> Signed-off-by: Jorge Pinna Puissant (jpp) <jpp@odoo.com>
Diffstat (limited to 'addons/website_sale')
-rw-r--r--addons/website_sale/models/sale_order.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/addons/website_sale/models/sale_order.py b/addons/website_sale/models/sale_order.py
index c71a6201f9f..6d15b310238 100644
--- a/addons/website_sale/models/sale_order.py
+++ b/addons/website_sale/models/sale_order.py
@@ -349,6 +349,13 @@ class SaleOrder(models.Model):
sent_orders |= order
sent_orders.write({'cart_recovery_email_sent': True})
+ def action_confirm(self):
+ res = super(SaleOrder, self).action_confirm()
+ for order in self:
+ if not order.transaction_ids and not order.amount_total and self._context.get('send_email'):
+ order._send_order_confirmation_mail()
+ return res
+
class SaleOrderLine(models.Model):
_inherit = "sale.order.line"