[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
This commit is contained in:
Jorge Pinna Puissant
2019-02-22 10:41:31 +00:00
parent cc0e654876
commit 6b7bb096e1
+4
View File
@@ -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