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

Where did the notes attribute go? #259

Open
SergeoLacruz opened this issue Jan 16, 2025 · 5 comments
Open

Where did the notes attribute go? #259

SergeoLacruz opened this issue Jan 16, 2025 · 5 comments

Comments

@SergeoLacruz
Copy link
Contributor

Since update to 17 the notes attribute on parts has vanished. The following does not work any longer:

part_to_update.save({ 'notes': 'Hello'})
print(part_to_update.notes)

AttributeError: 'Part' object has no attribute 'notes'

Any idea?

@miggland
Copy link
Contributor

How did you get the part, through list(), or directly with a defined pk?

See this issue, it could be related: inventree/InvenTree#8672

The difference in that case is not in inventree-python, but in the API..

@SergeoLacruz
Copy link
Contributor Author

via Part.list(api) and then some further search in the list.

@miggland
Copy link
Contributor

Probably you will be able to access the note if do something like

part_to_update = Part(api, pk=14)

@SergeoLacruz
Copy link
Contributor Author

In that way it works. Strange...
Thanks for the hint :-)

@miggland
Copy link
Contributor

Yes, I agree. The reason is that getting a single item and the listing use different API endpoints.

The listing does not return notes, whereas the single item endpoint does, thus inventree/InvenTree#8672 ..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants