1. make some receipt input to a location, make onhand qty is + (example +100)
account date example is 14/7
2. make internal inventory document, with account date > every date of receipt input
account date example is 15/7
3. complete internal inventory a error message display:
"Approval Amount=0 (#1) - Cannot correct Inventory (MA) - Negative inventory disallowed in this warehouse"
1. at MInventory line 641 save MInventoryLineMA in a separate transaction with date material policy is 14/7
but at before save, of MInventoryLineMA, date material policy is change to 15/7
2. at line 462, MInventoryLineMA received have date material policy is 15/7
3. => call MStorageOnHand.add at line 473 always return false. make error message display.
+ correct MInventoryLineMA.afterSave
+ isNew then don't change date material policy
+ change AttributeSetInstance_ID from 0 to have => remain logic?
+ change AttributeSetInstance_ID from have to 0 => what's logic?
Good catch , I committed a fix with your first suggestion (check !newRecord) - I don't know how to reproduce the other logic you're asking (when ASI changes from and to zero).
i add patch for class have same issue