Data Integrity between Purchase Order & Material Request - Defect?

Imagine this scenario:

  1. User creates a Material Request of type Purchase.
  2. Purchase User then creates a Purchase Order from the Material Request. Now, the system tags each item in the PO with the Material Request number.
  3. Before Saving the Purchase Order, the Purchase User changes the item code and selects a different item that was not present in the Material Request. But, the tagged MR no stil remains.
  4. User saves and submits the PO.
  5. If we check the Material Request, the item is updated as ‘100% Ordered’, but the item ordered in PO is totally different.

How could this be allowed? Shouldn’t there be a check that prevents this from happening? Either the Purchase Order shouldn’t have been submitted - or at least the % Completion status shouldnt have been updated in the Material Request.

Is my observation right?

Your questions on validation of PO versus MR to maintain Item list consistency should be directed to an expert user or system developer for them to respond -

So where a PO Item list must be changed, what is the rule or prescribed best practice besides say to cancel that PO and create a replacement?

PO has a get_items_from_open_material_requests js method that calls this code:

My question is to the core ERPNext team (dev team). This is a serious defect, and the scenario I have explained should not be allowed to happen. It is a serious violation of data integrity.

Is there a way I can bring this to the attention of the ERPNext team? (I know I cannot tag/address individuals here…so wondering how to notify them…)

@kirthi System should validate with Material Request if item code is changed. Can you please create a github issue for this?

Thank you nabinhait, noted here When user changes an item code listed in a PO, system must revalidate the list changes with Material Request · Issue #13771 · frappe/erpnext · GitHub

@kirthi maybe upvote this issue as Basawaraj_Savalagi suggests [Tutorial] How to upvote Github issues for non developers