From 9b8966154582e9932037804b94b4b8ac03dcc915 Mon Sep 17 00:00:00 2001 From: Alexis de Lattre Date: Mon, 22 Mar 2021 12:10:34 +0100 Subject: [PATCH] Fix crash in sale_down_payment --- sale_down_payment/models/account_payment.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sale_down_payment/models/account_payment.py b/sale_down_payment/models/account_payment.py index a10af15a..c7893899 100644 --- a/sale_down_payment/models/account_payment.py +++ b/sale_down_payment/models/account_payment.py @@ -49,7 +49,7 @@ def default_get(self, fields_list): def _compute_payment_amount(self, invoices=None, currency=None): amount = super(AccountAbstractPayment, self)._compute_payment_amount( invoices=invoices, currency=currency) - if self.sale_id: + if hasattr(self, 'sale_id') and self.sale_id: payment_currency = currency if not payment_currency: payment_currency = self.sale_id.currency_id