diff --git a/asset.py b/asset.py index 8ce8bad..62d9ef0 100644 --- a/asset.py +++ b/asset.py @@ -108,14 +108,17 @@ class Asset(ModelSQL, ModelView): def __setup__(cls): super(Asset, cls).__setup__() cls._order.insert(0, ('name', 'ASC')) + cls._order.insert(0, ('date', 'DESC')) @classmethod def view_attributes(cls): return super().view_attributes() + [ ('/tree', 'visual', - If(Eval('change_day1', 0) < 0, 'warning', - If(Eval('change_day1', 0) > 0, 'success', '') - )), + If(Eval('date') < Date(delta_days=-5), 'muted', + If(Eval('change_day1', 0) < 0, 'warning', + If(Eval('change_day1', 0) > 0, 'success', '') + )) + ), ] @classmethod