-
-
Notifications
You must be signed in to change notification settings - Fork 792
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
Purchase order approvals and "ready" state #6989
base: master
Are you sure you want to change the base?
Conversation
✅ Deploy Preview for inventree-web-pui-preview ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
@SchrodingersGat Have a look at the comments here. |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #6989 +/- ##
==========================================
- Coverage 83.63% 82.28% -1.35%
==========================================
Files 1118 1007 -111
Lines 49549 46936 -2613
Branches 1625 1040 -585
==========================================
- Hits 41441 38623 -2818
- Misses 7680 8163 +483
+ Partials 428 150 -278
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
@LavissaWoW thanks for submitting. @matmair I'd be interested in your thoughts on this, obviously you have put a lot of work into a very similar plugin. I'd like to see this integrated into the new interface before merging. This will require the "purchase order actions" (submit / cancel / approve / etc) to be added to the PurcahseOrderDetail page. |
@SchrodingersGat working on it 👌 |
I have a conflict of interest and will not comment or review anything relating to this. |
Some obvious Mantine v7 changes needed. I'm going to be mostly off the next 10 days or so, but I'll try to patch this up. |
Using the PO model property |
@SchrodingersGat Playwright tests seem to change status from run to run, and it's getting to become quite frustrating... |
Note: It's impossible with our current playwright config to run "global setting"-altering tests. The only option I see here is making them "fight" over setting state, halting test operation until the worker is allowed to reload the page with the correct settings enabled. There is a risk of deadlock with this, but I'm out of options. |
@SchrodingersGat I'm just gonna be blunt: The tests you want require me to write tests that do this:
Unless I'm missing some huge element of Playwright, I'm putting my hair pulling frustrations on hold until I get some feedback. |
@wolflu05 any thoughts on the tests that @LavissaWoW wants to run here? Maybe there's a way to reset states between test runs? @LavissaWoW the difference between the frontend tests and backend (django) tests is that the underlying database is reset to a known state before every test run. I'm not sure how we could accomplish a similar thing here |
So it's not even considered "between" runs. They run in parallell, and read from the same test DB, at the same time. |
Sorry, I have really not much experience with frontend testing. I do understand the problem, but the only thing I could think of is to spin up multiple inventree backend servers on different ports which are used for the different browsers. That way when each browser runs the tests sequentially, there is no race condition. And regarding the data reset after each test, maybe there is some possibility to reset the database to the migrated state after each test by using transactions or save points somehow that are send to the database. |
@LavissaWoW perhaps if there is sufficient API testing via python unit tests, you can simplify the tests for the frontend, and do a "read only" set of playwright tests? |
@SchrodingersGat That would exclude the setting-based states. Basically this:
It is something to consider doing. Some other tests start failing after I've run the PO tests too many times, as I keep making new POs for every test. So tests looking at the PO index and looking for "Molex Connectors" for example, will fail if enough new POs are created and that PO is rolled to page 2 of the table. |
@SchrodingersGat Aight, here we go. PUI tests are working. I've done a few things:
Note: Codecov seems to be referencing a whole lot of stuff not related to this PR |
With working tests, I'm considering this ready for a final review |
@LavissaWoW thanks, I'll hope to assign some time to review this in the next couple of days |
This PR seems stale. Please react to show this is still important. |
@SchrodingersGat Never heard back from you here. |
This PR seems stale. Please react to show this is still important. |
not stale |
Adds a simple implementation of approvals to Purchase Orders.
Also introduces a "ready" status and ability to limit order issuance to members of a group.
Closes #3501
The following has been added:
4 new settings:
Purchase Order default state transitions:
Todo-list: