How can I add the date of the delivery note on the sales invoice?

Hi, I want to show the posting date of the delivery note on the sales invoice item when I import the items of several delivery notes to a sales invoice.
I don’t know much about how I can develop this.

I have the next things:

I added a new row in the Sales Invoice Item Form called dn_date, the type Data and with all default options:

I tried add a custom script in the Sales Invoice DocType, but don’t work and I don’t know how do this.

frappe.ui.form.on("Sales Invoice Item", {
    "Delivery Note": function(frm) {
        frm.add_fetch("Delivery Note", "posting_date", "dn_date");

I tried a lot of possible solutions, but I didn’t got it to work

Someone can help me?

1 Like