2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-06-19 21:45:39 +00:00

Save tree state 'per tree'

- Separate save state for Part and Stock tree
This commit is contained in:
Oliver Walters
2019-05-09 21:41:44 +10:00
parent 45223fb607
commit bff0f30b13
5 changed files with 51 additions and 9 deletions

View File

@ -57,7 +57,8 @@ class PartCategory(InvenTreeTree):
(including children of child categories)
"""
return len(Part.objects.filter(category__in=self.getUniqueChildren()))
return len(Part.objects.filter(category__in=self.getUniqueChildren(),
active=True))
@property
def has_parts(self):

View File

@ -34,7 +34,11 @@ InvenTree | Part List
{% block js_ready %}
{{ block.super }}
loadTree("{% url 'api-part-tree' %}",
"#part-tree");
"#part-tree",
{
name: 'part',
}
);
$("#toggle-part-tree").click(function() {
toggleSideNav("#sidenav");