Merge pull request #943 from SchrodingersGat/order-details

Order: Improve help text(s)
This commit is contained in:
Oliver 2020-08-31 19:32:03 +10:00 committed by GitHub
commit fa540c0096
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 44 additions and 8 deletions

View File

@ -0,0 +1,35 @@
# Generated by Django 3.0.7 on 2020-08-31 09:12
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('company', '0023_auto_20200808_0715'),
('order', '0035_auto_20200513_0016'),
]
operations = [
migrations.AlterField(
model_name='purchaseorder',
name='complete_date',
field=models.DateField(blank=True, help_text='Date order was completed', null=True),
),
migrations.AlterField(
model_name='purchaseorder',
name='issue_date',
field=models.DateField(blank=True, help_text='Date order was issued', null=True),
),
migrations.AlterField(
model_name='purchaseorder',
name='supplier',
field=models.ForeignKey(help_text='Company from which the items are being ordered', limit_choices_to={'is_supplier': True}, on_delete=django.db.models.deletion.CASCADE, related_name='purchase_orders', to='company.Company'),
),
migrations.AlterField(
model_name='salesorder',
name='customer',
field=models.ForeignKey(help_text='Company to which the items are being sold', limit_choices_to={'is_customer': True}, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='sales_orders', to='company.Company'),
),
]

View File

@ -137,7 +137,7 @@ class PurchaseOrder(Order):
return "PO {ref} - {company}".format(ref=self.reference, company=self.supplier.name)
status = models.PositiveIntegerField(default=PurchaseOrderStatus.PENDING, choices=PurchaseOrderStatus.items(),
help_text='Purchase order status')
help_text=_('Purchase order status'))
supplier = models.ForeignKey(
Company, on_delete=models.CASCADE,
@ -145,7 +145,7 @@ class PurchaseOrder(Order):
'is_supplier': True,
},
related_name='purchase_orders',
help_text=_('Supplier')
help_text=_('Company from which the items are being ordered')
)
supplier_reference = models.CharField(max_length=64, blank=True, help_text=_("Supplier order reference code"))
@ -157,9 +157,9 @@ class PurchaseOrder(Order):
related_name='+'
)
issue_date = models.DateField(blank=True, null=True)
issue_date = models.DateField(blank=True, null=True, help_text=_('Date order was issued'))
complete_date = models.DateField(blank=True, null=True)
complete_date = models.DateField(blank=True, null=True, help_text=_('Date order was completed'))
def get_absolute_url(self):
return reverse('po-detail', kwargs={'pk': self.id})
@ -311,11 +311,11 @@ class SalesOrder(Order):
null=True,
limit_choices_to={'is_customer': True},
related_name='sales_orders',
help_text=_("Customer"),
help_text=_("Company to which the items are being sold"),
)
status = models.PositiveIntegerField(default=SalesOrderStatus.PENDING, choices=SalesOrderStatus.items(),
help_text='Purchase order status')
help_text=_('Purchase order status'))
customer_reference = models.CharField(max_length=64, blank=True, help_text=_("Customer order reference code"))

View File

@ -127,7 +127,7 @@ class ReportTemplateBase(models.Model):
except TexError:
return TexResponse(rendered, filename="error.tex")
else:
return ValidationError("Enable LaTeX support in config.yaml")
raise ValidationError("Enable LaTeX support in config.yaml")
elif self.extension in ['.htm', '.html']:
# Render HTML template to PDF
wp = WeasyprintReportMixin(request, self.template_name, **kwargs)

View File

@ -23,4 +23,5 @@ rapidfuzz==0.7.6 # Fuzzy string matching
django-stdimage==5.1.1 # Advanced ImageField management
django-tex==1.1.7 # LaTeX PDF export
django-weasyprint==1.0.1 # HTML PDF export
django-debug-toolbar==2.2 # Debug / profiling toolbar
django-debug-toolbar==2.2 # Debug / profiling toolbar
inventree # Install the latest version of the InvenTree API python library