[FIX] purchase: send email on RFQ confirmation
When confirming a RfQ, even if a follower is subscribed to "RFQ
Confirmed", he will not receive any email.
To reproduce the error:
(Need a mail catcher)
1. Create a PO
2. Add a follower and edit his subscriptions:
- Check 'RFQ Confirmed'
3. Confirm the PO
Error: No mail has been sent. The user should have been subscribed to
"RFQ Approved" to receive an email.
OPW-2447234
closes odoo/odoo#71892
X-original-commit: b459fc86d895dcd0c4bab8bb8332241fe9a43a6f
Signed-off-by: Adrien Widart <adwid@users.noreply.github.com>
Signed-off-by: William Henrotin <Whenrow@users.noreply.github.com>
This commit is contained in:
@@ -252,7 +252,9 @@ class PurchaseOrder(models.Model):
|
||||
def _track_subtype(self, init_values):
|
||||
self.ensure_one()
|
||||
if 'state' in init_values and self.state == 'purchase':
|
||||
return self.env.ref('purchase.mt_rfq_approved')
|
||||
if init_values['state'] == 'to approve':
|
||||
return self.env.ref('purchase.mt_rfq_approved')
|
||||
return self.env.ref('purchase.mt_rfq_confirmed')
|
||||
elif 'state' in init_values and self.state == 'to approve':
|
||||
return self.env.ref('purchase.mt_rfq_confirmed')
|
||||
elif 'state' in init_values and self.state == 'done':
|
||||
|
||||
Reference in New Issue
Block a user