2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-06-18 04:55:44 +00:00

Create new stock item from supplierpart stock page

- Allow stock-item-create form to have supplierpart passed as initial data
- Add some translations too
This commit is contained in:
Oliver Walters
2020-02-12 11:32:01 +11:00
parent 6d80788618
commit 33d21594da
7 changed files with 471 additions and 215 deletions

View File

@ -35,7 +35,7 @@
$("#stock-export").click(function() {
launchModalForm("{% url 'stock-export-options' %}", {
submit_text: "Export",
submit_text: '{% trans "Export" %}',
success: function(response) {
var url = "{% url 'stock-export' %}";
@ -48,4 +48,25 @@
});
});
$("#item-create").click(function() {
launchModalForm("{% url 'stock-item-create' %}", {
reload: true,
data: {
part: {{ part.part.id }},
supplier_part: {{ part.id }},
},
secondary: [
{
field: 'location',
label: '{% trans "New Location" %}',
title: '{% trans "Create New Location" %}',
url: "{% url 'stock-location-create' %}",
}
]
});
return false;
});
{% endblock %}