Field return_against not visible when creating a Credit Note manually

When we create a Credit Note from a Sales Invoice using the “Create > Return / Credit Note” button, the return_against field is automatically shown and linked to the original Sales Invoice. This works correctly for returns or downward adjustments.

On the other hand, when creating a new sales invoice, the system allows upward adjustments by creating that sales invoice as a Debit Note. In these cases, when checking “Is Rate Adjustment Entry (Debit Note)”, the return_against field is automatically displayed.

However, if we try to create a Sales Invoice manually and check “Is Return (Credit Note)” instead of “Is Rate Adjustment Entry (Debit Note)”, the return_against field does not appear.

I have tried to solve this through different approaches:

  1. The depends_on property of return_against is eval:doc.return_against || doc.is_debit_note. I thought it would make sense to change it to eval:doc.return_against || doc.is_debit_note || doc.is_return, but this approach doesn’t work (tested via Property Setter).
  2. Using JavaScript in a custom sales_invoice.js doesn’t help either. For this particular field, when executing frm.set_df_property("return_against", 'hidden', false), it does not remove the hide-control class from the field wrapper.

Before reporting this as a bug, I wanted to check if I’m missing something or if there’s a recommended way to show return_against when manually creating a Credit Note.

2 Likes