mirror of
https://github.com/inventree/InvenTree.git
synced 2025-06-17 04:25:42 +00:00
added more translation-strings
This commit is contained in:
@ -117,6 +117,7 @@ class BuildOutputDeleteForm(HelperForm):
|
||||
|
||||
confirm = forms.BooleanField(
|
||||
required=False,
|
||||
label=_('Confirm'),
|
||||
help_text=_('Confirm deletion of build output')
|
||||
)
|
||||
|
||||
@ -138,7 +139,7 @@ class UnallocateBuildForm(HelperForm):
|
||||
Form for auto-de-allocation of stock from a build
|
||||
"""
|
||||
|
||||
confirm = forms.BooleanField(required=False, help_text=_('Confirm unallocation of stock'))
|
||||
confirm = forms.BooleanField(required=False, label=_('Confirm'), help_text=_('Confirm unallocation of stock'))
|
||||
|
||||
output_id = forms.IntegerField(
|
||||
required=False,
|
||||
@ -162,7 +163,7 @@ class UnallocateBuildForm(HelperForm):
|
||||
class AutoAllocateForm(HelperForm):
|
||||
""" Form for auto-allocation of stock to a build """
|
||||
|
||||
confirm = forms.BooleanField(required=True, help_text=_('Confirm stock allocation'))
|
||||
confirm = forms.BooleanField(required=True, label=_('Confirm'), help_text=_('Confirm stock allocation'))
|
||||
|
||||
# Keep track of which build output we are interested in
|
||||
output = forms.ModelChoiceField(
|
||||
@ -209,15 +210,17 @@ class CompleteBuildOutputForm(HelperForm):
|
||||
|
||||
location = forms.ModelChoiceField(
|
||||
queryset=StockLocation.objects.all(),
|
||||
label = _('Location'),
|
||||
help_text=_('Location of completed parts'),
|
||||
)
|
||||
|
||||
confirm_incomplete = forms.BooleanField(
|
||||
required=False,
|
||||
label=_('Confirm incomplete'),
|
||||
help_text=_("Confirm completion with incomplete stock allocation")
|
||||
)
|
||||
|
||||
confirm = forms.BooleanField(required=True, help_text=_('Confirm build completion'))
|
||||
confirm = forms.BooleanField(required=True, label=_('Confirm'), help_text=_('Confirm build completion'))
|
||||
|
||||
output = forms.ModelChoiceField(
|
||||
queryset=StockItem.objects.all(), # Queryset is narrowed in the view
|
||||
@ -237,7 +240,7 @@ class CompleteBuildOutputForm(HelperForm):
|
||||
class CancelBuildForm(HelperForm):
|
||||
""" Form for cancelling a build """
|
||||
|
||||
confirm_cancel = forms.BooleanField(required=False, help_text=_('Confirm build cancellation'))
|
||||
confirm_cancel = forms.BooleanField(required=False, label=_('Confirm cancel'), help_text=_('Confirm build cancellation'))
|
||||
|
||||
class Meta:
|
||||
model = Build
|
||||
@ -251,7 +254,7 @@ class EditBuildItemForm(HelperForm):
|
||||
Form for creating (or editing) a BuildItem object.
|
||||
"""
|
||||
|
||||
quantity = RoundingDecimalFormField(max_digits=10, decimal_places=5, help_text=_('Select quantity of stock to allocate'))
|
||||
quantity = RoundingDecimalFormField(max_digits=10, decimal_places=5, label=_('Quantity'), help_text=_('Select quantity of stock to allocate'))
|
||||
|
||||
part_id = forms.IntegerField(required=False, widget=forms.HiddenInput())
|
||||
|
||||
|
@ -1,7 +1,8 @@
|
||||
# Generated by Django 3.0.7 on 2021-04-03 12:10
|
||||
# Generated by Django 3.0.7 on 2021-04-04 20:16
|
||||
|
||||
import InvenTree.models
|
||||
from django.conf import settings
|
||||
import django.core.validators
|
||||
from django.db import migrations, models
|
||||
import django.db.models.deletion
|
||||
|
||||
@ -9,8 +10,9 @@ import django.db.models.deletion
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
|
||||
('stock', '0058_stockitem_packaging'),
|
||||
('users', '0005_owner_model'),
|
||||
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
|
||||
('build', '0026_auto_20210216_1539'),
|
||||
]
|
||||
|
||||
@ -25,6 +27,11 @@ class Migration(migrations.Migration):
|
||||
name='completion_date',
|
||||
field=models.DateField(blank=True, null=True, verbose_name='Completion Date'),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='build',
|
||||
name='creation_date',
|
||||
field=models.DateField(auto_now_add=True, verbose_name='Creation Date'),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='build',
|
||||
name='issued_by',
|
||||
@ -35,6 +42,26 @@ class Migration(migrations.Migration):
|
||||
name='responsible',
|
||||
field=models.ForeignKey(blank=True, help_text='User responsible for this build order', null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='builds_responsible', to='users.Owner', verbose_name='Responsible'),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='builditem',
|
||||
name='build',
|
||||
field=models.ForeignKey(help_text='Build to allocate parts', on_delete=django.db.models.deletion.CASCADE, related_name='allocated_stock', to='build.Build', verbose_name='Build'),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='builditem',
|
||||
name='install_into',
|
||||
field=models.ForeignKey(blank=True, help_text='Destination stock item', limit_choices_to={'is_building': True}, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='items_to_install', to='stock.StockItem', verbose_name='Install into'),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='builditem',
|
||||
name='quantity',
|
||||
field=models.DecimalField(decimal_places=5, default=1, help_text='Stock quantity to allocate to build', max_digits=15, validators=[django.core.validators.MinValueValidator(0)], verbose_name='Quantity'),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='builditem',
|
||||
name='stock_item',
|
||||
field=models.ForeignKey(help_text='Source stock item', limit_choices_to={'belongs_to': None, 'sales_order': None}, on_delete=django.db.models.deletion.CASCADE, related_name='allocations', to='stock.StockItem', verbose_name='Stock Item'),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='buildorderattachment',
|
||||
name='attachment',
|
@ -216,7 +216,7 @@ class Build(MPTTModel):
|
||||
help_text=_('Batch code for this build output')
|
||||
)
|
||||
|
||||
creation_date = models.DateField(auto_now_add=True, editable=False)
|
||||
creation_date = models.DateField(auto_now_add=True, editable=False, verbose_name=_('Creation Date'))
|
||||
|
||||
target_date = models.DateField(
|
||||
null=True, blank=True,
|
||||
@ -1020,14 +1020,14 @@ class BuildItem(models.Model):
|
||||
try:
|
||||
# Allocated part must be in the BOM for the master part
|
||||
if self.stock_item.part not in self.build.part.getRequiredParts(recursive=False):
|
||||
errors['stock_item'] = [_("Selected stock item not found in BOM for part '{p}'".format(p=self.build.part.full_name))]
|
||||
errors['stock_item'] = [_("Selected stock item not found in BOM for part '{p}'").format(p=self.build.part.full_name)]
|
||||
|
||||
# Allocated quantity cannot exceed available stock quantity
|
||||
if self.quantity > self.stock_item.quantity:
|
||||
errors['quantity'] = [_("Allocated quantity ({n}) must not exceed available quantity ({q})".format(
|
||||
errors['quantity'] = [_("Allocated quantity ({n}) must not exceed available quantity ({q})").format(
|
||||
n=normalize(self.quantity),
|
||||
q=normalize(self.stock_item.quantity)
|
||||
))]
|
||||
)]
|
||||
|
||||
# Allocated quantity cannot cause the stock item to be over-allocated
|
||||
if self.stock_item.quantity - self.stock_item.allocation_count() + self.quantity < self.quantity:
|
||||
@ -1079,6 +1079,7 @@ class BuildItem(models.Model):
|
||||
Build,
|
||||
on_delete=models.CASCADE,
|
||||
related_name='allocated_stock',
|
||||
verbose_name=_('Build'),
|
||||
help_text=_('Build to allocate parts')
|
||||
)
|
||||
|
||||
@ -1086,6 +1087,7 @@ class BuildItem(models.Model):
|
||||
'stock.StockItem',
|
||||
on_delete=models.CASCADE,
|
||||
related_name='allocations',
|
||||
verbose_name=_('Stock Item'),
|
||||
help_text=_('Source stock item'),
|
||||
limit_choices_to={
|
||||
'sales_order': None,
|
||||
@ -1098,6 +1100,7 @@ class BuildItem(models.Model):
|
||||
max_digits=15,
|
||||
default=1,
|
||||
validators=[MinValueValidator(0)],
|
||||
verbose_name=_('Quantity'),
|
||||
help_text=_('Stock quantity to allocate to build')
|
||||
)
|
||||
|
||||
@ -1106,6 +1109,7 @@ class BuildItem(models.Model):
|
||||
on_delete=models.SET_NULL,
|
||||
blank=True, null=True,
|
||||
related_name='items_to_install',
|
||||
verbose_name=_('Install into'),
|
||||
help_text=_('Destination stock item'),
|
||||
limit_choices_to={
|
||||
'is_building': True,
|
||||
|
Reference in New Issue
Block a user