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