2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-06-19 05:25:42 +00:00

Correctly serialize stock when creating via the API

This commit is contained in:
Oliver
2021-11-03 07:41:47 +11:00
parent ad4c4f2a6d
commit 2b69d9c2af
2 changed files with 62 additions and 17 deletions

View File

@ -216,12 +216,16 @@ function duplicateStockItem(pk, options) {
inventreeGet(`/api/stock/${pk}/`, {}, {
success: function(data) {
options.create = true;
// Do not duplicate the serial number
delete data['serial'];
options.data = data;
options.method = 'POST';
options.create = true;
options.fields = stockItemFields(options);
options.groups = stockItemGroups(options);
options.method = 'POST';
options.title = '{% trans "Duplicate Stock Item" %}';
constructForm('{% url "api-stock-list" %}', options);