InvenTree icon indicating copy to clipboard operation
InvenTree copied to clipboard

Fix build item over-allocation checks

Open fuzeman opened this issue 1 year ago • 2 comments

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

fuzeman avatar Oct 03 '24 10:10 fuzeman

Deploy Preview for inventree-web-pui-preview canceled.

Name Link
Latest commit c3b63695b585f7a3dd98c2d1ca0c729c3b74b8ef
Latest deploy log https://app.netlify.com/sites/inventree-web-pui-preview/deploys/66fe7a650434c60008d93976

netlify[bot] avatar Oct 03 '24 10:10 netlify[bot]

Codecov Report

Attention: Patch coverage is 96.66667% with 1 line in your changes missing coverage. Please review.

Project coverage is 84.25%. Comparing base (f8c7635) to head (c3b6369). Report is 312 commits behind head on master.

Files with missing lines Patch % Lines
src/backend/InvenTree/stock/models.py 85.71% 1 Missing :warning:
Additional details and impacted files
@@           Coverage Diff           @@
##           master    #8235   +/-   ##
=======================================
  Coverage   84.24%   84.25%           
=======================================
  Files        1157     1157           
  Lines       52347    52373   +26     
  Branches     1892     1892           
=======================================
+ Hits        44100    44125   +25     
- Misses       7789     7790    +1     
  Partials      458      458           
Flag Coverage Δ
backend 86.01% <96.66%> (+<0.01%) :arrow_up:

Flags with carried forward coverage won't be shown. Click here to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov[bot] avatar Oct 03 '24 11:10 codecov[bot]

@fuzeman thanks for the fix, looks like a pretty subtle one to work out!

SchrodingersGat avatar Oct 06 '24 10:10 SchrodingersGat

💚 All backports created successfully

Status Branch Result
0.16.x

Questions ?

Please refer to the Backport tool documentation and see the Github Action logs for details

github-actions[bot] avatar Oct 06 '24 10:10 github-actions[bot]