2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-05-03 13:58:47 +00:00

Add 'allocated' column to Build detail view

This commit is contained in:
Oliver Walters 2019-05-07 23:31:41 +10:00
parent 29b94c91f3
commit 85869c07f6
2 changed files with 5 additions and 2 deletions

View File

@ -264,7 +264,8 @@ class Build(models.Model):
for item in self.part.bom_items.all(): for item in self.part.bom_items.all():
part = {'part': item.sub_part, part = {'part': item.sub_part,
'per_build': item.quantity, 'per_build': item.quantity,
'quantity': item.quantity * self.quantity 'quantity': item.quantity * self.quantity,
'allocated': self.getAllocatedQuantity(item.sub_part)
} }
parts.append(part) parts.append(part)

View File

@ -85,7 +85,8 @@
<tr> <tr>
<th>Part</th> <th>Part</th>
<th>Required</th> <th>Required</th>
<th>Stock</th> <th>Available</th>
<th>Allocated</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
@ -94,6 +95,7 @@
<td><a href="{% url 'part-detail' item.part.id %}">{{ item.part.name }}</a></td> <td><a href="{% url 'part-detail' item.part.id %}">{{ item.part.name }}</a></td>
<td>{{ item.quantity }}</td> <td>{{ item.quantity }}</td>
<td>{{ item.part.total_stock }}</td> <td>{{ item.part.total_stock }}</td>
<td>{{ item.allocated }}</td>
</tr> </tr>
{% endfor %} {% endfor %}
</tbody> </tbody>