From 1debab4101bea7dca12732ba114faf807a35102c Mon Sep 17 00:00:00 2001 From: RomainLibert Date: Fri, 11 Oct 2019 07:38:19 +0000 Subject: [PATCH] [FIX] account: avoid crashing when no active_ids We should avoid crashing in case active_ids is not in the context X-original-commit: b528cf82d5144073cee112fb5cc5626243c51e96 --- addons/account/models/account_payment.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/addons/account/models/account_payment.py b/addons/account/models/account_payment.py index 2b5d528637b..f721e45cef8 100644 --- a/addons/account/models/account_payment.py +++ b/addons/account/models/account_payment.py @@ -733,6 +733,8 @@ class payment_register(models.TransientModel): def default_get(self, fields): rec = super(payment_register, self).default_get(fields) active_ids = self._context.get('active_ids') + if not active_ids: + return rec invoices = self.env['account.move'].browse(active_ids) # Check all invoices are open