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
–
You received this message because you are subscribed to the Google Groups "ERPNext User's Forum" group.
You can look into make_delivery_note() function in selling/doctype/sales_order/sales_order.py file.
That function maps doclist from sales order to delivery note. There is a sub-function called update_item(), you can easily add following line in that function to fulfil your requirements.
target.po_number = source_parent.po_number
On 22-Feb-2014, at 6:01 am, Jev Björsell <eb...@gmail.com> wrote:
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
–
You received this message because you are subscribed to the Google Groups “ERPNext User’s Forum” group.
Great. I put that mapping in place, restarted gunicorn, and everything is working well.
Thank you.
-Jev
On Sunday, February 23, 2014 8:10:52 PM UTC-8, Nabin Hait wrote:
You can look into make_delivery_note() function in selling/doctype/sales_order/sales_order.py file.
That function maps doclist from sales order to delivery note. There is a sub-function called update_item(), you can easily add following line in that function to fulfil your requirements.
target.po_number = source_parent.po_number
On 22-Feb-2014, at 6:01 am, Jev Björsell <eb...@gmail.com> wrote:
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
–
You received this message because you are subscribed to the Google Groups “ERPNext User’s Forum” group.