details:   https://code.tryton.org/tryton/commit/156f0d73fce3
branch:    7.0
user:      Cédric Krier <[email protected]>
date:      Thu Jul 02 16:38:57 2026 +0200
description:
        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)
diffstat:

 modules/account_invoice/invoice.py |  6 +-----
 1 files changed, 1 insertions(+), 5 deletions(-)

diffs (16 lines):

diff -r fb7b3c70fb3a -r 156f0d73fce3 modules/account_invoice/invoice.py
--- a/modules/account_invoice/invoice.py        Wed Jul 08 15:03:35 2026 +0200
+++ b/modules/account_invoice/invoice.py        Thu Jul 02 16:38:57 2026 +0200
@@ -1356,11 +1356,7 @@
         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', ''))),
             ]

Reply via email to