ERPNext Foundation ERPNext Cloud Chat Blog Discuss Frappé* Donate

Data Integrity between Purchase Order & Material Request - Defect?


#1

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?


#2

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:


#3

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…)


#4

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


#5

Thank you nabinhait, noted here https://github.com/frappe/erpnext/issues/13771


#6

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