2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-07-13 08:21:26 +00:00

Added 'salable' field to Part model

This commit is contained in:
Oliver
2018-04-17 18:11:34 +10:00
parent 9dc41ba122
commit 45c5edee4d
5 changed files with 43 additions and 7 deletions

View File

@ -1,15 +1,18 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import os
from django.db import models
from django.db.models import Sum
from django.core.validators import MinValueValidator
from InvenTree.models import InvenTreeTree
import os
from django.db.models.signals import pre_delete
from django.dispatch import receiver
from InvenTree.models import InvenTreeTree
# from stock.models import StockLocation
class PartCategory(InvenTreeTree):
""" PartCategory provides hierarchical organization of Part objects.
@ -121,6 +124,9 @@ class Part(models.Model):
# Is this part "purchaseable"?
purchaseable = models.BooleanField(default=True, help_text='Can this part be purchased from external suppliers?')
# Can this part be sold to customers?
salable = models.BooleanField(default=False, help_text="Can this part be sold to customers?")
def __str__(self):
if self.IPN:
return "{name} ({ipn})".format(