mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Merge pull request #2747 from matmair/matmair/issue1697
Add field with last updated to supplier price break
This commit is contained in:
commit
adc44184b6
@ -12,11 +12,14 @@ import common.models
|
|||||||
INVENTREE_SW_VERSION = "0.7.0 dev"
|
INVENTREE_SW_VERSION = "0.7.0 dev"
|
||||||
|
|
||||||
# InvenTree API version
|
# InvenTree API version
|
||||||
INVENTREE_API_VERSION = 30
|
INVENTREE_API_VERSION = 31
|
||||||
|
|
||||||
"""
|
"""
|
||||||
Increment this API version number whenever there is a significant change to the API that any clients need to know about
|
Increment this API version number whenever there is a significant change to the API that any clients need to know about
|
||||||
|
|
||||||
|
v31 -> 2022-03-14
|
||||||
|
- Adds "updated" field to SupplierPriceBreakList and SupplierPriceBreakDetail API endpoints
|
||||||
|
|
||||||
v30 -> 2022-03-09
|
v30 -> 2022-03-09
|
||||||
- Adds "exclude_location" field to BuildAutoAllocation API endpoint
|
- Adds "exclude_location" field to BuildAutoAllocation API endpoint
|
||||||
- Allows BuildItem API endpoint to be filtered by BomItem relation
|
- Allows BuildItem API endpoint to be filtered by BomItem relation
|
||||||
|
@ -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'),
|
||||||
|
),
|
||||||
|
]
|
@ -693,6 +693,7 @@ class SupplierPriceBreak(common.models.PriceBreak):
|
|||||||
|
|
||||||
Attributes:
|
Attributes:
|
||||||
part: Link to a SupplierPart object that this price break applies to
|
part: Link to a SupplierPart object that this price break applies to
|
||||||
|
updated: Automatic DateTime field that shows last time the price break was updated
|
||||||
quantity: Quantity required for price break
|
quantity: Quantity required for price break
|
||||||
cost: Cost at specified quantity
|
cost: Cost at specified quantity
|
||||||
currency: Reference to the currency of this pricebreak (leave empty for base currency)
|
currency: Reference to the currency of this pricebreak (leave empty for base currency)
|
||||||
@ -704,6 +705,8 @@ class SupplierPriceBreak(common.models.PriceBreak):
|
|||||||
|
|
||||||
part = models.ForeignKey(SupplierPart, on_delete=models.CASCADE, related_name='pricebreaks', verbose_name=_('Part'),)
|
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:
|
class Meta:
|
||||||
unique_together = ("part", "quantity")
|
unique_together = ("part", "quantity")
|
||||||
|
|
||||||
|
@ -278,4 +278,5 @@ class SupplierPriceBreakSerializer(InvenTreeModelSerializer):
|
|||||||
'quantity',
|
'quantity',
|
||||||
'price',
|
'price',
|
||||||
'price_currency',
|
'price_currency',
|
||||||
|
'updated',
|
||||||
]
|
]
|
||||||
|
@ -268,6 +268,14 @@ $('#price-break-table').inventreeTable({
|
|||||||
return html;
|
return html;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
field: 'updated',
|
||||||
|
title: '{% trans "Last updated" %}',
|
||||||
|
sortable: true,
|
||||||
|
formatter: function(value) {
|
||||||
|
return renderDate(value);
|
||||||
|
}
|
||||||
|
},
|
||||||
]
|
]
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user