2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-06-20 05:46:34 +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

@ -1,5 +1,6 @@
{% extends "part/part_base.html" %}
{% load static %}
{% load i18n %}
{% block details %}
{% include 'part/tabs.html' with tab='stock' %}
@ -49,7 +50,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' %}";
@ -71,14 +72,14 @@
secondary: [
{
field: 'part',
label: 'New Part',
title: 'Create New Part',
label: '{% trans "New Part" %}',
title: '{% trans "Create New Part" %}',
url: "{% url 'part-create' %}",
},
{
field: 'supplier_part',
label: 'New Supplier Part',
title: 'Create new Supplier Part',
label: '{% trans "New Supplier Part" %}',
title: '{% trans "Create new Supplier Part" %}',
url: "{% url 'supplier-part-create' %}",
data: {
part: {{ part.id }}
@ -86,8 +87,8 @@
},
{
field: 'location',
label: 'New Location',
title: 'Create New Location',
label: '{% trans "New Location" %}',
title: '{% trans "Create New Location" %}',
url: "{% url 'stock-location-create' %}",
}
]