Show 'available_stock' in Part string representation

This commit is contained in:
eeintech 2020-08-20 15:38:41 -05:00
parent 852a680c09
commit 9fa13aeae3
2 changed files with 2 additions and 2 deletions

View File

@ -269,7 +269,7 @@ class Part(MPTTModel):
super().save(*args, **kwargs) super().save(*args, **kwargs)
def __str__(self): def __str__(self):
return "{n} - {d}".format(n=self.full_name, d=self.description) return f"{self.full_name} - {self.description} - {self.available_stock}"
def checkAddToBOM(self, parent): def checkAddToBOM(self, parent):
""" """

View File

@ -63,7 +63,7 @@
<option value=''>--- {% trans "Select Part" %} ---</option> <option value=''>--- {% trans "Select Part" %} ---</option>
{% for part in row.part_options %} {% for part in row.part_options %}
<option value='{{ part.id }}' {% if part.id == row.part.id %} selected='selected' {% elif part.id == row.part_match.id %} selected='selected' {% endif %}> <option value='{{ part.id }}' {% if part.id == row.part.id %} selected='selected' {% elif part.id == row.part_match.id %} selected='selected' {% endif %}>
{{ part.full_name }} - {{ part.description }} {{ part }}
</option> </option>
{% endfor %} {% endfor %}
</select> </select>