mirror of
https://github.com/inventree/InvenTree.git
synced 2025-06-19 21:45:39 +00:00
Add a button to create a new part if necessary
This commit is contained in:
@ -685,7 +685,7 @@ class Part(models.Model):
|
||||
- Exclude parts which this part is in the BOM for
|
||||
"""
|
||||
|
||||
parts = Part.objects.filter(component=True)
|
||||
parts = Part.objects.filter(component=True).exclude(id=self.id)
|
||||
parts = parts.exclude(id__in=[part.id for part in self.used_in.all()])
|
||||
|
||||
return parts
|
||||
|
@ -47,6 +47,10 @@
|
||||
{% for item in row.data %}
|
||||
<td>
|
||||
{% if item.column.guess == 'Part' %}
|
||||
<button class='btn btn-default btn-create' id='new_part_row_{{ row.index }}' title='Create new part' type='button'>
|
||||
<span row_id='{{ row.index }}' class='glyphicon glyphicon-small glyphicon-plus' onClick='newPartFromBomWizard()'/>
|
||||
</button>
|
||||
|
||||
<select class='select bomselect' id='id_part_{{ row.index }}' name='part_select_{{ row.index }}'>
|
||||
<option value=''>---------</option>
|
||||
{% for part in row.part_options %}
|
||||
|
Reference in New Issue
Block a user