mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Added ability to mark project part as "output" (generated BY project)
This commit is contained in:
parent
4a74cd2199
commit
08fc21eb9b
@ -12,7 +12,7 @@ class ProjectAdmin(admin.ModelAdmin):
|
||||
|
||||
|
||||
class ProjectPartAdmin(admin.ModelAdmin):
|
||||
list_display = ('part', 'project', 'quantity')
|
||||
list_display = ('part', 'project', 'quantity', 'output')
|
||||
|
||||
|
||||
class ProjectRunAdmin(admin.ModelAdmin):
|
||||
|
@ -64,6 +64,10 @@ class ProjectPart(models.Model):
|
||||
default=OVERAGE_ABSOLUTE,
|
||||
choices=OVARAGE_CODES.items())
|
||||
|
||||
# Set if the part is generated by the project,
|
||||
# rather than being consumed by the project
|
||||
output = models.BooleanField(default=False)
|
||||
|
||||
def __str__(self):
|
||||
return "{quan} x {name}".format(
|
||||
name=self.part.name,
|
||||
|
@ -12,7 +12,8 @@ class ProjectPartSerializer(serializers.ModelSerializer):
|
||||
'project',
|
||||
'quantity',
|
||||
'overage',
|
||||
'overage_type')
|
||||
'overage_type',
|
||||
'output')
|
||||
|
||||
|
||||
class ProjectBriefSerializer(serializers.ModelSerializer):
|
||||
|
Loading…
Reference in New Issue
Block a user