upstream/2025.7.1 #7

Merged
philipp merged 151 commits from upstream/2025.7.1 into master 2025-09-16 17:03:58 +00:00
2 changed files with 29 additions and 1 deletions
Showing only changes of commit a8f74d87ec - Show all commits

View File

@@ -389,7 +389,7 @@ class RuleForm(FormPlaceholderMixin, I18nModelForm):
choices.insert(0, ('n__pending_approval', _('approval pending')))
if not self.event.settings.get('payment_term_expire_automatically', as_type=bool):
choices.append(
('p__overdue', _('pending with payment overdue'))
('n__pending_overdue', _('pending with payment overdue'))
)
self.fields['restrict_to_status'] = forms.MultipleChoiceField(
label=pgettext_lazy('sendmail_from', 'Restrict to orders with status'),

View File

@@ -0,0 +1,28 @@
# Generated by Django 4.2.15 on 2025-08-01 13:42
from django.db import migrations
def migrate_pending_overdue(apps, schema_editor):
Rule = apps.get_model("sendmail", "Rule")
for r in Rule.objects.filter(restrict_to_status__icontains="p__overdue"):
rts = r.restrict_to_status
rts.remove('p__overdue')
rts.append('n__pending_overdue')
r.restrict_to_status = rts
r.save(update_fields=["restrict_to_status"])
class Migration(migrations.Migration):
dependencies = [
("sendmail", "0009_auto_20241113_1343"),
]
operations = [
migrations.RunPython(
migrate_pending_overdue,
migrations.RunPython.noop,
)
]