-
Notifications
You must be signed in to change notification settings - Fork 147
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Critical bug: Article price changes when closing order #1056
Comments
I think this has been the case for a long time. (I couldn't manage to run the old release version right now but I bet it was in there too; maybe I'll manage to check tomorrow). As long as an order hasn't been closed, it's price is subject to changes in the article's master data form. When closing the order the article price becomes fixed to the article's latest However what this "latest |
I can confirm this was not the case two months ago. We have a supplier which articles I update monthly (roughly), but we have an order every week. |
I don't know exactly what your workflow was in your foodcoop prior to the upgrade to version 8, but I now could locally start up and reproduce the bug in v7: issue_1056_in_v7.mp4Maybe in your workflow you've never updated the price through the accounting menu if another order of the same supplier was in the 'open' state...? (Because this particular bug only occurs in that case.) |
More like a workaround for the flawed db structure though...
I've added a draft PR that would fix this specific error case. It's just an ugly workaround, but if nobody can think of where this might cause trouble, we could merge it. 🤔 (Would have to be tested thoroughly though.) As already discussed elsewhere, the current article (price) versioning is fundamentally flawed IMO. That's part of why we aim to change the underlying db structure in our ongoing article unit project - so we might consider waiting for that instead of risking follow-up bugs here. |
Could it be that #778 should have fixed that, but it was never merged into upstream? c30542d had been committed to the foodcoopsat fork, I found it in the oldmain branch. @mortbauer seems to have reverted this commit in the recent rebase. That would explain why it had been working for us in the last years and now it does not.
Just a note, this doesn't only affect orders which are open, but orders which will be created after the price change, as well. |
That is a very good find @twothreenine, you are completely right, I jumped over this one when I rebased since it was confusing and wasn't sure if this would still be needed. So I cherry-picked c30542d it for current foodcoopsat/main, if that fixes these issue it would be good to have it finally upstream as well. |
I assume you replaced updated_attributes with update as in lentschi@3ffdb42 ? |
I've noticed that, in the foodcoopsat version, |
There seems to be a bug regarding article_prices:
Globally update current price
, e.g. 1.00 -> 2.00 €Changing a price in the receive menu, however, does not lead to this bug.
We've noticed this in our foodcoopsat hosting and I could reproduce it in demo.foodcoops.net.
The text was updated successfully, but these errors were encountered: