From a55537324752d490889dcf3b6158a0ea16c3ee41 Mon Sep 17 00:00:00 2001 From: Patrick Hoste Date: Thu, 23 Jan 2020 09:31:42 +0000 Subject: [PATCH] [FIX] event: fixed the invoice payment state test in the barcode interface PURPOSE There has been a few changes in the accounting module since the version 12.4. The field 'invoice_ids' in the 'sale.order' model is now related to the 'account.move' model instead of the 'account.invoice' model. The field that contain the payment state is now called 'invoice_payment_state'. This field changed name again in master into 'payment_state'. SPECIFICATION Change the call from 'invoice.state' into 'invoice.payment_state'. LINKS Task ID : 2180184 PR : #43822 Signed-off-by: Thibault Delavallee (tde) --- addons/event_sale/models/event_registration.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/event_sale/models/event_registration.py b/addons/event_sale/models/event_registration.py index c67d4d77788..bc9c2ae4917 100644 --- a/addons/event_sale/models/event_registration.py +++ b/addons/event_sale/models/event_registration.py @@ -76,7 +76,7 @@ class EventRegistration(models.Model): order_line = self.sale_order_line_id.sudo() if not order or float_is_zero(order_line.price_total, precision_digits=order.currency_id.rounding): payment_status = _('Free') - elif not order.invoice_ids or any(invoice.state != 'paid' for invoice in order.invoice_ids): + elif not order.invoice_ids or any(invoice.payment_state != 'paid' for invoice in order.invoice_ids): payment_status = _('To pay') res['alert'] = _('The registration must be paid') else: