diff --git a/src/pretix/base/migrations/0100_item_require_approval.py b/src/pretix/base/migrations/0100_item_require_approval.py new file mode 100644 index 0000000000..46e9c553b0 --- /dev/null +++ b/src/pretix/base/migrations/0100_item_require_approval.py @@ -0,0 +1,18 @@ +# Generated by Django 2.1 on 2018-08-09 15:17 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('pretixbase', '0099_auto_20180807_0841'), + ] + + operations = [ + migrations.AddField( + model_name='item', + name='require_approval', + field=models.BooleanField(default=False, help_text='If this product is part of an order, the order will be put into an "approval" state and will need to be confirmed by you before it can be paid and completed. You can use this e.g. for discounted tickets that are only available to specific groups.', verbose_name='Buying this product requires approval.'), + ), + ] diff --git a/src/pretix/base/models/items.py b/src/pretix/base/models/items.py index 38bc7d9ffb..745a501979 100644 --- a/src/pretix/base/models/items.py +++ b/src/pretix/base/models/items.py @@ -193,6 +193,8 @@ class Item(LoggedModel): :type checkin_attention: bool :param original_price: The item's "original" price. Will not be used for any calculations, will just be shown. :type original_price: decimal.Decimal + :param require_approval: If set to ``True``, orders containing this product can only be processed and paid after approved by an administrator + :type require_approval: bool """ event = models.ForeignKey( @@ -280,6 +282,13 @@ class Item(LoggedModel): help_text=_('To buy this product, the user needs a voucher that applies to this product ' 'either directly or via a quota.') ) + require_approval = models.BooleanField( + verbose_name=_('Buying this product requires approval.'), + default=False, + help_text=_('If this product is part of an order, the order will be put into an "approval" state and ' + 'will need to be confirmed by you before it can be paid and completed. You can use this e.g. for ' + 'discounted tickets that are only available to specific groups.'), + ) hide_without_voucher = models.BooleanField( verbose_name=_('This product will only be shown if a voucher matching the product is redeemed.'), default=False, diff --git a/src/pretix/control/forms/item.py b/src/pretix/control/forms/item.py index 298702e343..4661b17bd4 100644 --- a/src/pretix/control/forms/item.py +++ b/src/pretix/control/forms/item.py @@ -321,6 +321,7 @@ class ItemUpdateForm(I18nModelForm): 'available_from', 'available_until', 'require_voucher', + 'require_approval', 'hide_without_voucher', 'allow_cancel', 'max_per_order', diff --git a/src/pretix/control/templates/pretixcontrol/item/index.html b/src/pretix/control/templates/pretixcontrol/item/index.html index 07e89d809f..1306a83ab4 100644 --- a/src/pretix/control/templates/pretixcontrol/item/index.html +++ b/src/pretix/control/templates/pretixcontrol/item/index.html @@ -41,6 +41,7 @@
{% trans "Additional settings" %} {% bootstrap_field form.original_price addon_after=request.event.currency layout="control" %} + {% bootstrap_field form.require_approval layout="control" %} {% for f in plugin_forms %} {% bootstrap_form f layout="control" %} {% endfor %}