Introduce original price (#905)

* Introduce original price

* Rebase and styling

* Widget
This commit is contained in:
Raphael Michel
2018-05-18 22:48:38 +02:00
committed by GitHub
parent c30ebdf287
commit fa326eba6f
12 changed files with 99 additions and 17 deletions

View File

@@ -226,6 +226,7 @@ class ItemCreateForm(I18nModelForm):
self.instance.max_per_order = self.cleaned_data['copy_from'].max_per_order
self.instance.checkin_attention = self.cleaned_data['copy_from'].checkin_attention
self.instance.free_price = self.cleaned_data['copy_from'].free_price
self.instance.original_price = self.cleaned_data['copy_from'].original_price
self.instance.position = (self.event.items.aggregate(p=Max('position'))['p'] or 0) + 1
instance = super().save(*args, **kwargs)
@@ -325,7 +326,8 @@ class ItemUpdateForm(I18nModelForm):
'allow_cancel',
'max_per_order',
'min_per_order',
'checkin_attention'
'checkin_attention',
'original_price'
]
field_classes = {
'available_from': forms.SplitDateTimeField,

View File

@@ -38,14 +38,13 @@
<legend>{% trans "Check-in" %}</legend>
{% bootstrap_field form.checkin_attention layout="control" %}
</fieldset>
{% if plugin_forms %}
<fieldset>
<legend>{% trans "Additional settings" %}</legend>
{% for f in plugin_forms %}
{% bootstrap_form f layout="control" %}
{% endfor %}
</fieldset>
{% endif %}
<fieldset>
<legend>{% trans "Additional settings" %}</legend>
{% bootstrap_field form.original_price addon_after=request.event.currency layout="control" %}
{% for f in plugin_forms %}
{% bootstrap_form f layout="control" %}
{% endfor %}
</fieldset>
</div>
<div class="col-xs-12 col-lg-2">
<div class="panel panel-default">