From 6b7bb096e1894b0d8d03eb61ea426dd8730a176d Mon Sep 17 00:00:00 2001 From: Jorge Pinna Puissant Date: Fri, 22 Feb 2019 09:49:16 +0000 Subject: [PATCH] [FIX] sale: transfer's transaction status in SO Have a SO; accepted and signed; and the client choose to pay with wire transfer. Before this commit, the transfer's transaction is never updated to 'done'. Even after the invoice is created and the payment is encoded and reconciled. The client will continue to see the pending message. Now, when the SO is confirmed, the transfer's transaction is set to 'done'. The client will see the done message. opw-1935516 closes odoo/odoo#31352 --- addons/sale/models/sale.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/addons/sale/models/sale.py b/addons/sale/models/sale.py index fe9ecb90196..4cfd31894f4 100644 --- a/addons/sale/models/sale.py +++ b/addons/sale/models/sale.py @@ -656,6 +656,10 @@ class SaleOrder(models.Model): @api.multi def action_done(self): + tx = self.sudo().transaction_ids.get_last_transaction() + if tx and tx.state == 'pending' and tx.acquirer_id.provider == 'transfer': + tx._set_transaction_done() + tx.write({'is_processed': True}) return self.write({'state': 'done'}) @api.multi