mirror of
https://github.com/pretix/pretix.git
synced 2026-05-07 15:34:02 +00:00
Order change: Allow to keep price when changing items
This commit is contained in:
@@ -286,6 +286,7 @@ class OrderPositionChangeForm(forms.Form):
|
||||
('secret', 'Regenerate secret'),
|
||||
)
|
||||
)
|
||||
change_product_keep_price = forms.BooleanField(required=False)
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
instance = kwargs.pop('instance')
|
||||
|
||||
@@ -95,6 +95,10 @@
|
||||
{% trans "Change product to" %}
|
||||
{% bootstrap_field position.form.itemvar layout='inline' %}
|
||||
</label>
|
||||
<label class="checkbox">
|
||||
{{ position.form.change_product_keep_price }}
|
||||
{% trans "Keep price the same" %}
|
||||
</label>
|
||||
</div>
|
||||
{% if request.event.has_subevents %}
|
||||
<div class="radio">
|
||||
|
||||
@@ -1229,7 +1229,7 @@ class OrderChange(OrderView):
|
||||
variation = ItemVariation.objects.get(pk=varid, item=item)
|
||||
else:
|
||||
variation = None
|
||||
ocm.change_item(p, item, variation)
|
||||
ocm.change_item(p, item, variation, keep_price=p.form.cleaned_data['change_product_keep_price'])
|
||||
elif p.form.cleaned_data['operation'] == 'price':
|
||||
ocm.change_price(p, p.form.cleaned_data['price'])
|
||||
elif p.form.cleaned_data['operation'] == 'subevent':
|
||||
|
||||
Reference in New Issue
Block a user