Add Item.issue_giftcard

This commit is contained in:
Raphael Michel
2019-09-18 21:25:22 +02:00
parent b07d9d167d
commit 8c50b7409f
7 changed files with 56 additions and 1 deletions

View File

@@ -0,0 +1,20 @@
# Generated by Django 2.2.1 on 2019-09-18 19:10
from django.db import migrations, models
import django.db.models.deletion
import pretix.base.models.fields
class Migration(migrations.Migration):
dependencies = [
('pretixbase', '0137_auto_20190918_1820'),
]
operations = [
migrations.AddField(
model_name='item',
name='issue_giftcard',
field=models.BooleanField(default=False),
),
]

View File

@@ -242,6 +242,8 @@ class Item(LoggedModel):
:type require_approval: bool
:param sales_channels: Sales channels this item is available on.
:type sales_channels: bool
:param issue_giftcard: If ``True``, buying this product will give you a gift card with the value of the product's price
:type issue_giftcard: bool
"""
objects = ItemQuerySetManager()
@@ -413,6 +415,12 @@ class Item(LoggedModel):
verbose_name=_('Sales channels'),
default=['web']
)
issue_giftcard = models.BooleanField(
verbose_name=_('This product is a gift card'),
help_text=_('When a customer buys this product, they will get a gift card with a value corresponding to the '
'product price.'),
default=False
)
# !!! Attention: If you add new fields here, also add them to the copying code in
# pretix/control/forms/item.py if applicable.