summaryrefslogtreecommitdiff
path: root/addons/payment_transfer/models
diff options
context:
space:
mode:
authorThibault Delavallée <tde@odoo.com>2017-05-16 15:41:26 +0200
committerThibault Delavallée <tde@odoo.com>2017-05-16 15:41:26 +0200
commitcbca7e13132fe807ac918d9b3c2fcbbb3a12a103 (patch)
treee19860e75927023bc06ec98185746922a841fe4a /addons/payment_transfer/models
parent259c5d9145aee8a9d24e36792385f86cbaa0bb8c (diff)
parentdac90e79f7ea5b86e7082c921910babb46584a88 (diff)
[MERGE] payment, website_sale(_delivery): simplify payment configuration
This commit proposes to simplify payment acquirers configuration in backend and frontend. Includes mainly * configuration boxes for website admins at checkout process; * better and fixed display of transaction status at checkout; * hide unnecessary fields for transfer provider; This commit merges 'dev/master-payment-tde'.
Diffstat (limited to 'addons/payment_transfer/models')
-rw-r--r--addons/payment_transfer/models/payment.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/addons/payment_transfer/models/payment.py b/addons/payment_transfer/models/payment.py
index 996294bf287..00a34ac0ad4 100644
--- a/addons/payment_transfer/models/payment.py
+++ b/addons/payment_transfer/models/payment.py
@@ -46,6 +46,13 @@ class TransferPaymentAcquirer(models.Model):
values['post_msg'] = self._format_transfer_data()
return super(TransferPaymentAcquirer, self).create(values)
+ @api.multi
+ def write(self, values):
+ """ Hook in write to create a default post_msg. See create(). """
+ if all(not acquirer.post_msg and acquirer.provider != 'transfer' for acquirer in self) and values.get('provider') == 'transfer':
+ values['post_msg'] = self._format_transfer_data()
+ return super(TransferPaymentAcquirer, self).write(values)
+
class TransferPaymentTransaction(models.Model):
_inherit = 'payment.transaction'