Fix #473 -- Internal name for categories and products (#900)

* Fix #473 -- Internal name for categories and products

* fix pdf renderer
This commit is contained in:
Raphael Michel
2018-05-11 12:53:25 +02:00
committed by GitHub
parent e678b52a7e
commit edeaa1333b
30 changed files with 152 additions and 55 deletions

View File

@@ -86,13 +86,13 @@ class VoucherForm(I18nModelForm):
itemid, varid = iv.split('-')
i = self.instance.event.items.get(pk=itemid)
v = i.variations.get(pk=varid)
choices.append(('%d-%d' % (i.pk, v.pk), '%s %s' % (i.name, v.value)))
choices.append(('%d-%d' % (i.pk, v.pk), '%s %s' % (str(i), v.value)))
elif iv:
i = self.instance.event.items.get(pk=iv)
if i.variations.exists():
choices.append((str(i.pk), _('{product} Any variation').format(product=i.name)))
choices.append((str(i.pk), _('{product} Any variation').format(product=i)))
else:
choices.append((str(i.pk), str(i.name)))
choices.append((str(i.pk), str(i)))
self.fields['itemvar'].choices = choices
self.fields['itemvar'].widget = Select2ItemVarQuota(