Show or hide field based on condition

In sales invoices, I would like the outstanding amount to appear only when it is different from grand total.

What statement should I put into the “Permissions / Depends on” box of the field?

eval:doc.outstanding_amount != doc.grand_total

does not seem to work. How does one debug?