I need some guidance with mapping data between the Sales Order DocType and the Delivery Note Item doctype during the composing of a new Delivery Note using the 'From Sales Order' action.
My use case:
I have a custom field called po_number on the `Delivery Note Item` object. When building a Delivery Note from one or more Sales Orders, I want the `tabDelivery Note Item`.po_number to be populated with the value from the corresponding `tabSales Order`.po_no value.
For example. I have two Sales Orders, each with their own lines.
SO1 with po_no == abc
|--> SO1Line1
`--> SO1Line2
SO2 with po_no == 123
|--> SO2Line1
`--> SO2Line2
I create a new Delivery Note, and using the 'From Sales Order' action, I load both SO1 and SO2 onto this new delivery note.
The result I want is:
DeliveryNote1
|--> SO1Line1 po_number == abc
|--> SO1Line2 po_number == abc
|--> SO2Line1 po_number == 123
`--> SO2Line2 po_number == 123
What's the best approach for this? A Custom Script? Can someone please provide an example?
Thank you,
-Jev