mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Merge pull request #1222 from SchrodingersGat/bom-upload-fix
Fix IPN comparison against null value
This commit is contained in:
commit
a2f9d721f3
@ -131,8 +131,7 @@ $.fn.inventreeTable = function(options) {
|
|||||||
|
|
||||||
// Callback when a column is changed
|
// Callback when a column is changed
|
||||||
options.onColumnSwitch = function(field, checked) {
|
options.onColumnSwitch = function(field, checked) {
|
||||||
console.log(`${field} -> ${checked}`);
|
|
||||||
|
|
||||||
var columns = table.bootstrapTable('getVisibleColumns');
|
var columns = table.bootstrapTable('getVisibleColumns');
|
||||||
|
|
||||||
var text = visibleColumnString(columns);
|
var text = visibleColumnString(columns);
|
||||||
|
@ -214,9 +214,9 @@
|
|||||||
<tr>
|
<tr>
|
||||||
<td>
|
<td>
|
||||||
{% if part.active %}
|
{% if part.active %}
|
||||||
<span class='fas fa-check-square'></span>
|
<span class='fas fa-check-circle icon-green'></span>
|
||||||
{% else %}
|
{% else %}
|
||||||
<span class='fas fa-times-square'></span>
|
<span class='fas fa-times-circle icon-red'></span>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</td>
|
</td>
|
||||||
<td><b>{% trans "Active" %}</b></td>
|
<td><b>{% trans "Active" %}</b></td>
|
||||||
|
@ -1320,7 +1320,7 @@ class BomUpload(InvenTreeRoleMixin, FormView):
|
|||||||
# Otherwise, check to see if there is a matching IPN
|
# Otherwise, check to see if there is a matching IPN
|
||||||
try:
|
try:
|
||||||
if row['part_ipn']:
|
if row['part_ipn']:
|
||||||
part_matches = [part for part in self.allowed_parts if row['part_ipn'].lower() == part.IPN.lower()]
|
part_matches = [part for part in self.allowed_parts if part.IPN and row['part_ipn'].lower() == str(part.IPN.lower())]
|
||||||
|
|
||||||
# Check for single match
|
# Check for single match
|
||||||
if len(part_matches) == 1:
|
if len(part_matches) == 1:
|
||||||
|
@ -208,6 +208,7 @@ class StockItemSerializer(InvenTreeModelSerializer):
|
|||||||
'stale',
|
'stale',
|
||||||
'status',
|
'status',
|
||||||
'status_text',
|
'status_text',
|
||||||
|
'stocktake_date',
|
||||||
'supplier_part',
|
'supplier_part',
|
||||||
'supplier_part_detail',
|
'supplier_part_detail',
|
||||||
'tracking_items',
|
'tracking_items',
|
||||||
|
@ -1721,7 +1721,7 @@ class StockItemCreate(AjaxCreateView):
|
|||||||
|
|
||||||
item = form.save(commit=False)
|
item = form.save(commit=False)
|
||||||
item.user = self.request.user
|
item.user = self.request.user
|
||||||
item.save()
|
item.save(user=self.request.user)
|
||||||
|
|
||||||
return item
|
return item
|
||||||
|
|
||||||
@ -1732,7 +1732,7 @@ class StockItemCreate(AjaxCreateView):
|
|||||||
|
|
||||||
item = form.save(commit=False)
|
item = form.save(commit=False)
|
||||||
item.user = self.request.user
|
item.user = self.request.user
|
||||||
item.save()
|
item.save(user=self.request.user)
|
||||||
|
|
||||||
return item
|
return item
|
||||||
|
|
||||||
|
@ -590,6 +590,11 @@ function loadStockTable(table, options) {
|
|||||||
return locationDetail(row);
|
return locationDetail(row);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
field: 'stocktake_date',
|
||||||
|
title: '{% trans "Stocktake" %}',
|
||||||
|
sortable: true,
|
||||||
|
},
|
||||||
{% settings_value "STOCK_ENABLE_EXPIRY" as expiry %}
|
{% settings_value "STOCK_ENABLE_EXPIRY" as expiry %}
|
||||||
{% if expiry %}
|
{% if expiry %}
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user