can't complete a internal inventory when date account > date account all receipt

Description

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"

reason:
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.

solution:
+ 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?

Environment

None

Activity

Show:
Carlos Ruiz
July 22, 2014, 9:54 PM

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

Hiep Lq
July 23, 2014, 4:14 AM

i add patch for class have same issue

Hiep Lq
July 23, 2014, 3:13 PM

Thanks

Assignee

Unassigned

Reporter

Hiep Lq

Labels

Tested By

None

Components

Fix versions

Affects versions

Priority

Blocker
Configure