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
Multi-step form framework + Purchase order upload file view #1561
Conversation
…and also need to save form data
I'm very much on board with improving the multi form upload process. Looks like a very reasonable approach here. I'll have to dedicate some time to a closer inspection of what you've implemented here but on the surface it looks great! |
@SchrodingersGat No problem, I'm pretty excited about it too! It did take me some more effort than I thought originally but I think it was worth it 😃 |
I exported a simple purchase order as an example dataset, to try and re-import into an empty purchase order. I thought this would be the "simplest" way to explore your new features but I ran into a few problems: Some things I have noticed: Step 3 - "Previous Step" button does not work Upload option should only exist when order is pending Certain fields cannot be imported How do you actually select the part you wish to add to the order? import field names do not match export fields column alignment issues blank drop-down menu field values do not carry across correctly |
@SchrodingersGat You ran into quite a lot of problems... sorry for that. |
Was able to reproduce
Was NOT able to reproduce
Others
My intention here is to let the user match a
Given |
In the process of importing already completed purchase orders into a new one, I noticed those few things I need to fix:
Optional
This could potentially call for an another form view after step 3, which summarize the import process. Maybe call that view only when problems were found? |
@eeintech I could reproduce "column alignment issues" - my file is attached. It seems to me the problem stems from removing a column in step 2. |
Thanks @matmair, I'll check it out when I get a chance! |
@eeintech I already have a solution for this problem, I found it intresting and took a shot. Should I submit a PR to your repo? |
Yes please! Thanks for your help! |
@eeintech I think I misunderstood the design intent a little, uploading data from a supplier (e.g. digikey) makes more sense here than what I did. At least I helped to shake out a few issues :) LMK when you're ready for review again and I'll take another look. |
Looks good, thanks @matmair !
…status, added purchase_price field
@SchrodingersGat @matmair I've updated my list of TODOs with a bunch of fixes, want to give it another shot? I've yet to implement |
A few things I found:
|
I'm currently not planning on supporting this, you can set the currency manually for all items and it defaults to the main currency from the global settings.
It works now,
Umm I don't have this problem no more... did you really try the latest on this branch? |
ok than I will take a look at it onve you are finished 😊
👍
I thought I did but will try right now |
@SchrodingersGat @matmair I just completed the list of "basic" features, please go ahead and test as much as you can! |
@eeintech first of all great features!
I also found that exporting a purchase-order, importing it without touching it results in an error (done with the order created with the file above) 👍xlsx works fine! |
@matmair Do me a favor and run |
I don't see it in Chrome: |
Import / Export works now. @eeintech maybe the table-problem is a Firefox thing. I wrote a few colleges and updated our test-instance - I will create a sperate issue if we can reliably reproduce it. |
@matmair Ha yeah don't use Firefox, got sucked in the Google spiral... It does look like the data is aligned but the background is messed up. If you find anything else, let me know. I had in mind to maybe tell the user if some line items were not created and reasons why. But maybe for another time... |
Looking really good now on my end (Firefox). Certainly an improvement on the BOM importer so I'd like to see that worked on once this is merged! :) Any further features / bugs you still plan to implement on this branch? @matmair any other comments / notes on this? |
@SchrodingersGat No further comments, great addition! |
The only things missing are test units I guess. I have to check how you implemented it for the BOM import @SchrodingersGat I'm eager to get this used to the BOM import too! |
Happy for you to submit unit testing as a separate PR, but please do :) So all OK to merge then? |
Sounds good, let do that. For sure I'll add unit testing as it would be a major feature when used by BOM importer. Yes ready to go! |
There is a lot to digest here!
In short, this PR introduces:
formtools
library inInvenTree/common/views.py
:MultiStepFormView
FileManagementFormView
FileManagementFormView
view inInvenTree/common/forms.py
FileManager
class to handle files containing tabular data inInvenTree/common/files.py
PurchaseOrderUpload
view inInvenTree/order/views.py
PurchaseOrderLineItem
instancesWhen (if?) this PR get merged, it will basically fix half of #431, the other half being to try to reuse the same framework for BOM upload.
@SchrodingersGat @matmair What do you guys think?
Screenshots
Let's do it
Match the fields
Match the parts
Done