From 7339f694837dd23774ca437b0ff8e980ca58cef1 Mon Sep 17 00:00:00 2001 From: david Date: Tue, 22 Mar 2022 14:50:26 +0100 Subject: [PATCH] [FIX] rma_sale: subscribe portal users to RMA notifications TT35269 --- rma_sale/__manifest__.py | 2 +- rma_sale/controllers/sale_portal.py | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/rma_sale/__manifest__.py b/rma_sale/__manifest__.py index e486ad43..b3e5c4f8 100644 --- a/rma_sale/__manifest__.py +++ b/rma_sale/__manifest__.py @@ -3,7 +3,7 @@ { "name": "Return Merchandise Authorization Management - Link with Sales", "summary": "Sale Order - Return Merchandise Authorization (RMA)", - "version": "14.0.1.2.0", + "version": "14.0.2.0.0", "development_status": "Production/Stable", "category": "RMA", "website": "https://github.com/OCA/rma", diff --git a/rma_sale/controllers/sale_portal.py b/rma_sale/controllers/sale_portal.py index eb5ab385..967e12e4 100644 --- a/rma_sale/controllers/sale_portal.py +++ b/rma_sale/controllers/sale_portal.py @@ -67,9 +67,13 @@ class CustomerPortal(CustomerPortal): rma = wizard.sudo().create_rma(from_portal=True) for rec in rma: rec.origin += _(" (Portal)") - # Add the user as follower of the created RMAs so they can - # later view them. + # Add the user as follower of the created RMAs so they can later view them. rma.message_subscribe([request.env.user.partner_id.id]) + # Subscribe the user to the notification subtype so he receives the confirmation + # note. + rma.message_follower_ids.filtered( + lambda x: x.partner_id == request.env.user.partner_id + ).subtype_ids += request.env.ref("rma.mt_rma_notification") if len(rma) == 0: route = order_sudo.get_portal_url() else: