From 9cff1e0b620ce5f2578afdc51ef7ce7216426ddd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Thu, 5 Oct 2023 23:18:51 +0200 Subject: [PATCH] Do not compute account party for general ledger line without party Closes #12570 --- modules/account/account.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/modules/account/account.py b/modules/account/account.py index 3f964ae542..f0f6cdf20b 100644 --- a/modules/account/account.py +++ b/modules/account/account.py @@ -2487,6 +2487,8 @@ class GeneralLedgerLine(DescriptionOriginMixin, ModelSQL, ModelView): account_ids, party_ids = set(), set() for r in records: account_parties[r.id] = None + if not r.party: + continue account_party2ids[r.account.id, r.party.id].append(r.id) account_ids.add(r.account.id) party_ids.add(r.party.id)