Skip to content

OBPIH-7504 fixes to product inventory migration warnings#5502

Merged
awalkowiak merged 2 commits intorelease/0.9.5-hotfix2from
bug/OBPIH-7504-migration-warnings
Sep 19, 2025
Merged

OBPIH-7504 fixes to product inventory migration warnings#5502
awalkowiak merged 2 commits intorelease/0.9.5-hotfix2from
bug/OBPIH-7504-migration-warnings

Conversation

@ewaterman
Copy link
Member

✨ Description of Change

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

Description: See comments in the ticket. Two issues:

  1. There are issues with two product inventory transactions existing at the same time so I changed it to also warn in that case
  2. We weren't seeing warnings for two transactions at the same time on the same lot. I think this was just a bug

@ewaterman ewaterman self-assigned this Sep 17, 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 labels Sep 17, 2025
JOIN inventory_item ii1 ON te1.inventory_item_id = ii1.id
JOIN transaction t1 ON te1.transaction_id = t1.id
JOIN transaction_entry te2 ON te1.inventory_item_id != te2.inventory_item_id
JOIN transaction_entry te2 ON te1.transaction_id != te2.transaction_id
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 think this is just a bug? We want to warn when there are two different transactions at the same time, not two different items.

Copy link
Collaborator

@awalkowiak awalkowiak Sep 18, 2025

Choose a reason for hiding this comment

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

I think this is just a bug?

Yeah, I think it makes sense, because he previous version would skip two transactions made for the same inventory items

OR
(t1.transaction_type_id != :transactionTypeId and t2.transaction_type_id = :transactionTypeId)
)
AND (t1.transaction_type_id = :transactionTypeId OR t2.transaction_type_id = :transactionTypeId)
Copy link
Member Author

Choose a reason for hiding this comment

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

See this comment for context: https://pihemr.atlassian.net/browse/OBPIH-7504?focusedCommentId=167388.

From our investigation, we get issues when there are two product inventories at the same time that both cause adjustments since BOTH adjustments will be applied after we migrate.

I discussed with Manon and we thought the simplest solution was to just also warn about two product inventory transactions existing at the same time so that they can be fixed manually but let me know your thoughts @awalkowiak.

Copy link
Collaborator

@awalkowiak awalkowiak Sep 18, 2025

Choose a reason for hiding this comment

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

@ewaterman Overall sounds good, but after this change, I think, all "single product" product inventory transactions will be displayed there as well, which are handled automatically, and these will be a noise on the migration page. So we'd need to just display these that are made from import (multiple products) and have common products

@ewaterman ewaterman changed the title OBPIH-7504cfixes to product inventory migration warnings OBPIH-7504 fixes to product inventory migration warnings Sep 17, 2025
@awalkowiak awalkowiak merged commit 495ed19 into release/0.9.5-hotfix2 Sep 19, 2025
2 of 5 checks passed
@awalkowiak awalkowiak deleted the bug/OBPIH-7504-migration-warnings branch September 19, 2025 10:27
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 type: bug Addresses unintended behaviours of the app

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants