|
76 | 76 | }, |
77 | 77 | ), |
78 | 78 | ( |
79 | | - 'item', |
| 79 | + 'product', |
80 | 80 | { |
81 | 81 | 'label': _('Product name'), |
82 | 82 | 'editor_sample': _('Sample product'), |
83 | | - 'evaluate': lambda orderposition, order, event: str(orderposition.item.name), |
| 83 | + 'evaluate': lambda orderposition, order, event: str(orderposition.product.name), |
84 | 84 | }, |
85 | 85 | ), |
86 | 86 | ( |
|
92 | 92 | }, |
93 | 93 | ), |
94 | 94 | ( |
95 | | - 'item_description', |
| 95 | + 'product_description', |
96 | 96 | { |
97 | 97 | 'label': _('Product description'), |
98 | 98 | 'editor_sample': _('Sample product description'), |
99 | | - 'evaluate': lambda orderposition, order, event: str(orderposition.item.description), |
| 99 | + 'evaluate': lambda orderposition, order, event: str(orderposition.product.description), |
100 | 100 | }, |
101 | 101 | ), |
102 | 102 | ( |
103 | | - 'itemvar', |
| 103 | + 'productvar', |
104 | 104 | { |
105 | 105 | 'label': _('Product name and variation'), |
106 | 106 | 'editor_sample': _('Sample product – sample variation'), |
107 | 107 | 'evaluate': lambda orderposition, order, event: ( |
108 | | - '{} - {}'.format(orderposition.item.name, orderposition.variation) |
| 108 | + '{} - {}'.format(orderposition.product.name, orderposition.variation) |
109 | 109 | if orderposition.variation |
110 | | - else str(orderposition.item.name) |
| 110 | + else str(orderposition.product.name) |
111 | 111 | ), |
112 | 112 | }, |
113 | 113 | ), |
114 | 114 | ( |
115 | | - 'itemvar_description', |
| 115 | + 'productvar_description', |
116 | 116 | { |
117 | 117 | 'label': _('Product variation description'), |
118 | 118 | 'editor_sample': _('Sample product variation description'), |
119 | 119 | 'evaluate': lambda orderposition, order, event: ( |
120 | 120 | str(orderposition.variation.description) |
121 | 121 | if orderposition.variation |
122 | | - else str(orderposition.item.description) |
| 122 | + else str(orderposition.product.description) |
123 | 123 | ), |
124 | 124 | }, |
125 | 125 | ), |
126 | 126 | ( |
127 | | - 'item_category', |
| 127 | + 'product_category', |
128 | 128 | { |
129 | 129 | 'label': _('Product category'), |
130 | 130 | 'editor_sample': _('Ticket category'), |
131 | 131 | 'evaluate': lambda orderposition, order, event: ( |
132 | | - str(orderposition.item.category.name) if orderposition.item.category else '' |
| 132 | + str(orderposition.product.category.name) if orderposition.product.category else '' |
133 | 133 | ), |
134 | 134 | }, |
135 | 135 | ), |
|
466 | 466 | 'editor_sample': _('Add-on 1\nAdd-on 2'), |
467 | 467 | 'evaluate': lambda op, order, ev: '\n'.join( |
468 | 468 | [ |
469 | | - '{} - {}'.format(p.item, p.variation) if p.variation else str(p.item) |
| 469 | + '{} - {}'.format(p.product, p.variation) if p.variation else str(p.product) |
470 | 470 | for p in ( |
471 | 471 | op.addons.all() |
472 | 472 | if 'addons' in getattr(op, '_prefetched_objects_cache', {}) |
473 | | - else op.addons.select_related('item', 'variation') |
| 473 | + else op.addons.select_related('product', 'variation') |
474 | 474 | ) |
475 | 475 | if not p.canceled |
476 | 476 | ] |
@@ -800,8 +800,8 @@ def _get_text_content(self, op: OrderPosition, order: Order, o: dict, inner=Fals |
800 | 800 | return '(error)' |
801 | 801 | if o['content'] == 'other': |
802 | 802 | return o['text'] |
803 | | - elif o['content'].startswith('itemmeta:'): |
804 | | - return op.item.meta_data.get(o['content'][9:]) or '' |
| 803 | + elif o['content'].startswith('productmeta:'): |
| 804 | + return op.product.meta_data.get(o['content'][12:]) or '' |
805 | 805 | elif o['content'].startswith('meta:'): |
806 | 806 | return ev.meta_data.get(o['content'][5:]) or '' |
807 | 807 | elif o['content'] in self.variables: |
|
0 commit comments