Add "bulk" argument to order_placed signal (#5505)

* datasync: add immediate parameter to enqueue_order

* interactive argument for order_placed signal

The ``interactive`` argument specifies whether the order was
placed interactively, by a customer (as opposed to via a bulk
import or the REST API).

* use bulk=True instead of interactive=False to mark bulk imports
This commit is contained in:
luelista
2025-10-02 09:36:02 +02:00
committed by GitHub
parent 425f4da1f1
commit 9d5563018e
5 changed files with 20 additions and 19 deletions

View File

@@ -54,7 +54,7 @@ def test_sales_channel_all(event, item, order, checkin_list):
mode=AutoCheckinRule.MODE_PLACED,
all_sales_channels=True,
)
order_placed.send(event, order=order)
order_placed.send(event, order=order, bulk=False)
assert order.positions.first().checkins.exists()
@@ -67,12 +67,12 @@ def test_sales_channel_limit(event, item, order, checkin_list):
all_sales_channels=False,
)
order_placed.send(event, order=order)
order_placed.send(event, order=order, bulk=False)
assert not order.positions.first().checkins.exists()
acr.limit_sales_channels.add(order.sales_channel)
order_placed.send(event, order=order)
order_placed.send(event, order=order, bulk=False)
assert order.positions.first().checkins.exists()
@@ -84,7 +84,7 @@ def test_items_all(event, item, order, checkin_list):
mode=AutoCheckinRule.MODE_PLACED,
all_products=True,
)
order_placed.send(event, order=order)
order_placed.send(event, order=order, bulk=False)
assert order.positions.first().checkins.exists()
@@ -97,12 +97,12 @@ def test_items_limit(event, item, order, checkin_list):
all_products=False,
)
order_placed.send(event, order=order)
order_placed.send(event, order=order, bulk=False)
assert not order.positions.first().checkins.exists()
acr.limit_products.add(item)
order_placed.send(event, order=order)
order_placed.send(event, order=order, bulk=False)
assert order.positions.first().checkins.exists()
@@ -124,7 +124,7 @@ def test_variations_limit_mixed_order(event, item, order, checkin_list):
)
acr.limit_variations.add(var)
order_placed.send(event, order=order)
order_placed.send(event, order=order, bulk=False)
assert order.positions.first().checkins.exists()
assert not order.positions.last().checkins.exists()
@@ -143,19 +143,19 @@ def test_variations_limit(event, item, order, checkin_list):
all_products=False,
)
order_placed.send(event, order=order)
order_placed.send(event, order=order, bulk=False)
assert not order.positions.first().checkins.exists()
acr.limit_variations.add(var)
order_placed.send(event, order=order)
order_placed.send(event, order=order, bulk=False)
assert order.positions.first().checkins.exists()
order.positions.first().checkins.all().delete()
acr.limit_products.add(item)
acr.limit_variations.clear()
order_placed.send(event, order=order)
order_placed.send(event, order=order, bulk=False)
assert order.positions.first().checkins.exists()
@@ -170,7 +170,7 @@ def test_mode_placed(event, item, order, checkin_list):
order_paid.send(event, order=order)
assert not order.positions.first().checkins.exists()
order_placed.send(event, order=order)
order_placed.send(event, order=order, bulk=False)
assert order.positions.first().checkins.exists()
@@ -182,7 +182,7 @@ def test_mode_paid(event, item, order, checkin_list):
mode=AutoCheckinRule.MODE_PAID,
)
order_placed.send(event, order=order)
order_placed.send(event, order=order, bulk=False)
assert not order.positions.first().checkins.exists()
order_paid.send(event, order=order)