2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-07-11 07:24:15 +00:00

Merge pull request #988 from SchrodingersGat/sell-price

Sell price
This commit is contained in:
Oliver
2020-09-19 23:52:25 +10:00
committed by GitHub
22 changed files with 503 additions and 94 deletions

View File

@ -46,6 +46,8 @@ from order import models as OrderModels
from company.models import SupplierPart
from stock import models as StockModels
import common.models
class PartCategory(InvenTreeTree):
""" PartCategory provides hierarchical organization of Part objects.
@ -1226,6 +1228,21 @@ class PartAttachment(InvenTreeAttachment):
related_name='attachments')
class PartSellPriceBreak(common.models.PriceBreak):
"""
Represents a price break for selling this part
"""
part = models.ForeignKey(
Part, on_delete=models.CASCADE,
related_name='salepricebreaks',
limit_choices_to={'salable': True}
)
class Meta:
unique_together = ('part', 'quantity')
class PartStar(models.Model):
""" A PartStar object creates a relationship between a User and a Part.