From 47d3d18d3e1078406347be352fcd0eb2b59a1a05 Mon Sep 17 00:00:00 2001 From: Sergi Almacellas Abellana Date: Mon, 5 Jul 2021 11:39:39 +0200 Subject: [PATCH] Use empty set when no roots for company issue10541 review350031002 (grafted from aa6e68375f59a52ed5fe3547e91347303d2cc0a0) --HG-- branch : 6.0 --- line.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/line.py b/line.py index 8027ffaa8f..80c712e393 100644 --- a/line.py +++ b/line.py @@ -276,7 +276,7 @@ class MoveLine(ModelSQL, ModelView): for analytic_line in line.analytic_lines: amount = analytic_line.debit - analytic_line.credit amounts[analytic_line.account.root] += amount - roots = company2roots[line.move.company] + roots = company2roots.get(line.move.company, set()) if not roots <= set(amounts.keys()): line.analytic_state = 'draft' continue