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:
- The
depends_onproperty ofreturn_againstiseval:doc.return_against || doc.is_debit_note. I thought it would make sense to change it toeval:doc.return_against || doc.is_debit_note || doc.is_return, but this approach doesn’t work (tested via Property Setter). - Using JavaScript in a custom
sales_invoice.jsdoesn’t help either. For this particular field, when executingfrm.set_df_property("return_against", 'hidden', false), it does not remove thehide-controlclass 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.