Can I use a Custom script to achieve the following:
Delivery Note Item has a custom field called
New Delivery Note, when I click
From Sales Order, my delivery note gets populated from the chosen
I want my Custom Script to copy the
po_number to the
tabDelivey Note Item.
po_number custom field.
I achieved this in the past by patching the python source code, but this approach has numerous downsides.
For the benefit of others; I ended up patching the
update_item method in
Full method after patch;
def update_item(source, target, source_parent):
target.base_amount = (flt(source.qty) - flt(source.delivered_qty)) * flt(source.base_rate)
target.amount = (flt(source.qty) - flt(source.delivered_qty)) * flt(source.rate)
target.qty = flt(source.qty) - flt(source.delivered_qty)
target.po_number = source_parent.po_number