Repository: svthalia/concrexit

Issue:
Payment fields not translated in admin
In GitLab by @JobDoesburg on Mar 11, 2020, 19:53

### One-sentence description

Payment fields not translated in admin

### Current behaviour / Reproducing the bug

At (staging.)thalia.nu/admin/payments/payment/*/change, the field names are not translated


### Expected behaviour

They should be translated


Discussion:

Resolving patch:
diff --git a/website/payments/migrations/0007_auto_20200510_2042.py b/website/payments/migrations/0007_auto_20200510_2042.py
new file mode 100644
--- /dev/null
+++ b/website/payments/migrations/0007_auto_20200510_2042.py
@@ -0,0 +1,40 @@
+# Generated by Django 3.0.2 on 2020-05-10 18:42
+
+from django.db import migrations, models
+import django.db.models.deletion
+
+
+class Migration(migrations.Migration):
+
+    dependencies = [
+        ('members', '0037_profile_receive_magazine'),
+        ('payments', '0006_payment_topic'),
+    ]
+
+    operations = [
+        migrations.AlterField(
+            model_name='payment',
+            name='amount',
+            field=models.DecimalField(decimal_places=2, max_digits=5, verbose_name='amount'),
+        ),
+        migrations.AlterField(
+            model_name='payment',
+            name='notes',
+            field=models.TextField(blank=True, null=True, verbose_name='notes'),
+        ),
+        migrations.AlterField(
+            model_name='payment',
+            name='paid_by',
+            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='paid_payment_set', to='members.Member', verbose_name='paid by'),
+        ),
+        migrations.AlterField(
+            model_name='payment',
+            name='processed_by',
+            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='processed_payment_set', to='members.Member', verbose_name='processed by'),
+        ),
+        migrations.AlterField(
+            model_name='payment',
+            name='topic',
+            field=models.CharField(default='Unknown', max_length=255, verbose_name='topic'),
+        ),
+    ]
diff --git a/website/payments/models.py b/website/payments/models.py
--- a/website/payments/models.py
+++ b/website/payments/models.py
@@ -39,7 +39,11 @@ class Payment(models.Model):
     )
 
     amount = models.DecimalField(
-        blank=False, null=False, max_digits=5, decimal_places=2
+        verbose_name=_("amount"),
+        blank=False,
+        null=False,
+        max_digits=5,
+        decimal_places=2,
     )
 
     processing_date = models.DateTimeField(_("processing date"), blank=True, null=True,)
@@ -47,6 +51,7 @@ class Payment(models.Model):
     paid_by = models.ForeignKey(
         "members.Member",
         models.CASCADE,
+        verbose_name=_("paid by"),
         related_name="paid_payment_set",
         blank=False,
         null=True,
@@ -55,13 +60,14 @@ class Payment(models.Model):
     processed_by = models.ForeignKey(
         "members.Member",
         models.CASCADE,
+        verbose_name=_("processed by"),
         related_name="processed_payment_set",
         blank=False,
         null=True,
     )
 
-    notes = models.TextField(blank=True, null=True)
-    topic = models.CharField(max_length=255, default="Unknown")
+    notes = models.TextField(verbose_name=_("notes"), blank=True, null=True)
+    topic = models.CharField(verbose_name=_("topic"), max_length=255, default="Unknown")
 
     @property
     def processed(self):


Test patch: