Fixed asset picker backend

This commit is contained in:
Matthew Smith
2019-11-25 13:40:16 +00:00
parent 127b22fe71
commit d335ab3a80
2 changed files with 7 additions and 4 deletions

View File

@@ -16,6 +16,7 @@
{% endblock %} {% endblock %}
{% block js %} {% block js %}
{{ js.super }}
<script> <script>
$('#parent_id') $('#parent_id')
.selectpicker({ .selectpicker({
@@ -55,6 +56,7 @@ $('#parent_id')
'text': "No parent" 'text': "No parent"
}); });
} }
return assets; return assets;
}, },
preserveSelected: false preserveSelected: false

View File

@@ -1,4 +1,4 @@
<select name="parent_s" id="parent_s_id" class="selectpicker"> <select name="purchased_from" id="supplier_id" class="selectpicker">
{% if object.parent%} {% if object.parent%}
<option value="{{object.parent.pk}}" selected>{{object.parent.name}}</option> <option value="{{object.parent.pk}}" selected>{{object.parent.name}}</option>
{% endif %} {% endif %}
@@ -16,8 +16,9 @@
{% endblock %} {% endblock %}
{% block js %} {% block js %}
{{ js.super }}
<script> <script>
$('#parent_s_id') $('#supplier_id')
.selectpicker({ .selectpicker({
liveSearch: true liveSearch: true
}) })
@@ -44,7 +45,7 @@ $('#parent_s_id')
suppliers.push( suppliers.push(
{ {
'value': curr.id, 'value': curr.id,
'text': curr.label, 'text': curr.name,
'disabled': false 'disabled': false
} }
); );
@@ -55,7 +56,7 @@ $('#parent_s_id')
'text': "(no selection)" 'text': "(no selection)"
}); });
} }
return assets; return suppliers;
}, },
preserveSelected: false preserveSelected: false
}); });