Set danger visual on supplier invoice when amount to pay is greater than 0

The amount to pay is always positive so the test must be "greater than 0".

Closes #14925
(grafted from e4e920cb9e7d2a2f3bfa86fad4e8c3025cb78828)

--HG--
branch : 7.0
This commit is contained in:
Cédric Krier
2026-07-02 16:38:57 +02:00
parent 6e00b16eb5
commit 5a8343f039
+1 -5
View File
@@ -1356,11 +1356,7 @@ class Invoice(Workflow, ModelSQL, ModelView, TaxableMixin, InvoiceReportMixin):
return super().view_attributes() + [
('/form//field[@name="comment"]', 'spell', Eval('party_lang')),
('/tree', 'visual',
If((
(Eval('type') == 'out')
& (Eval('amount_to_pay_today', 0) > 0))
| ((Eval('type') == 'in')
& (Eval('amount_to_pay_today', 0) < 0)),
If(Eval('amount_to_pay_today', 0) > 0,
'danger',
If(Eval('state') == 'cancelled', 'muted', ''))),
]