Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0027733Openbravo ERP04. Warehouse managementpublic2014-10-02 07:572014-10-02 07:58
alostale 
dmiguelez 
normalminorsometimes
newopen 
5
 
 
Core
No
0027733: M_InOut post allows modifications while the document is being processed
Looking at the code in M_InOut_Post it:

1. executes a number of validations
2. locks header and lines (select for update) to process them

In case while execution of step 2, another session tries to do modifications on the document (header or lines) that is being processed, as it is locked, will wait till process finishes, and they will fail at this moment because it is not allowed to change a processed document.

But if concurrent document modification occurs while step 1 is in execution, as there is no lock yet, it will be allowed. This can end up in uncontrolled situations, ie. it is possible one of the checks that were already satisfied to be broken by the new modifications which won't be checked again so the document will be finally processed in this inconsistent state.
I couldn't reproduce it in a real use case.

1 Create a shipment/receipt with big number of lines
2 Process it
3 In another browser session open it and try to modify its lines while process is still in validations step
Move the select for updates to the beginning of the process so document is locked since the beginning warranting validations are done against the same data the actual process is done.

Review other document processes (C_order_Post, C_Invoice_Post...) to find the same pattern.
No tags attached.
related to defect 0027713 closed eduardo_Argal slow post of goods shipment if there are many storage detail for that product 
Issue History
2014-10-02 07:57alostaleNew Issue
2014-10-02 07:57alostaleAssigned To => dmiguelez
2014-10-02 07:57alostaleModules => Core
2014-10-02 07:57alostaleTriggers an Emergency Pack => No
2014-10-02 07:58alostaleRelationship addedrelated to 0027713

There are no notes attached to this issue.