summaryrefslogtreecommitdiff
path: root/addons/payment_transfer
diff options
context:
space:
mode:
authorjvm-odoo <jvm@odoo.com>2019-10-24 07:00:21 +0000
committerfw-bot <otis@odoo.com>2019-10-24 11:19:47 +0000
commitd8c477572fa8e9feef7ae432b172b0e3cb454be8 (patch)
tree41413e9eb358c2c1027989b64e96dae8451c8eb8 /addons/payment_transfer
parent9e7e96c80491d44953bfe52b62767031ea2f7515 (diff)
[FIX] payment_transfer: fix wire transfer when amount total is 0
In e-commerce module, when you have a free product and 2 delivery methods: - Free - Any delivery method with a fixed price When you confirm your cart, you have to choose a payment method. If you select "free delivery" and "wire transfer": Before this commit: - You get an internal server error After this commit: - You are redirected to the wire transfer confirmation OPW-2083778 closes odoo/odoo#39328 X-original-commit: c87398ac1e6c49555a1e34ebf4e0ec714baa9ff3 Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
Diffstat (limited to 'addons/payment_transfer')
-rw-r--r--addons/payment_transfer/models/payment.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/addons/payment_transfer/models/payment.py b/addons/payment_transfer/models/payment.py
index 96a6167d919..4f51f2cf117 100644
--- a/addons/payment_transfer/models/payment.py
+++ b/addons/payment_transfer/models/payment.py
@@ -88,7 +88,7 @@ class TransferPaymentTransaction(models.Model):
def _transfer_form_get_invalid_parameters(self, data):
invalid_parameters = []
- if float_compare(float(data.get('amount', '0.0')), self.amount, 2) != 0:
+ if float_compare(float(data.get('amount') or '0.0'), self.amount, 2) != 0:
invalid_parameters.append(('amount', data.get('amount'), '%.2f' % self.amount))
if data.get('currency') != self.currency_id.name:
invalid_parameters.append(('currency', data.get('currency'), self.currency_id.name))