[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
This commit is contained in:
RomainLibert
2019-10-16 14:17:27 +00:00
committed by fw-bot
parent f561202d3e
commit 1debab4101
+2
View File
@@ -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