No, that would make absolutely no sense, plastering same purchase order number all over the place
As in my simplified example: two items have po_no XXXXX and one YYYYY
On that note: it would be nice, if column with po_no would show only if delivery note is linked to >1 customer’s purchase order, but I suppose I can create two distinct formats if that’s complicated.
You can solve it but this will require a small change in the Python code which may lead to update conflicts in the future. Hence I would not recommend it.
Can we include items from multiple sales orders into a single delivery note ?
This can be done for items from multiple sales orders.
For the Customer PO field in Delivery Note Item, mention this in OptionsFetch From of that field, assuming against_sales_order is the Sales Order Link in that Item row : against_sales_order.po_no You can keep this field read only.
Now create a new Delivery Note and Get Items from multiple Sales Orders for that customer.
Now check if the Customer POs have been mapped to the Delivery Note Items or not.
Why I think this should work
Every item when fetched from a Sales Invoice/Order will contain a backlink to it. Now it the Customer purchase order number is mentioned in the correct field of Order/Invoice and you too have referenced the correct variable as above then it will get mapped automatically.
Making Deliveries from both Sales Invoice and Sales orders
In case you make Delivery Notes from Sales Invoice too, then you can create a similar field but with different Fetch From value i.e. against_sales_invoice.po_no In this way, it becomes flexible for you.
Note
For multiple sales orders you can make a single delivery, but if you are make it from a a Sales Invoice then you cannot do it for multiple invoices unless you do it manually for each item - a practice which will be restricted depending on the number of items. I am not sure about how okay is this practice as far as accounting standards go.
We are making one delivery from multiple sales orders and then usually make one invoice per delivery or one invoice for multiple deliveries if all of them were made on the same date.
I’ll try your suggestion and give you feedback as to the end result. Thank you!
One note however: I had to enter “against_sales_order.po_no” into “Fetch from” field, instead of “Options” as you suggested. Other than that, it works great. Thanks for the tip!