mirror of
https://github.com/inventree/InvenTree.git
synced 2025-04-30 20:46:47 +00:00
Send item 'pk' in tree JSON
This commit is contained in:
parent
92930766c6
commit
897c0b5261
@ -40,6 +40,7 @@ class TreeSerializer(views.APIView):
|
|||||||
def itemToJson(self, item):
|
def itemToJson(self, item):
|
||||||
|
|
||||||
data = {
|
data = {
|
||||||
|
'pk': item.id,
|
||||||
'text': item.name,
|
'text': item.name,
|
||||||
'href': item.get_absolute_url(),
|
'href': item.get_absolute_url(),
|
||||||
'tags': [item.item_count],
|
'tags': [item.item_count],
|
||||||
@ -68,6 +69,7 @@ class TreeSerializer(views.APIView):
|
|||||||
top_count += item.item_count
|
top_count += item.item_count
|
||||||
|
|
||||||
top = {
|
top = {
|
||||||
|
'pk': None,
|
||||||
'text': self.title,
|
'text': self.title,
|
||||||
'href': self.root_url,
|
'href': self.root_url,
|
||||||
'nodes': nodes,
|
'nodes': nodes,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user