diff --git a/addons/sale/__manifest__.py b/addons/sale/__manifest__.py
index d16eb17bf8c..7de008c2fce 100644
--- a/addons/sale/__manifest__.py
+++ b/addons/sale/__manifest__.py
@@ -19,8 +19,8 @@ This module contains all the common features of Sales Management and eCommerce.
'report/invoice_report_templates.xml',
'report/report_all_channels_sales_views.xml',
'data/ir_sequence_data.xml',
- 'data/sale_data.xml',
'data/mail_data.xml',
+ 'data/sale_data.xml',
'wizard/sale_make_invoice_advance_views.xml',
'views/sale_views.xml',
'views/sales_team_views.xml',
diff --git a/addons/sale/controllers/portal.py b/addons/sale/controllers/portal.py
index 5995879a2dc..03566515d24 100644
--- a/addons/sale/controllers/portal.py
+++ b/addons/sale/controllers/portal.py
@@ -220,6 +220,7 @@ class CustomerPortal(CustomerPortal):
if not order_sudo.has_to_be_paid():
order_sudo.action_confirm()
+ order_sudo._send_order_confirmation_mail()
pdf = request.env.ref('sale.action_report_saleorder').sudo().render_qweb_pdf([order_sudo.id])[0]
diff --git a/addons/sale/data/mail_data.xml b/addons/sale/data/mail_data.xml
index 40cabf7a910..34dd1065c21 100644
--- a/addons/sale/data/mail_data.xml
+++ b/addons/sale/data/mail_data.xml
@@ -60,11 +60,14 @@
- Sign and pay online
- Accept and sign online
+ Sign & Pay Quotation
+ Accept & Sign Quotation
- Pay online
+ Accept & Pay Quotation
+
+
+ View Quotation
@@ -80,25 +83,170 @@
% set doc_name = 'quotation' if object.state in ('draft', 'sent') else 'order'
- % if object.partner_id.parent_id:
- Dear ${object.partner_id.name} (${object.partner_id.parent_id.name}),
+ Hello,
+
+ Your
+ % if ctx.get('proforma'):
+ Pro forma invoice for ${doc_name} ${object.name}
+ % if object.origin:
+ (with reference: ${object.origin} )
+ % endif
+ amounting in ${format_amount(object.amount_total, object.pricelist_id.currency_id)} is available.
% else:
- Dear ${object.partner_id.name},
+ ${doc_name} ${object.name}
+ % if object.origin:
+ (with reference: ${object.origin} )
+ % endif
+ amounting in ${format_amount(object.amount_total, object.pricelist_id.currency_id)} is ready for review.
% endif
-
- Here is
- % if ctx.get('proforma')
- in attachment your pro-forma invoice
- % else
- the ${doc_name} ${object.name}
- % endif
- % if object.origin:
- (with reference: ${object.origin} )
- % endif
- amounting in ${format_amount(object.amount_total, object.pricelist_id.currency_id)}
- from ${object.company_id.name}.
-
+
Do not hesitate to contact us if you have any question.
+
+
+
+
+
+ ${(object.name or '').replace('/','_')}
+ ${object.partner_id.lang}
+
+
+
+
+
+ Sales Order: Confirmation Email
+
+ ${object.company_id.name} ${(object.get_portal_last_transaction().state == 'pending') and 'Pending Order' or 'Order'} (Ref ${object.name or 'n/a' })
+ ${(object.user_id.email_formatted or user.email_formatted) | safe}
+ ${object.partner_id.id}
+
+
+
+ Hello,
+
+ % set transaction = object.get_portal_last_transaction()
+ Your order ${object.name} amounting in ${format_amount(object.amount_total, object.currency_id)}
+ % if object.state == 'sale' or (transaction and transaction.state in ('done', 'authorized')) :
+ has been confirmed.
+ Thank you for your trust!
+ % elif transaction and transaction.state == 'pending' :
+ is pending. It will be confirmed when the payment is received.
+ % if object.reference:
+ Your payment reference is ${object.reference}.
+ % endif
+ % endif
+
+ Do not hesitate to contact us if you have any question.
+
+ % if object.website_id:
+
+
+
Products
+
+
Quantity
+
Price
+
+ % for line in object.order_line:
+ % if not line.is_delivery:
+
+ % if line.display_type == 'line_section':
+
${line.name}
+ % elif line.display_type == 'line_note':
+
${line.name}
+ % else:
+
+
+
+
${line.product_id.name}
+
${line.product_uom_qty}
+ % if object.user_id.has_group('account.group_show_line_subtotals_tax_excluded'):
+
+ Bill to:
+ ${object.partner_invoice_id.street or ''}
+ ${object.partner_invoice_id.city or ''}
+ ${object.partner_invoice_id.state_id.name or ''}
+ ${object.partner_invoice_id.zip or ''}
+ ${object.partner_invoice_id.country_id.name or ''}
+
+ % endif
+ % if object.partner_shipping_id and not object.only_services:
+
+
+
+ Ship to:
+ ${object.partner_shipping_id.street or ''}
+ ${object.partner_shipping_id.city or ''}
+ ${object.partner_shipping_id.state_id.name or ''}
+ ${object.partner_shipping_id.zip or ''}
+ ${object.partner_shipping_id.country_id.name or ''}
+