Skip to content
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

Add page for finding and merging duplicate lots #5361

Conversation

jmcameron
Copy link
Collaborator

@jmcameron jmcameron commented Feb 4, 2021

Create a page where operators can find and merge potential duplicate lots.

Note that this PR adds a new page under the Stock navigation menu: "Find Duplicate Lots". In order to use or test this, be sure to edit the user role permissions and enable the new page (under the Stock section).

Closes #5166

Testing

  • Use a production database such as IMCK
  • Start Bhima
  • In Adminstration > Role Management , enable user access to the "Find Duplicate Lots" page.
  • Go to Stock > Find Duplicate Lots
    • Note the number of duplicates found (see the grid footer)
    • Click on the Action menu of any row and click on "Find duplicate lots". (I'm not 100% happy about the wording here; I'm open to suggestions).
    • A modal will pop up. Note that form will show all lots that have matching lot labels AND inventory UUIDs. Only one lot is shown for all the lots that match it.
    • Select the lot to keep and the lot(s) to merge
    • Click on the [Merge] button
    • When you return to the main grid, notice the offending row is now gone (since there is only one of them)

Copy link
Collaborator

@jniles jniles left a comment

Choose a reason for hiding this comment

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

@jmcameron since you asked for a review of the functionality, I won't dive into the code yet.

Overall, looks really good for a first cut. Some suggestions:

  1. Instead of "Find Lots" in the action menu, let's just call it "Merge Lots". To me, this is intuitive: instead of finding the lots, we've found them, now we are opening the modal to merge them.
  2. Can you put a loading indicator on the loading button when merging lots? It seems like we should be waiting for that to be done on the server, then closing the modal, then reloading the page. It dismisses almost immediately, which surprised me. Most other modals that do something in the system (trial balance, credit note, etc) hang out until the action is performed with a loading indicator.

Here is what that looks like on a "good 2G network" that I emulated.
MOYdGh0e9j

Again, haven't taken a look at the code, but it surprised me how quick that was!

@jmcameron jmcameron force-pushed the find_duplicate_lots_page branch from 768de98 to 3bfae3e Compare February 5, 2021 17:39
@jmcameron jmcameron requested a review from jniles February 5, 2021 17:44
@jmcameron
Copy link
Collaborator Author

@jniles This is now ready for a real review.

QUESTION: Should we remove the "Find Duplicate Lots" in the Lots registry action menu?

@jmcameron jmcameron changed the title First cut at find duplicates page Add 'find duplicates page' for finding and merging duplicate lots Feb 5, 2021
@jmcameron jmcameron changed the title Add 'find duplicates page' for finding and merging duplicate lots Add page for finding and merging duplicate lots Feb 5, 2021
@jniles
Copy link
Collaborator

jniles commented Feb 6, 2021

QUESTION: Should we remove the "Find Duplicate Lots" in the Lots registry action menu?

No, I do not think so. Let's wait until a couple of releases, then we'll remove it. I think that folks are much more inclined to absent-mindedly look at that registry (which they are using all the time) than they will be for this new module.

Copy link
Collaborator

@jniles jniles left a comment

Choose a reason for hiding this comment

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

Functionally, this looks good to me. I've made a few clean up comments, but none of them are serious. Once addressed, this PR can be merged.

@jniles
Copy link
Collaborator

jniles commented Feb 8, 2021

bors delegate+

@bors
Copy link
Contributor

bors bot commented Feb 8, 2021

✌️ jmcameron can now approve this pull request. To approve and merge a pull request, simply reply with bors r+. More detailed instructions are available here.

@jmcameron jmcameron force-pushed the find_duplicate_lots_page branch from 372a222 to 5d99380 Compare February 8, 2021 16:14
@jmcameron jmcameron force-pushed the find_duplicate_lots_page branch from 5d99380 to f07f4c7 Compare February 8, 2021 16:18
@jmcameron
Copy link
Collaborator Author

bors r+

@bors
Copy link
Contributor

bors bot commented Feb 8, 2021

Build succeeded:

@bors bors bot merged commit f2d92ac into Third-Culture-Software:refactor-stock-management Feb 8, 2021
@jmcameron jmcameron deleted the find_duplicate_lots_page branch February 8, 2021 16:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants