Add "last updated" field to supplier price break

Add model
Fixes #1697
This commit is contained in:
Matthias 2022-03-14 23:22:29 +01:00
parent 2d4cc91701
commit 752b70c1f7
No known key found for this signature in database
GPG Key ID: F50EF5741D33E076
2 changed files with 21 additions and 1 deletions

View File

@ -0,0 +1,18 @@
# Generated by Django 3.2.12 on 2022-03-14 22:19
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('company', '0041_alter_company_options'),
]
operations = [
migrations.AddField(
model_name='supplierpricebreak',
name='updated',
field=models.DateTimeField(auto_now=True, null=True, verbose_name='last updated'),
),
]

View File

@ -686,7 +686,7 @@ class SupplierPart(models.Model):
return s
class SupplierPriceBreak(common.models.PriceBreak):
class SupplierPriceBreak(common.models.PriceBreak):
""" Represents a quantity price break for a SupplierPart.
- Suppliers can offer discounts at larger quantities
- SupplierPart(s) may have zero-or-more associated SupplierPriceBreak(s)
@ -704,6 +704,8 @@ class SupplierPriceBreak(common.models.PriceBreak):
part = models.ForeignKey(SupplierPart, on_delete=models.CASCADE, related_name='pricebreaks', verbose_name=_('Part'),)
updated = models.DateTimeField(auto_now=True, null=True, verbose_name=_('last updated'))
class Meta:
unique_together = ("part", "quantity")