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,7 +131,6 @@ $.fn.inventreeTable = function(options) {
|
||||
|
||||
// Callback when a column is changed
|
||||
options.onColumnSwitch = function(field, checked) {
|
||||
console.log(`${field} -> ${checked}`);
|
||||
|
||||
var columns = table.bootstrapTable('getVisibleColumns');
|
||||
|
||||
|
@ -214,9 +214,9 @@
|
||||
<tr>
|
||||
<td>
|
||||
{% if part.active %}
|
||||
<span class='fas fa-check-square'></span>
|
||||
<span class='fas fa-check-circle icon-green'></span>
|
||||
{% else %}
|
||||
<span class='fas fa-times-square'></span>
|
||||
<span class='fas fa-times-circle icon-red'></span>
|
||||
{% endif %}
|
||||
</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
|
||||
try:
|
||||
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
|
||||
if len(part_matches) == 1:
|
||||
|
@ -208,6 +208,7 @@ class StockItemSerializer(InvenTreeModelSerializer):
|
||||
'stale',
|
||||
'status',
|
||||
'status_text',
|
||||
'stocktake_date',
|
||||
'supplier_part',
|
||||
'supplier_part_detail',
|
||||
'tracking_items',
|
||||
|
@ -1721,7 +1721,7 @@ class StockItemCreate(AjaxCreateView):
|
||||
|
||||
item = form.save(commit=False)
|
||||
item.user = self.request.user
|
||||
item.save()
|
||||
item.save(user=self.request.user)
|
||||
|
||||
return item
|
||||
|
||||
@ -1732,7 +1732,7 @@ class StockItemCreate(AjaxCreateView):
|
||||
|
||||
item = form.save(commit=False)
|
||||
item.user = self.request.user
|
||||
item.save()
|
||||
item.save(user=self.request.user)
|
||||
|
||||
return item
|
||||
|
||||
|
@ -590,6 +590,11 @@ function loadStockTable(table, options) {
|
||||
return locationDetail(row);
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'stocktake_date',
|
||||
title: '{% trans "Stocktake" %}',
|
||||
sortable: true,
|
||||
},
|
||||
{% settings_value "STOCK_ENABLE_EXPIRY" as expiry %}
|
||||
{% if expiry %}
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user