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:
@ -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);
|
||||
|
Reference in New Issue
Block a user