Link purchase order

hello erpnext community i need little help to how to link purchase order in purchase receipt after submitting purchase receipt

You can create a purchase order and make the purchase receipt directly from the purchase order.

1 Like

If you want to manually link purchase order after submitting purchase receipt, you can enable “allow_on_submit” flag for the purchase order field in purchase receipt item doctype. Then you can update the po field even after purchase receipt is submitted.

1 Like

Not allowed to enable Allow on Submit for standard fields

i know this but in my case user make a purchase receipt and another user in other department make PO and third user review purchase receipt and link it with PO

ok you may create a custom field in that case and link the documents.

The process in ERPNext is to create PO first then subsequent documents.

I know the sequence first the po and after that purchase receipt and this already we do but we need the user who create the purchase receipt don’t see the po he just receive item in warehouse only and after he receive the item another user make review on the receipt and link it with po

i have try to make custom filed ( po number ) link and chose it but when i enter to the po still not completed as a received i hope u get what i mean

Try workflow option to achieve this multilevel approval.

firstly i want to thank u for contribution to help me :slightly_smiling_face:

I think workflow will stack the same issue how to link the po after submit the purchase receipt

The po status is calculated on purchase receipt or purchase invoice submission.

You can write a hook to update the po status after you link purchase receipt with po.

Another option may be to link the PR with PO by the reviewer, with a custom button, “Link PO”, reviewer will keyin PO No* and Save and Submit.

*update PO No field in Purchase Receipt Item table either using hook or using custom script
This only works if all items in PR are for one PO, if different PO, the PO No input need to be enhanced.
May be have a table with item and PO No pair. So user can link each item with respective PO. PO in first row applies to all rows in case just single PO, so as to avoid keyin all rows with same no.

This should update PO status after PR submission.

I will try this

thanks a lot for helping :blush:

1 Like

Second option is easier, please update if it works.

Also do consider sending it as a PR, some other users have similar process.

i will update if it work ok

Are you talking about a reference in purchase receipt for purchase order.

I just went saw the structure of Purchase Receipt. I could not find Purchase Order Field There. What I am assuming and what I can understand from your message is that you want a Link Field in Purchase Receipt Pointing to PO. Let me know if I am on the same page as yours.

If so, then here is the proposed solution :

  1. Create a Custom Field, Purchase Order in Purchase Receipt.
  2. In the code where the purchase receipt is created in PO, also add the PO reference to the argument.
  3. You should have the PO pointed in Pur. Rec.

Let me know your thoughts on this.

Regards,

Parth Joshi

its in Purchase Receipt Item doctype

Ok. I did not see the Receipt Item…

Then in that case what should be the problem of not get it linked. @M.Ashraf ?

Regards,

Parth

i make custom filed linked with po

after link po with pr and submit pr nothing appear in po

after submit pr still po to receive and bill

the problem that the po still not received but in fact i received it in the warehouse