Skip to content
Snippets Groups Projects
Commit c87398ac authored by jvm-odoo's avatar jvm-odoo
Browse files

[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#39304

Signed-off-by: default avatarNicolas Martinelli (nim) <nim@odoo.com>
parent fbd701bf
No related branches found
No related tags found
No related merge requests found
......@@ -89,7 +89,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))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment