mirror of
https://github.com/OCA/rma.git
synced 2025-02-16 17:11:47 +02:00
[FIX] rma_sale: subscribe portal users to RMA notifications
TT35269
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user