line: datum in zukunft --> zeile grau

This commit is contained in:
Frederik Jaeckel 2022-10-10 13:50:35 +02:00
parent 94d51b4ee2
commit 557a8b47ba

View file

@ -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