From b260fa7e242a97b12aae6ef0787dce4347a22bc2 Mon Sep 17 00:00:00 2001 From: Frederik Jaeckel Date: Mon, 10 Oct 2022 13:50:35 +0200 Subject: [PATCH] line: datum in zukunft --> zeile grau --- line.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/line.py b/line.py index 6d04217..099bde5 100644 --- a/line.py +++ b/line.py @@ -5,7 +5,7 @@ from trytond.model import ModelView, ModelSQL, Workflow, fields, Check from trytond.pool import Pool -from trytond.pyson import Eval, If, Or, Bool +from trytond.pyson import Eval, If, Or, Bool, Date from trytond.transaction import Transaction from trytond.report import Report from trytond.exceptions import UserError @@ -220,7 +220,9 @@ class Line(SecondCurrencyMixin, Workflow, ModelSQL, ModelView): def view_attributes(cls): return super().view_attributes() + [ ('/tree', 'visual', - If(Eval('balance', 0) < 0, 'warning', '')), + If(Eval('balance', 0) < 0, 'warning', + If(Eval('date', Date()) > Date(), 'muted', '') + )), ] @classmethod