Skip to content

OBPIH-7444 fail creating adjustment when transaction already exists a…#5440

Merged
kchelstowski merged 1 commit intorelease/0.9.5from
bug/OBPIH-7444-existing-transaction-error-no-baseline
Aug 11, 2025
Merged

OBPIH-7444 fail creating adjustment when transaction already exists a…#5440
kchelstowski merged 1 commit intorelease/0.9.5from
bug/OBPIH-7444-existing-transaction-error-no-baseline

Conversation

@ewaterman
Copy link
Member

…t time

✨ Description of Change

Link to GitHub issue or Jira ticket: https://pihemr.atlassian.net/browse/OBPIH-7444

Description: If we do a cycle count or record stock or inventory import and set quantity to zero for a product, then next CC or RS or II on that product won't have a baseline (because we don't create baselines if quantity == 0, this is something we're going to change in 0.9.6). Because of that, we can successfully create multiple adjustment transactions at the exact same time. To fix this, we need to also check that there are no transactions at the time of the adjustments.


📷 Screenshots & Recordings (optional)

Video showing the bug: https://jam.dev/c/6005951b-9362-454e-8e7b-bc64e31a24a6

Video shows that after this fix, if we do a record stock to set quantity to zero, then an inventory import at the same time should fail, even if it's on different items of the product.

Screencast.from.2025-08-08.11.33.34.AM.webm

@ewaterman ewaterman self-assigned this Aug 8, 2025
@github-actions github-actions bot added type: bug Addresses unintended behaviours of the app domain: backend Changes or discussions relating to the backend server domain: l10n Changes or discussions relating to localization & Internationalization labels Aug 8, 2025
inventoryItem {
inList("product", products)
}
}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I realized that we should have been checking products, not inventory items. If we only check inventory items, we don't capture the case where we have a transaction at the same time for the same product but with different items.

Seems obvious in hindsight...

@kchelstowski kchelstowski merged commit 9ae8385 into release/0.9.5 Aug 11, 2025
5 checks passed
@kchelstowski kchelstowski deleted the bug/OBPIH-7444-existing-transaction-error-no-baseline branch August 11, 2025 17:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

domain: backend Changes or discussions relating to the backend server domain: l10n Changes or discussions relating to localization & Internationalization type: bug Addresses unintended behaviours of the app

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants