Open si-hb opened 5 months ago
Hm do you always get that error when trying to import that specific part?
I don't get the error if the TME part exists.
DRV8837DSGR
exists at tme though. It also just works fine for me.
Are you using an anonymous or private TME API token?
Hm do you always get that error when trying to import that specific part?
Tested again and appears so, yes.
Oh, I got an idea! What's your language and location set to?
Oh, I got an idea! What's your language and location set to?
EN/CA
Do you have your currency set to CAD by any chance?
Do you have your currency set to CAD by any chance?
Yes
Ah! That's the problem! TME only supports EUR, USD and GBP. If you still want pricing information for tme you can overwrite the currency for TME only by specifying currency: USD
(for example) under the TME
section in your suppliers.yaml
.
I'll add a warning + actual fix for the error tomorrow.
Got a simple fix for the error for now, but I'd really like to have a warning/interactive resolving as well, but that's going to require some more refactoring ...
You'll get an error now, but no interactive resolving. Going to leave this open, because I'll probably still have to do the refactoring eventually ...
Appears to be caused by TME not returning any data for a part, therefore index [0] doesn't exit? I don't get the error if the TME part exists.
$ inventree-part-import DRV8837DSGR
searching for DRV8837DSGR ... Traceback (most recent call last):
....
packages/inventree_part_import/suppliers/supplier_tme.py", line 23, in search tme_stock = self.tme_api.get_prices_and_stocks([tme_part["Symbol"]])[0] IndexError: list index out of range```