Add sales channels (#1103)

- [x] Data model
- [x] Enforce constraint
- [x] Filter order list
- [x] Set channel on created order
- [x] Products API
- [x] Order API
- [x] Tests
- [x] Filter reports
- [x] Resellers
- [ ] deploy plugins
  - [ ] posbackend
  - [ ] resellers
  - [ ] reports
- [x] Ticketlayouts
- [x] Support in pretixPOS
This commit is contained in:
Raphael Michel
2018-11-23 15:35:09 +01:00
committed by GitHub
parent 0f76779fb1
commit b4290384e1
39 changed files with 472 additions and 57 deletions

View File

@@ -66,7 +66,8 @@ class BadgeLayoutFormTest(SoupTest):
'tax_rate': '19.00',
'active': 'yes',
'allow_cancel': 'yes',
'badgeitem-layout': bl2.pk
'badgeitem-layout': bl2.pk,
'sales_channels': 'web',
})
assert BadgeItem.objects.get(item=self.item1, layout=bl2)
self.client.post('/control/event/%s/%s/items/%d/' % (self.orga1.slug, self.event1.slug, self.item1.id), {
@@ -75,6 +76,7 @@ class BadgeLayoutFormTest(SoupTest):
'tax_rate': '19.00',
'active': 'yes',
'allow_cancel': 'yes',
'sales_channels': 'web',
})
assert not BadgeItem.objects.filter(item=self.item1, layout=bl2).exists()

View File

@@ -29,7 +29,7 @@ RES_LAYOUT = {
'id': 1,
'name': 'Foo',
'default': True,
'item_assignments': [{'item': 1}],
'item_assignments': [{'item': 1, 'sales_channel': 'web'}],
'layout': [{'a': 2}],
'background': None
}

View File

@@ -66,7 +66,8 @@ class TicketLayoutFormTest(SoupTest):
'tax_rate': '19.00',
'active': 'yes',
'allow_cancel': 'yes',
'ticketlayoutitem-layout': bl2.pk
'ticketlayoutitem_web-layout': bl2.pk,
'sales_channels': 'web',
})
assert TicketLayoutItem.objects.get(item=self.item1, layout=bl2)
self.client.post('/control/event/%s/%s/items/%d/' % (self.orga1.slug, self.event1.slug, self.item1.id), {
@@ -75,6 +76,7 @@ class TicketLayoutFormTest(SoupTest):
'tax_rate': '19.00',
'active': 'yes',
'allow_cancel': 'yes',
'sales_channels': 'web',
})
assert not TicketLayoutItem.objects.filter(item=self.item1, layout=bl2).exists()