[SOLVED]How to get sales order and delivery note name in sales invoice

Is there any easy way, to pull sales order link from sales invoice item and displayed it on sales invoice form.
Basically i would like to see sales order and delivery note number on my sales invoice form.

Another question regarding sales invoice item Refernces section.
If I make an invoice from SO or “get items from” sales order only “sales order” gets populated, If do the same from delivery note it populates both.

Hello @sp9leo,

  1. If you want to add sales order number in sales invoice, you need to add link for sales for order number in sales invoice.
    e.g. field name : sales order no
    type : link
    options : Sales order
    and there is a function named “make_sales_invoice” in sales invoice and there is another one function in it name “set_missing_values”.
    you can pass field or anything to sales invoice from this function.

  2. if you create S/I from S/O then only S/O id passed. but if you did same thing from D/N then S/O and D/N is also passed because S/O is exist in D/N.

Nishant Jariwala


I already did what you sugest @Nishant_Jariwala , but i though there is some easier/better way. As for the functions i need more programming skills, but already learned a lot customizing erpnext :wink:

For the second part i thought that was the case. Guess i’ll have to live with it :slight_smile:

Thanks for helping out.