-
How would you like to receive your receipt & invoice?
+
Payment Successful
diff --git a/addons/point_of_sale/static/src/app/store/models.js b/addons/point_of_sale/static/src/app/store/models.js
index 9d9c3b536fc..9f9f199040c 100644
--- a/addons/point_of_sale/static/src/app/store/models.js
+++ b/addons/point_of_sale/static/src/app/store/models.js
@@ -2775,6 +2775,11 @@ export class Order extends PosModel {
this.lastOrderPrepaChange = this.lastOrderPrepaChange || {};
}
+
+ getEmailItems() {
+ return [_t("the receipt")].concat(this.is_to_invoice() ? [_t("the invoice")] : []);
+ }
+
save_to_db() {
if (!this.temporary && !this.locked && !this.finalized) {
this.assert_editable();
diff --git a/addons/pos_loyalty/static/src/js/Loyalty.js b/addons/pos_loyalty/static/src/js/Loyalty.js
index f531aac26b1..fe74615341b 100644
--- a/addons/pos_loyalty/static/src/js/Loyalty.js
+++ b/addons/pos_loyalty/static/src/js/Loyalty.js
@@ -347,6 +347,14 @@ patch(Order.prototype, "pos_loyalty.Order", {
// order is properly assigned. @see _checkMissingCoupons
this.invalidCoupons = true;
},
+
+ /** @override */
+ getEmailItems() {
+ return this._super(...arguments).concat(
+ this.has_pdf_gift_card ? [_t("the gift cards")] : []
+ );
+ },
+
export_as_JSON() {
const json = this._super(...arguments);
json.disabledRewards = [...this.disabledRewards];
diff --git a/addons/pos_loyalty/static/src/js/PaymentScreen.js b/addons/pos_loyalty/static/src/js/PaymentScreen.js
index d141303a227..45104cf0f42 100644
--- a/addons/pos_loyalty/static/src/js/PaymentScreen.js
+++ b/addons/pos_loyalty/static/src/js/PaymentScreen.js
@@ -159,6 +159,7 @@ patch(PaymentScreen.prototype, "pos_loyalty.PaymentScreen", {
for (const [actionId, active_ids] of Object.entries(payload.coupon_report)) {
await this.report.download(actionId, active_ids);
}
+ order.has_pdf_gift_card = Object.keys(payload.coupon_report).length > 0;
}
order.new_coupon_info = payload.new_coupon_info;
}