Add "note" field for stocktake

This commit is contained in:
Oliver Walters 2022-12-21 22:27:55 +11:00
parent ca11a90513
commit a81d4eef57
3 changed files with 13 additions and 1 deletions

View File

@ -1,4 +1,4 @@
# Generated by Django 3.2.16 on 2022-12-16 01:59
# Generated by Django 3.2.16 on 2022-12-21 11:26
from django.conf import settings
import django.core.validators
@ -20,6 +20,7 @@ class Migration(migrations.Migration):
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('quantity', models.DecimalField(decimal_places=5, help_text='Total available stock at time of stocktake', max_digits=19, validators=[django.core.validators.MinValueValidator(0)], verbose_name='Quantity')),
('date', models.DateField(auto_now_add=True, help_text='Date stocktake was performed', verbose_name='Date')),
('note', models.CharField(blank=True, help_text='Additional notes', max_length=250, verbose_name='Notes')),
('part', models.ForeignKey(help_text='Part for stocktake', on_delete=django.db.models.deletion.CASCADE, related_name='stocktakes', to='part.part', verbose_name='Part')),
('user', models.ForeignKey(blank=True, help_text='User who performed this stocktake', null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='part_stocktakes', to=settings.AUTH_USER_MODEL, verbose_name='User')),
],

View File

@ -2908,6 +2908,13 @@ class PartStocktake(models.Model):
auto_now_add=True
)
note = models.CharField(
max_length=250,
blank=True,
verbose_name=_('Notes'),
help_text=_('Additional notes'),
)
user = models.ForeignKey(
User, blank=True, null=True,
on_delete=models.SET_NULL,

View File

@ -720,6 +720,10 @@ function loadPartStocktakeTable(partId, options={}) {
field: 'quantity',
title: '{% trans "Quantity" %}',
},
{
field: 'note',
title: '{% trans "Notes" %}',
},
{
field: 'user',
title: '{% trans "User" %}',