Model field

This commit is contained in:
Raphael Michel
2018-08-09 17:18:36 +02:00
parent 0cbacbb959
commit f52447ff58
4 changed files with 29 additions and 0 deletions

View File

@@ -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.'),
),
]

View File

@@ -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,

View File

@@ -321,6 +321,7 @@ class ItemUpdateForm(I18nModelForm):
'available_from',
'available_until',
'require_voucher',
'require_approval',
'hide_without_voucher',
'allow_cancel',
'max_per_order',

View File

@@ -41,6 +41,7 @@
<fieldset>
<legend>{% trans "Additional settings" %}</legend>
{% 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 %}