InvenTree icon indicating copy to clipboard operation
InvenTree copied to clipboard

Purchase order doesn't find all components - and uses wrong currency

Open tomse opened this issue 1 year ago • 23 comments

Please verify that this bug has NOT been raised before.

  • [X] I checked and didn't find a similar issue

Describe the bug*

So I'm trying out a purchase order and import a .csv - all the components are added beforehand. Some components are shown in step 3 of the import, and some are not - red circles in the screenshots.

(should I make a new bug report for the currency?) My currency default is Danish Kr., but for this supplier I've chosen USD. (see yellow circles) How can I make a selection that everything should be in USD? having 20+ different components is tedious to change.

image

Here you can see one of the individual parts that aren't to find for the same supplier partnumber (column selection naming would be nice if they also are the same as Step 2 in the csv import). image

Steps to Reproduce

Make an order, make sure all the components have been added beforehand. Get a CSV with your order and upload it.

Expected behaviour

all the missing component fields should be filled out.

Deployment Method

  • [X] Docker
  • [ ] Bare metal

Version Information

[0.13.5]

Please verify if you can reproduce this bug on the demo site.

  • [ ] I can reproduce this bug on the demo site.

Relevant log output

No response

tomse avatar Mar 05 '24 22:03 tomse

LCSC_Exported.csv

Attached is my CSV file

tomse avatar Mar 05 '24 22:03 tomse

(should I make a new bug report for the currency?) My currency default is Danish Kr., but for this supplier I've chosen USD. (see yellow circles) How can I make a selection that everything should be in USD? having 20+ different components is tedious to change.

Please raise a new issue for this. The importer for purchase order items does not currently support switching currency AFAIK. So this would need to be implemented

SchrodingersGat avatar Mar 06 '24 10:03 SchrodingersGat

Regarding this issue - For line number 4, in the drop-down menu can you find and select the c131154 component?

SchrodingersGat avatar Mar 06 '24 10:03 SchrodingersGat

Regarding this issue - For line number 4, in the drop-down menu can you find and select the c131154 component?

unfortunately no

image

image

tomse avatar Mar 07 '24 20:03 tomse

unfortunately no

That's very weird then. Can you find the supplier part in the global search drop-down (magnifying glass icon in the top right of the screen)?

SchrodingersGat avatar Mar 12 '24 21:03 SchrodingersGat

very weird indeed..

yes, I can also find it in "Parts" search/filter box

here is a partial search for "c13" image

The components have all been added using kintree (don't know if that helps).

I'm really at a loss here.. I've been trying to see any differences between a found component and unfound component.

Running in docker, are there any logs I can look in to supply more data?

tomse avatar Mar 12 '24 22:03 tomse

@tomse I cannot think of any more tests to run for this. It is very strange.

In the "import" window, when you type something (e.g. "C13") into the drop-down menu, can you show the API request and response data? This is available in the "developer" tab in your browser

SchrodingersGat avatar Mar 14 '24 04:03 SchrodingersGat

@SchrodingersGat I hope the following screenshots are what you're requesting

by import window I'm understanding this one? image

image

image

image

image

tomse avatar Mar 14 '24 11:03 tomse

@tomse no that's just for notification fetching. You'll need to capture while you are typing into the box. It should send a search query with the text you type, back to the server

SchrodingersGat avatar Mar 14 '24 11:03 SchrodingersGat

@SchrodingersGat I'm not sure if I'm doing this correctly Using firefox: Step 3 in uploading csv.

Web Developer Tools

  • Network (is the only place I can find request/response)

"ALL" seems messy - specially under Response where I get a truncated html output with 40k lines image

tomse avatar Mar 14 '24 11:03 tomse

  1. You can filter by XHR
  2. Just before you select the drop-down, clear the log
  3. As you type you should see the requests going to the server

SchrodingersGat avatar Mar 14 '24 11:03 SchrodingersGat

I'm doing something wrong.. sorry.. web dev tools is not something I'm fluent in.. not even 1% I cleared "something" and now the request/response are empty, even after reloading the page. it would probably be best that you describe in better detail what I need to do, I'm ok in switching browser is that is your preference

I do get this filter output in another window, but it doesn't matter if I select request/response, it shows the same

image

tomse avatar Mar 14 '24 12:03 tomse

What @SchrodingersGat meant was doinging the following with the Select input where you have the issues (this was using chrome, but should work with firefox too):

https://github.com/inventree/InvenTree/assets/76838159/8dfe46e0-9ca3-4e68-8588-7bdcf2f920e0

wolflu05 avatar Mar 14 '24 12:03 wolflu05

what am I doing wrong? (make note I expect we are in the step 3 of uploading the csv rather than adding a new part)

https://github.com/inventree/InvenTree/assets/1444539/5059d298-1d32-45bd-9ea5-e3b73ea79f57

tomse avatar Mar 14 '24 12:03 tomse

@tomse that looks correct. What request data is being sent?

  • URL
  • Headers
  • Parameters

It looks like the response is empty. For the response:

  • What is the return code?
  • Headers

SchrodingersGat avatar Mar 14 '24 13:03 SchrodingersGat

I noticed a new webserver and settings in the docker .env file.. is that something to look into?

is this what you're asking for? image

tomse avatar Mar 14 '24 13:03 tomse

@tomse huh, looking into the code it appears that this import method does not make use of the API. The options for each drop-down are pre-rendered on the server...

This is all going to be totally refactored as part of our roadmap to fix the import/export interface. Perhaps you would be willing to contribute funding towards this feature?

SchrodingersGat avatar Mar 15 '24 05:03 SchrodingersGat

@SchrodingersGat done :-)

tomse avatar Mar 15 '24 09:03 tomse

@tomse thanks! In the mean time, you could also use the admin import functionality to get your data into the system? This one edge case is very strange.

SchrodingersGat avatar Mar 15 '24 12:03 SchrodingersGat

This issue seems stale. Please react to show this is still important.

github-actions[bot] avatar May 15 '24 11:05 github-actions[bot]

strange didn't get a notification other than the bot.. should we keep the issue open ?

tomse avatar May 16 '24 15:05 tomse

@tomse I will keep it open as it is referenced by a PR which will address it: https://github.com/inventree/InvenTree/pull/6911

SchrodingersGat avatar May 16 '24 23:05 SchrodingersGat

@tomse I will keep it open as it is referenced by a PR which will address it: #6911

Thanks mate :-)

tomse avatar May 20 '24 15:05 tomse