[FIX] rma + rma_sale: Allow to create an RMA to a user with access_to…ken to sale order (no user created).

[FIX] rma + rma_sale: Show RMA's list (with share url) to a user with access_token to sale order (no user created).
This commit is contained in:
Víctor Martínez
2022-05-16 18:14:50 +02:00
committed by Nikolaus Weingartmair
parent 666809d451
commit d9e4fa120c

View File

@@ -623,6 +623,10 @@ class Rma(models.Model):
"context": ctx,
}
def _add_message_subscribe_partner(self):
if self.partner_id and self.partner_id not in self.message_partner_ids:
self.message_subscribe([self.partner_id.id])
def action_confirm(self):
"""Invoked when 'Confirm' button in rma form view is clicked."""
self.ensure_one()
@@ -633,8 +637,7 @@ class Rma(models.Model):
else:
reception_move = self._create_receptions_from_product()
self.write({"reception_move_id": reception_move.id, "state": "confirmed"})
if self.partner_id not in self.message_partner_ids:
self.message_subscribe([self.partner_id.id])
self._add_message_subscribe_partner()
self._send_confirmation_email()
def action_refund(self):