mirror of
https://github.com/pretix/pretix.git
synced 2026-05-10 16:04:02 +00:00
Add signal: order_split
This commit is contained in:
@@ -20,7 +20,7 @@ Order events
|
|||||||
There are multiple signals that will be sent out in the ordering cycle:
|
There are multiple signals that will be sent out in the ordering cycle:
|
||||||
|
|
||||||
.. automodule:: pretix.base.signals
|
.. automodule:: pretix.base.signals
|
||||||
:members: validate_cart, validate_cart_addons, validate_order, order_fee_calculation, order_paid, order_placed, order_canceled, order_expired, order_modified, order_changed, order_approved, order_denied, order_fee_type_name, allow_ticket_download
|
:members: validate_cart, validate_cart_addons, validate_order, order_fee_calculation, order_paid, order_placed, order_canceled, order_expired, order_modified, order_changed, order_approved, order_denied, order_fee_type_name, allow_ticket_download, order_split
|
||||||
|
|
||||||
Frontend
|
Frontend
|
||||||
--------
|
--------
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ from pretix.base.settings import PERSON_NAME_SCHEMES
|
|||||||
from pretix.base.signals import (
|
from pretix.base.signals import (
|
||||||
allow_ticket_download, order_approved, order_canceled, order_changed,
|
allow_ticket_download, order_approved, order_canceled, order_changed,
|
||||||
order_denied, order_expired, order_fee_calculation, order_placed,
|
order_denied, order_expired, order_fee_calculation, order_placed,
|
||||||
periodic_task, validate_order,
|
order_split, periodic_task, validate_order,
|
||||||
)
|
)
|
||||||
from pretix.celery_app import app
|
from pretix.celery_app import app
|
||||||
from pretix.helpers.models import modelcopy
|
from pretix.helpers.models import modelcopy
|
||||||
@@ -1457,6 +1457,8 @@ class OrderChangeManager:
|
|||||||
|
|
||||||
if split_order.total != Decimal('0.00') and self.order.invoices.filter(is_cancellation=False).last():
|
if split_order.total != Decimal('0.00') and self.order.invoices.filter(is_cancellation=False).last():
|
||||||
generate_invoice(split_order)
|
generate_invoice(split_order)
|
||||||
|
|
||||||
|
order_split.send(sender=self.order.event, original=self.order, split_order=split_order)
|
||||||
return split_order
|
return split_order
|
||||||
|
|
||||||
@cached_property
|
@cached_property
|
||||||
|
|||||||
@@ -556,3 +556,11 @@ into account.
|
|||||||
system really bad.** Also, keep in mind that your response is subject to caching and out-of-date
|
system really bad.** Also, keep in mind that your response is subject to caching and out-of-date
|
||||||
quotas might be used for display (not for actual order processing).
|
quotas might be used for display (not for actual order processing).
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
order_split = EventPluginSignal(
|
||||||
|
providing_args=["original", "split_order"]
|
||||||
|
)
|
||||||
|
"""
|
||||||
|
This signal is sent out when an order is split into two orders and allows you to copy related models
|
||||||
|
to the new order. You will be passed the old order as ``original`` and the new order as ``split_order``.
|
||||||
|
"""
|
||||||
|
|||||||
Reference in New Issue
Block a user