Repository navigation
Description
Please verify that this bug has NOT been raised before.
- I checked and didn't find a similar issue
Describe the bug*
I have not been using InvenTree too much the last few months, but now one of my scripts interacting with the API has failed with a new error, which has not present last time I ran it. Unfortunately, I can't determine on which last version I last ran the script successfully.
Steps to Reproduce
The error appears when using the demo also. Using the python API wrapper:
(I added the note to the SalesOrder with pk=11 in the demo server).
>>> so = SalesOrder(api, pk=11)
>>> so.notes
'This order has notes'
>>> so.reference
'SO0025'
>>> so_alt = SalesOrder.list(api, reference=so.reference)[0]
>>> so_alt.reference
'SO0025'
>>> so_alt.notes
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/martin/repos/inventree-forks/inventree-python/inventree/base.py", line 353, in __getattr__
return super().__getattribute__(name)
AttributeError: 'SalesOrder' object has no attribute 'notes'With PurchaseOrder, the same thing happens:
>>> po = PurchaseOrder(api, pk=12)
>>> po.notes
"Don't forget to send them an invoice!\n\n### Important Order Information:\n\n`This supplier does not accept money as payment - only barter in kind. Last time we placed an order, we paid with seventeen ducklings. The supplier has indicated that they still are in possession of a suffient quantity of ducklings. A new type of payment must be determined.`"
>>> po.reference
'PO0012'
>>> po_alt = PurchaseOrder.list(api, reference=po.reference)[0]
>>> po_alt.notes
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/martin/repos/inventree-forks/inventree-python/inventree/base.py", line 353, in __getattr__
return super().__getattribute__(name)
AttributeError: 'PurchaseOrder' object has no attribute 'notes'As you see:
- The note is available when getting a SalesOrder or PurchaseOrder by pk.
- The note is not available when getting a SalesOrder or PurchaseOrder through the
list()method.
Getting directly from the API at https://demo.inventree.org/api/order/so/:
[
...
{
"pk": 11,
"creation_date": "2024-11-08",
"target_date": "2025-02-20",
"description": "Another order for widgets",
"line_items": 2,
"completed_lines": 0,
"link": "",
"project_code": 5,
"project_code_label": "PRO-ZEN",
"project_code_detail": {
"pk": 5,
"code": "PRO-ZEN",
"description": "Project Zenith",
"responsible": null,
"responsible_detail": null
},
"reference": "SO0025",
"responsible": null,
"responsible_detail": null,
"contact": null,
"contact_detail": null,
"address": null,
"address_detail": null,
"status": 15,
"status_text": "In Progress",
"status_custom_key": 15,
"barcode_hash": "",
"overdue": false,
"customer": 34,
"customer_reference": "CE-1234-XYZ",
"shipment_date": null,
"total_price": "739.800000",
"order_currency": "CNY",
"shipments_count": 2,
"completed_shipments_count": 0
},
...
]Getting from https://demo.inventree.org/api/order/so/11/:
{
"pk": 11,
"creation_date": "2024-11-08",
"target_date": "2025-02-20",
"description": "Another order for widgets",
"line_items": 2,
"completed_lines": 0,
"link": "",
"project_code": 5,
"project_code_label": "PRO-ZEN",
"project_code_detail": {
"pk": 5,
"code": "PRO-ZEN",
"description": "Project Zenith",
"responsible": null,
"responsible_detail": null
},
"reference": "SO0025",
"responsible": null,
"responsible_detail": null,
"contact": null,
"contact_detail": null,
"address": null,
"address_detail": null,
"status": 15,
"status_text": "In Progress",
"status_custom_key": 15,
"notes": "This order has notes",
"barcode_hash": "",
"overdue": false,
"customer": 34,
"customer_reference": "CE-1234-XYZ",
"shipment_date": null,
"total_price": "739.800000",
"order_currency": "CNY",
"shipments_count": 2,
"completed_shipments_count": 0
}A diff:
$ diff so_fromlist.txt so_frompk.txt
27a28
> "notes": "This order has notes",
For PurchaseOrder, same story.
Expected behaviour
The information should be the same, regardless of method used.
Deployment Method
- Docker
- Package
- Bare metal
- Other - added info in Steps to Reproduce
Version Information
Demo server,
Version Information:
InvenTree-Version: 0.17.0 dev
Django Version: 4.2.17
Commit Hash: 88ab593
Commit Date: 16-12-2024
Database: postgresql
Debug-Mode: False
Deployed using Docker: True
Platform: Linux-5.15.0-100-generic-x86_64-with
Installer: DOC
Active plugins: False
Please verify if you can reproduce this bug on the demo site.
- I can reproduce this bug on the demo site.
Activity
github-actions commentedon Feb 15, 2025
This issue seems stale. Please react to show this is still important.
JJSteh commentedon Jan 6, 2026
I currently have this issue as well.
InvenTree-Version: 1.1.7
Django Version: 4.2.26
Commit Hash: 2f9cf5f
Commit Date: 2025-12-17
Commit Branch: null
Database: django.db.backends.postgresql
Debug-Mode: False
Deployed using Docker: True
Platform: Linux-6.12.57+deb13-amd64-x86_64-with-glibc2.41
Installer: DOC
SchrodingersGat commentedon Jan 17, 2026
As the "notes" fields can be rather large markdown text, they do not appear in the "list" views, and are only returned for detail views.
This is done to reduce network overhead / query time. And, given that the "notes" field is only accessed in the detail page of the UI it seems a reasonable compromise.
May I ask what is the exact issue you are experiencing - why you need the notes field in the LIST API endpoint?