InvenTree
InvenTree copied to clipboard
Fix build item over-allocation checks
This pull request fixes an issue with BuildItem over-allocation checks which prevent allocation changes to over-allocated items. Looking a bit closer at related code it appears SalesOrderAllocation already handled this correctly, and I've aligned these changes with that implementation.
Not sure if this is a concern but I noticed the quantity checks between BuildItem and SalesOrderAllocation don't appear to be aligned with one casting to decimal.Decimal and the other not. Not sure if this is breaking anything, but it doesn't look quite right to me.
https://github.com/inventree/InvenTree/blob/f8c7635a8d42f8860dc39198d7962f5286bcd853/src/backend/InvenTree/build/models.py#L1609-L1617 https://github.com/inventree/InvenTree/blob/f8c7635a8d42f8860dc39198d7962f5286bcd853/src/backend/InvenTree/order/models.py#L2014-L2025