summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorToufik Benjaa <tbe@odoo.com>2018-09-10 10:41:37 +0200
committerToufik Benjaa <tbe@odoo.com>2018-09-10 10:41:37 +0200
commit29cd2c33eb0aa22af88b27127ea20d0baa9dabdf (patch)
treeb469f8a0b3c208485c0a0ee668b82244b3b3e43d
parent5e4d4c305fd26c708e2c6bbe12d7fe9641cc09a2 (diff)
[FIX] payment: allow to set done a payment.transaction in pending state
- If a payment.transaction is in pending state, it was impossible to set it to done.
-rw-r--r--addons/payment/models/payment_acquirer.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/addons/payment/models/payment_acquirer.py b/addons/payment/models/payment_acquirer.py
index 14d4bc55f77..d8f86621dd8 100644
--- a/addons/payment/models/payment_acquirer.py
+++ b/addons/payment/models/payment_acquirer.py
@@ -722,7 +722,7 @@ class PaymentTransaction(models.Model):
@api.multi
def _set_transaction_done(self):
'''Move the transaction's payment to the done state(e.g. Paypal).'''
- if any(trans.state not in ('draft', 'authorized') for trans in self):
+ if any(trans.state not in ('draft', 'authorized', 'pending') for trans in self):
raise ValidationError(_('Only draft/authorized transaction can be posted.'))
self.write({'state': 'done', 'date': datetime.now().strftime(DEFAULT_SERVER_DATETIME_FORMAT)})