From 859a7f6225a463a04110f7c39db3d6e15c9852cd Mon Sep 17 00:00:00 2001 From: Frederik Jaeckel Date: Sat, 8 Oct 2022 16:20:59 +0200 Subject: [PATCH] =?UTF-8?q?line:=20negativer=20saldo=20f=C3=A4rbt=20zeile?= =?UTF-8?q?=20blass-rot?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- line.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/line.py b/line.py index bfece53..6d04217 100644 --- a/line.py +++ b/line.py @@ -216,6 +216,13 @@ class Line(SecondCurrencyMixin, Workflow, ModelSQL, ModelView): }, }) + @classmethod + def view_attributes(cls): + return super().view_attributes() + [ + ('/tree', 'visual', + If(Eval('balance', 0) < 0, 'warning', '')), + ] + @classmethod def migrate_amount_2nd_currency(cls): """ add amount-2nd-currency