ソースを参照

Remove/rename several deprecated model fields from order and partner apps.

master
Samir Shah 6年前
コミット
d5d5c9d6fc
36個のファイルの変更543行の追加528行の削除
  1. 16
    0
      docs/source/releases/v3.0.rst
  2. 360
    370
      sandbox/fixtures/child_products.json
  3. 2
    6
      sandbox/fixtures/multi-stockrecord-product.json
  4. 0
    3
      sandbox/fixtures/orders.json
  5. 2
    2
      src/oscar/apps/dashboard/catalogue/forms.py
  6. 0
    12
      src/oscar/apps/order/abstract_models.py
  7. 25
    0
      src/oscar/apps/order/migrations/0010_auto_20200724_0909.py
  8. 0
    5
      src/oscar/apps/order/utils.py
  9. 6
    18
      src/oscar/apps/partner/abstract_models.py
  10. 1
    1
      src/oscar/apps/partner/admin.py
  11. 2
    3
      src/oscar/apps/partner/importers.py
  12. 31
    0
      src/oscar/apps/partner/migrations/0006_auto_20200724_0909.py
  13. 12
    12
      src/oscar/apps/partner/strategy.py
  14. 1
    8
      src/oscar/templates/oscar/checkout/thank_you.html
  15. 1
    3
      src/oscar/templates/oscar/customer/anon_order.html
  16. 0
    2
      src/oscar/templates/oscar/customer/order/order_detail.html
  17. 2
    6
      src/oscar/templates/oscar/dashboard/catalogue/product_update.html
  18. 0
    3
      src/oscar/templates/oscar/dashboard/orders/line_detail.html
  19. 0
    2
      src/oscar/templates/oscar/dashboard/orders/order_detail.html
  20. 1
    1
      src/oscar/test/basket.py
  21. 7
    8
      src/oscar/test/factories/__init__.py
  22. 4
    12
      src/oscar/test/factories/order.py
  23. 1
    1
      src/oscar/test/factories/partner.py
  24. 31
    0
      tests/_site/apps/partner/migrations/0007_auto_20200724_0909.py
  25. 2
    2
      tests/functional/checkout/__init__.py
  26. 1
    1
      tests/functional/dashboard/test_catalogue.py
  27. 1
    1
      tests/functional/test_basket.py
  28. 12
    12
      tests/integration/basket/test_models.py
  29. 1
    1
      tests/integration/partner/test_availability_mixin.py
  30. 1
    1
      tests/integration/partner/test_import.py
  31. 4
    4
      tests/integration/partner/test_models.py
  32. 3
    3
      tests/integration/partner/test_strategy.py
  33. 3
    3
      tests/integration/partner/test_tax_mixin.py
  34. 4
    4
      tests/integration/shipping/test_model_method.py
  35. 2
    6
      tests/unit/fixtures/catalogue.json
  36. 4
    12
      tests/unit/fixtures/productattributes.json

+ 16
- 0
docs/source/releases/v3.0.rst ファイルの表示

@@ -25,6 +25,9 @@ What's new in Oscar 3.0?
25 25
 Backwards incompatible changes
26 26
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
27 27
 
28
+- The ``StockRecord.price_excl_tax`` field has been renamed to ``StockRecord.price``.
29
+  Projects that have forked the ``partner`` app will need to generate their own migration
30
+  to rename this field.
28 31
 
29 32
 Bug fixes
30 33
 ~~~~~~~~~
@@ -33,6 +36,19 @@ Bug fixes
33 36
 Removal of deprecated features
34 37
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
35 38
 
39
+- Several deprecated model fields have been removed in Oscar 3.0:
40
+
41
+   - ``order.Line.est_dispatch_date``
42
+   - ``order.Line.unit_cost_price``
43
+   - ``order.Line.unit_retail_price``
44
+   - ``partner.StockRecord.cost_price``
45
+   - ``partner.StockRecord.price_retail``
46
+
47
+  Oscar ships with migrations that remove these fields. If you want to continue using them,
48
+  please make sure you add the fields back to your forked app before migrating. Projects
49
+  that have forked the ``order`` and ``partner`` apps will need to generate their own
50
+  migrations to remove these fields.
51
+
36 52
 
37 53
 Minor changes
38 54
 ~~~~~~~~~~~~~

+ 360
- 370
sandbox/fixtures/child_products.json ファイルの表示

@@ -1,542 +1,532 @@
1 1
 [
2 2
 {
3
-    "pk": 1, 
4
-    "model": "catalogue.productclass", 
3
+    "pk": 1,
4
+    "model": "catalogue.productclass",
5 5
     "fields": {
6
-        "track_stock": true, 
7
-        "options": [], 
8
-        "requires_shipping": true, 
9
-        "name": "T-shirt", 
6
+        "track_stock": true,
7
+        "options": [],
8
+        "requires_shipping": true,
9
+        "name": "T-shirt",
10 10
         "slug": "t-shirt"
11 11
     }
12 12
 },
13 13
 {
14
-    "pk": 1, 
15
-    "model": "catalogue.category", 
14
+    "pk": 1,
15
+    "model": "catalogue.category",
16 16
     "fields": {
17
-        "description": "", 
18
-        "numchild": 0, 
19
-        "slug": "clothing", 
20
-        "depth": 1, 
17
+        "description": "",
18
+        "numchild": 0,
19
+        "slug": "clothing",
20
+        "depth": 1,
21 21
         "path": "0001",
22
-        "image": "", 
22
+        "image": "",
23 23
         "name": "Clothing"
24 24
     }
25 25
 },
26 26
 {
27
-    "pk": 1, 
28
-    "model": "catalogue.productcategory", 
27
+    "pk": 1,
28
+    "model": "catalogue.productcategory",
29 29
     "fields": {
30
-        "category": 1, 
30
+        "category": 1,
31 31
         "product": 1
32 32
     }
33 33
 },
34 34
 {
35
-    "pk": 2, 
36
-    "model": "catalogue.productcategory", 
35
+    "pk": 2,
36
+    "model": "catalogue.productcategory",
37 37
     "fields": {
38
-        "category": 1, 
38
+        "category": 1,
39 39
         "product": 5
40 40
     }
41 41
 },
42 42
 {
43
-    "pk": 3, 
44
-    "model": "catalogue.productcategory", 
43
+    "pk": 3,
44
+    "model": "catalogue.productcategory",
45 45
     "fields": {
46
-        "category": 1, 
46
+        "category": 1,
47 47
         "product": 8
48 48
     }
49 49
 },
50 50
 {
51
-    "pk": 1, 
52
-    "model": "catalogue.product", 
51
+    "pk": 1,
52
+    "model": "catalogue.product",
53 53
     "fields": {
54
-        "rating": null, 
55
-        "description": "", 
56
-        "parent": null, 
57
-        "title": "Oscar T-shirt", 
58
-        "date_updated": "2013-12-12T16:33:57.426Z", 
59
-        "upc": "", 
60
-        "is_discountable": true, 
61
-        "date_created": "2013-12-12T16:33:57.426Z", 
62
-        "product_options": [], 
63
-        "slug": "oscar-t-shirt", 
54
+        "rating": null,
55
+        "description": "",
56
+        "parent": null,
57
+        "title": "Oscar T-shirt",
58
+        "date_updated": "2013-12-12T16:33:57.426Z",
59
+        "upc": "",
60
+        "is_discountable": true,
61
+        "date_created": "2013-12-12T16:33:57.426Z",
62
+        "product_options": [],
63
+        "slug": "oscar-t-shirt",
64 64
         "product_class": 1,
65 65
         "structure": "parent"
66 66
     }
67 67
 },
68 68
 {
69
-    "pk": 2, 
70
-    "model": "catalogue.product", 
69
+    "pk": 2,
70
+    "model": "catalogue.product",
71 71
     "fields": {
72
-        "rating": null, 
73
-        "description": "", 
74
-        "parent": 1, 
75
-        "title": "", 
76
-        "date_updated": "2013-12-12T16:34:14.023Z", 
77
-        "upc": "", 
78
-        "is_discountable": true, 
79
-        "date_created": "2013-12-12T16:34:14.023Z", 
80
-        "product_options": [], 
81
-        "slug": "oscar-t-shirt", 
72
+        "rating": null,
73
+        "description": "",
74
+        "parent": 1,
75
+        "title": "",
76
+        "date_updated": "2013-12-12T16:34:14.023Z",
77
+        "upc": "",
78
+        "is_discountable": true,
79
+        "date_created": "2013-12-12T16:34:14.023Z",
80
+        "product_options": [],
81
+        "slug": "oscar-t-shirt",
82 82
         "product_class": null,
83 83
         "structure": "child"
84 84
     }
85 85
 },
86 86
 {
87
-    "pk": 3, 
88
-    "model": "catalogue.product", 
87
+    "pk": 3,
88
+    "model": "catalogue.product",
89 89
     "fields": {
90
-        "rating": null, 
91
-        "description": "", 
92
-        "parent": 1, 
93
-        "title": "", 
94
-        "date_updated": "2013-12-12T16:34:32.170Z", 
95
-        "upc": "", 
96
-        "is_discountable": true, 
97
-        "date_created": "2013-12-12T16:34:32.170Z", 
98
-        "product_options": [], 
99
-        "slug": "oscar-t-shirt", 
90
+        "rating": null,
91
+        "description": "",
92
+        "parent": 1,
93
+        "title": "",
94
+        "date_updated": "2013-12-12T16:34:32.170Z",
95
+        "upc": "",
96
+        "is_discountable": true,
97
+        "date_created": "2013-12-12T16:34:32.170Z",
98
+        "product_options": [],
99
+        "slug": "oscar-t-shirt",
100 100
         "product_class": null,
101 101
         "structure": "child"
102 102
     }
103 103
 },
104 104
 {
105
-    "pk": 4, 
106
-    "model": "catalogue.product", 
105
+    "pk": 4,
106
+    "model": "catalogue.product",
107 107
     "fields": {
108
-        "rating": null, 
109
-        "description": "", 
110
-        "parent": 1, 
111
-        "title": "", 
112
-        "date_updated": "2013-12-12T17:32:15.016Z", 
113
-        "upc": "", 
114
-        "is_discountable": true, 
115
-        "date_created": "2013-12-12T17:32:15.016Z", 
116
-        "product_options": [], 
117
-        "slug": "oscar-t-shirt", 
108
+        "rating": null,
109
+        "description": "",
110
+        "parent": 1,
111
+        "title": "",
112
+        "date_updated": "2013-12-12T17:32:15.016Z",
113
+        "upc": "",
114
+        "is_discountable": true,
115
+        "date_created": "2013-12-12T17:32:15.016Z",
116
+        "product_options": [],
117
+        "slug": "oscar-t-shirt",
118 118
         "product_class": null,
119 119
         "structure": "child"
120 120
     }
121 121
 },
122 122
 {
123
-    "pk": 5, 
124
-    "model": "catalogue.product", 
123
+    "pk": 5,
124
+    "model": "catalogue.product",
125 125
     "fields": {
126
-        "rating": null, 
127
-        "description": "", 
128
-        "parent": null, 
129
-        "title": "commandlinefu T-shirt", 
130
-        "date_updated": "2013-12-13T11:34:21.810Z", 
131
-        "upc": "", 
132
-        "is_discountable": true, 
133
-        "date_created": "2013-12-13T11:34:21.810Z", 
134
-        "product_options": [], 
135
-        "slug": "commandlinefu-t-shirt", 
126
+        "rating": null,
127
+        "description": "",
128
+        "parent": null,
129
+        "title": "commandlinefu T-shirt",
130
+        "date_updated": "2013-12-13T11:34:21.810Z",
131
+        "upc": "",
132
+        "is_discountable": true,
133
+        "date_created": "2013-12-13T11:34:21.810Z",
134
+        "product_options": [],
135
+        "slug": "commandlinefu-t-shirt",
136 136
         "product_class": 1,
137 137
         "structure": "parent"
138 138
     }
139 139
 },
140 140
 {
141
-    "pk": 6, 
142
-    "model": "catalogue.product", 
141
+    "pk": 6,
142
+    "model": "catalogue.product",
143 143
     "fields": {
144
-        "rating": null, 
145
-        "description": "", 
146
-        "parent": 5, 
147
-        "title": "", 
148
-        "date_updated": "2013-12-13T11:37:08.138Z", 
149
-        "upc": "", 
150
-        "is_discountable": true, 
151
-        "date_created": "2013-12-13T11:37:08.138Z", 
152
-        "product_options": [], 
153
-        "slug": "commandlinefu-t-shirt", 
144
+        "rating": null,
145
+        "description": "",
146
+        "parent": 5,
147
+        "title": "",
148
+        "date_updated": "2013-12-13T11:37:08.138Z",
149
+        "upc": "",
150
+        "is_discountable": true,
151
+        "date_created": "2013-12-13T11:37:08.138Z",
152
+        "product_options": [],
153
+        "slug": "commandlinefu-t-shirt",
154 154
         "product_class": null,
155 155
         "structure": "child"
156 156
     }
157 157
 },
158 158
 {
159
-    "pk": 7, 
160
-    "model": "catalogue.product", 
159
+    "pk": 7,
160
+    "model": "catalogue.product",
161 161
     "fields": {
162
-        "rating": null, 
163
-        "description": "", 
164
-        "parent": 5, 
165
-        "title": "", 
166
-        "date_updated": "2013-12-13T11:37:45.834Z", 
167
-        "upc": "", 
168
-        "is_discountable": true, 
169
-        "date_created": "2013-12-13T11:37:45.834Z", 
170
-        "product_options": [], 
171
-        "slug": "commandlinefu-t-shirt", 
162
+        "rating": null,
163
+        "description": "",
164
+        "parent": 5,
165
+        "title": "",
166
+        "date_updated": "2013-12-13T11:37:45.834Z",
167
+        "upc": "",
168
+        "is_discountable": true,
169
+        "date_created": "2013-12-13T11:37:45.834Z",
170
+        "product_options": [],
171
+        "slug": "commandlinefu-t-shirt",
172 172
         "product_class": null,
173 173
         "structure": "child"
174 174
     }
175 175
 },
176 176
 {
177
-    "pk": 8, 
178
-    "model": "catalogue.product", 
177
+    "pk": 8,
178
+    "model": "catalogue.product",
179 179
     "fields": {
180
-        "rating": null, 
181
-        "description": "", 
182
-        "parent": null, 
180
+        "rating": null,
181
+        "description": "",
182
+        "parent": null,
183 183
         "title": "Django T-shirt",
184
-        "date_updated": "2013-12-13T11:38:15.107Z", 
185
-        "upc": "", 
186
-        "is_discountable": true, 
187
-        "date_created": "2013-12-13T11:38:15.107Z", 
188
-        "product_options": [], 
184
+        "date_updated": "2013-12-13T11:38:15.107Z",
185
+        "upc": "",
186
+        "is_discountable": true,
187
+        "date_created": "2013-12-13T11:38:15.107Z",
188
+        "product_options": [],
189 189
         "slug": "django-t-shirt",
190 190
         "product_class": 1,
191 191
         "structure": "parent"
192 192
     }
193 193
 },
194 194
 {
195
-    "pk": 9, 
196
-    "model": "catalogue.product", 
195
+    "pk": 9,
196
+    "model": "catalogue.product",
197 197
     "fields": {
198
-        "rating": null, 
199
-        "description": "", 
200
-        "parent": 8, 
201
-        "title": "", 
202
-        "date_updated": "2013-12-13T11:38:49.769Z", 
203
-        "upc": "", 
204
-        "is_discountable": true, 
205
-        "date_created": "2013-12-13T11:38:49.769Z", 
206
-        "product_options": [], 
198
+        "rating": null,
199
+        "description": "",
200
+        "parent": 8,
201
+        "title": "",
202
+        "date_updated": "2013-12-13T11:38:49.769Z",
203
+        "upc": "",
204
+        "is_discountable": true,
205
+        "date_created": "2013-12-13T11:38:49.769Z",
206
+        "product_options": [],
207 207
         "slug": "django-t-shirt",
208 208
         "product_class": null,
209 209
         "structure": "child"
210 210
     }
211 211
 },
212 212
 {
213
-    "pk": 10, 
214
-    "model": "catalogue.product", 
213
+    "pk": 10,
214
+    "model": "catalogue.product",
215 215
     "fields": {
216
-        "rating": null, 
217
-        "description": "", 
218
-        "parent": 8, 
219
-        "title": "", 
220
-        "date_updated": "2013-12-13T11:39:12.859Z", 
221
-        "upc": "", 
222
-        "is_discountable": true, 
223
-        "date_created": "2013-12-13T11:39:12.859Z", 
224
-        "product_options": [], 
216
+        "rating": null,
217
+        "description": "",
218
+        "parent": 8,
219
+        "title": "",
220
+        "date_updated": "2013-12-13T11:39:12.859Z",
221
+        "upc": "",
222
+        "is_discountable": true,
223
+        "date_created": "2013-12-13T11:39:12.859Z",
224
+        "product_options": [],
225 225
         "slug": "django-t-shirt",
226 226
         "product_class": null,
227 227
         "structure": "child"
228 228
     }
229 229
 },
230 230
 {
231
-    "pk": 11, 
232
-    "model": "catalogue.product", 
231
+    "pk": 11,
232
+    "model": "catalogue.product",
233 233
     "fields": {
234
-        "rating": null, 
235
-        "description": "", 
236
-        "parent": 8, 
237
-        "title": "", 
238
-        "date_updated": "2013-12-13T11:39:53.073Z", 
239
-        "upc": "", 
240
-        "is_discountable": true, 
241
-        "date_created": "2013-12-13T11:39:53.073Z", 
242
-        "product_options": [], 
234
+        "rating": null,
235
+        "description": "",
236
+        "parent": 8,
237
+        "title": "",
238
+        "date_updated": "2013-12-13T11:39:53.073Z",
239
+        "upc": "",
240
+        "is_discountable": true,
241
+        "date_created": "2013-12-13T11:39:53.073Z",
242
+        "product_options": [],
243 243
         "slug": "django-t-shirt",
244 244
         "product_class": null,
245 245
         "structure": "child"
246 246
     }
247 247
 },
248 248
 {
249
-    "pk": 1, 
250
-    "model": "catalogue.productattribute", 
249
+    "pk": 1,
250
+    "model": "catalogue.productattribute",
251 251
     "fields": {
252
-        "required": true, 
253
-        "product_class": 1, 
254
-        "option_group": 1, 
255
-        "code": "size", 
256
-        "type": "option", 
252
+        "required": true,
253
+        "product_class": 1,
254
+        "option_group": 1,
255
+        "code": "size",
256
+        "type": "option",
257 257
         "name": "Size"
258 258
     }
259 259
 },
260 260
 {
261
-    "pk": 1, 
262
-    "model": "catalogue.productattributevalue", 
261
+    "pk": 1,
262
+    "model": "catalogue.productattributevalue",
263 263
     "fields": {
264
-        "value_date": null, 
265
-        "value_integer": null, 
266
-        "product": 2, 
267
-        "value_float": null, 
268
-        "entity_content_type": null, 
269
-        "value_text": null, 
270
-        "attribute": 1, 
271
-        "value_richtext": null, 
272
-        "entity_object_id": null, 
273
-        "value_image": "", 
274
-        "value_option": 1, 
275
-        "value_boolean": null, 
264
+        "value_date": null,
265
+        "value_integer": null,
266
+        "product": 2,
267
+        "value_float": null,
268
+        "entity_content_type": null,
269
+        "value_text": null,
270
+        "attribute": 1,
271
+        "value_richtext": null,
272
+        "entity_object_id": null,
273
+        "value_image": "",
274
+        "value_option": 1,
275
+        "value_boolean": null,
276 276
         "value_file": ""
277 277
     }
278 278
 },
279 279
 {
280
-    "pk": 2, 
281
-    "model": "catalogue.productattributevalue", 
280
+    "pk": 2,
281
+    "model": "catalogue.productattributevalue",
282 282
     "fields": {
283
-        "value_date": null, 
284
-        "value_integer": null, 
285
-        "product": 3, 
286
-        "value_float": null, 
287
-        "entity_content_type": null, 
288
-        "value_text": null, 
289
-        "attribute": 1, 
290
-        "value_richtext": null, 
291
-        "entity_object_id": null, 
292
-        "value_image": "", 
293
-        "value_option": 2, 
294
-        "value_boolean": null, 
283
+        "value_date": null,
284
+        "value_integer": null,
285
+        "product": 3,
286
+        "value_float": null,
287
+        "entity_content_type": null,
288
+        "value_text": null,
289
+        "attribute": 1,
290
+        "value_richtext": null,
291
+        "entity_object_id": null,
292
+        "value_image": "",
293
+        "value_option": 2,
294
+        "value_boolean": null,
295 295
         "value_file": ""
296 296
     }
297 297
 },
298 298
 {
299
-    "pk": 3, 
300
-    "model": "catalogue.productattributevalue", 
299
+    "pk": 3,
300
+    "model": "catalogue.productattributevalue",
301 301
     "fields": {
302
-        "value_date": null, 
303
-        "value_integer": null, 
304
-        "product": 4, 
305
-        "value_float": null, 
306
-        "entity_content_type": null, 
307
-        "value_text": null, 
308
-        "attribute": 1, 
309
-        "value_richtext": null, 
310
-        "entity_object_id": null, 
311
-        "value_image": "", 
312
-        "value_option": 3, 
313
-        "value_boolean": null, 
302
+        "value_date": null,
303
+        "value_integer": null,
304
+        "product": 4,
305
+        "value_float": null,
306
+        "entity_content_type": null,
307
+        "value_text": null,
308
+        "attribute": 1,
309
+        "value_richtext": null,
310
+        "entity_object_id": null,
311
+        "value_image": "",
312
+        "value_option": 3,
313
+        "value_boolean": null,
314 314
         "value_file": ""
315 315
     }
316 316
 },
317 317
 {
318
-    "pk": 4, 
319
-    "model": "catalogue.productattributevalue", 
318
+    "pk": 4,
319
+    "model": "catalogue.productattributevalue",
320 320
     "fields": {
321
-        "value_date": null, 
322
-        "value_integer": null, 
323
-        "product": 6, 
324
-        "value_float": null, 
325
-        "entity_content_type": null, 
326
-        "value_text": null, 
327
-        "attribute": 1, 
328
-        "value_richtext": null, 
329
-        "entity_object_id": null, 
330
-        "value_image": "", 
331
-        "value_option": 1, 
332
-        "value_boolean": null, 
321
+        "value_date": null,
322
+        "value_integer": null,
323
+        "product": 6,
324
+        "value_float": null,
325
+        "entity_content_type": null,
326
+        "value_text": null,
327
+        "attribute": 1,
328
+        "value_richtext": null,
329
+        "entity_object_id": null,
330
+        "value_image": "",
331
+        "value_option": 1,
332
+        "value_boolean": null,
333 333
         "value_file": ""
334 334
     }
335 335
 },
336 336
 {
337
-    "pk": 5, 
338
-    "model": "catalogue.productattributevalue", 
337
+    "pk": 5,
338
+    "model": "catalogue.productattributevalue",
339 339
     "fields": {
340
-        "value_date": null, 
341
-        "value_integer": null, 
342
-        "product": 7, 
343
-        "value_float": null, 
344
-        "entity_content_type": null, 
345
-        "value_text": null, 
346
-        "attribute": 1, 
347
-        "value_richtext": null, 
348
-        "entity_object_id": null, 
349
-        "value_image": "", 
350
-        "value_option": 2, 
351
-        "value_boolean": null, 
340
+        "value_date": null,
341
+        "value_integer": null,
342
+        "product": 7,
343
+        "value_float": null,
344
+        "entity_content_type": null,
345
+        "value_text": null,
346
+        "attribute": 1,
347
+        "value_richtext": null,
348
+        "entity_object_id": null,
349
+        "value_image": "",
350
+        "value_option": 2,
351
+        "value_boolean": null,
352 352
         "value_file": ""
353 353
     }
354 354
 },
355 355
 {
356
-    "pk": 6, 
357
-    "model": "catalogue.productattributevalue", 
356
+    "pk": 6,
357
+    "model": "catalogue.productattributevalue",
358 358
     "fields": {
359
-        "value_date": null, 
360
-        "value_integer": null, 
361
-        "product": 9, 
362
-        "value_float": null, 
363
-        "entity_content_type": null, 
364
-        "value_text": null, 
365
-        "attribute": 1, 
366
-        "value_richtext": null, 
367
-        "entity_object_id": null, 
368
-        "value_image": "", 
369
-        "value_option": 1, 
370
-        "value_boolean": null, 
359
+        "value_date": null,
360
+        "value_integer": null,
361
+        "product": 9,
362
+        "value_float": null,
363
+        "entity_content_type": null,
364
+        "value_text": null,
365
+        "attribute": 1,
366
+        "value_richtext": null,
367
+        "entity_object_id": null,
368
+        "value_image": "",
369
+        "value_option": 1,
370
+        "value_boolean": null,
371 371
         "value_file": ""
372 372
     }
373 373
 },
374 374
 {
375
-    "pk": 7, 
376
-    "model": "catalogue.productattributevalue", 
375
+    "pk": 7,
376
+    "model": "catalogue.productattributevalue",
377 377
     "fields": {
378
-        "value_date": null, 
379
-        "value_integer": null, 
380
-        "product": 10, 
381
-        "value_float": null, 
382
-        "entity_content_type": null, 
383
-        "value_text": null, 
384
-        "attribute": 1, 
385
-        "value_richtext": null, 
386
-        "entity_object_id": null, 
387
-        "value_image": "", 
388
-        "value_option": 2, 
389
-        "value_boolean": null, 
378
+        "value_date": null,
379
+        "value_integer": null,
380
+        "product": 10,
381
+        "value_float": null,
382
+        "entity_content_type": null,
383
+        "value_text": null,
384
+        "attribute": 1,
385
+        "value_richtext": null,
386
+        "entity_object_id": null,
387
+        "value_image": "",
388
+        "value_option": 2,
389
+        "value_boolean": null,
390 390
         "value_file": ""
391 391
     }
392 392
 },
393 393
 {
394
-    "pk": 8, 
395
-    "model": "catalogue.productattributevalue", 
394
+    "pk": 8,
395
+    "model": "catalogue.productattributevalue",
396 396
     "fields": {
397
-        "value_date": null, 
398
-        "value_integer": null, 
399
-        "product": 11, 
400
-        "value_float": null, 
401
-        "entity_content_type": null, 
402
-        "value_text": null, 
403
-        "attribute": 1, 
404
-        "value_richtext": null, 
405
-        "entity_object_id": null, 
406
-        "value_image": "", 
407
-        "value_option": 3, 
408
-        "value_boolean": null, 
397
+        "value_date": null,
398
+        "value_integer": null,
399
+        "product": 11,
400
+        "value_float": null,
401
+        "entity_content_type": null,
402
+        "value_text": null,
403
+        "attribute": 1,
404
+        "value_richtext": null,
405
+        "entity_object_id": null,
406
+        "value_image": "",
407
+        "value_option": 3,
408
+        "value_boolean": null,
409 409
         "value_file": ""
410 410
     }
411 411
 },
412 412
 {
413
-    "pk": 1, 
414
-    "model": "catalogue.attributeoptiongroup", 
413
+    "pk": 1,
414
+    "model": "catalogue.attributeoptiongroup",
415 415
     "fields": {
416 416
         "name": "Sizes"
417 417
     }
418 418
 },
419 419
 {
420
-    "pk": 1, 
421
-    "model": "catalogue.attributeoption", 
420
+    "pk": 1,
421
+    "model": "catalogue.attributeoption",
422 422
     "fields": {
423
-        "group": 1, 
423
+        "group": 1,
424 424
         "option": "Small"
425 425
     }
426 426
 },
427 427
 {
428
-    "pk": 2, 
429
-    "model": "catalogue.attributeoption", 
428
+    "pk": 2,
429
+    "model": "catalogue.attributeoption",
430 430
     "fields": {
431
-        "group": 1, 
431
+        "group": 1,
432 432
         "option": "Medium"
433 433
     }
434 434
 },
435 435
 {
436
-    "pk": 3, 
437
-    "model": "catalogue.attributeoption", 
436
+    "pk": 3,
437
+    "model": "catalogue.attributeoption",
438 438
     "fields": {
439
-        "group": 1, 
439
+        "group": 1,
440 440
         "option": "Large"
441 441
     }
442 442
 },
443 443
 {
444
-    "pk": 2, 
445
-    "model": "partner.partner", 
444
+    "pk": 2,
445
+    "model": "partner.partner",
446 446
     "fields": {
447
-        "code": "clothing-partner", 
448
-        "name": "Clothing partner", 
447
+        "code": "clothing-partner",
448
+        "name": "Clothing partner",
449 449
         "users": []
450 450
     }
451 451
 },
452 452
 {
453
-    "pk": 1, 
454
-    "model": "partner.stockrecord", 
455
-    "fields": {
456
-        "price_currency": "GBP", 
457
-        "product": 6, 
458
-        "partner_sku": "clf-large", 
459
-        "price_retail": null, 
460
-        "date_updated": "2013-12-13T11:37:08.232Z", 
461
-        "num_in_stock": 0, 
462
-        "num_allocated": null, 
463
-        "low_stock_threshold": null, 
464
-        "date_created": "2013-12-13T11:37:08.232Z", 
465
-        "partner": 2, 
466
-        "price_excl_tax": "10", 
467
-        "cost_price": null
468
-    }
469
-},
470
-{
471
-    "pk": 2, 
472
-    "model": "partner.stockrecord", 
473
-    "fields": {
474
-        "price_currency": "GBP", 
475
-        "product": 7, 
476
-        "partner_sku": "clf-med", 
477
-        "price_retail": null, 
478
-        "date_updated": "2013-12-13T11:37:45.928Z", 
479
-        "num_in_stock": 0, 
480
-        "num_allocated": null, 
481
-        "low_stock_threshold": null, 
482
-        "date_created": "2013-12-13T11:37:45.928Z", 
483
-        "partner": 2, 
484
-        "price_excl_tax": "10", 
485
-        "cost_price": null
486
-    }
487
-},
488
-{
489
-    "pk": 3, 
490
-    "model": "partner.stockrecord", 
491
-    "fields": {
492
-        "price_currency": "GBP", 
493
-        "product": 9, 
494
-        "partner_sku": "tng-small", 
495
-        "price_retail": null, 
496
-        "date_updated": "2013-12-13T11:38:49.858Z", 
497
-        "num_in_stock": 100, 
498
-        "num_allocated": null, 
499
-        "low_stock_threshold": null, 
500
-        "date_created": "2013-12-13T11:38:49.858Z", 
501
-        "partner": 2, 
502
-        "price_excl_tax": "15", 
503
-        "cost_price": null
504
-    }
505
-},
506
-{
507
-    "pk": 4, 
508
-    "model": "partner.stockrecord", 
509
-    "fields": {
510
-        "price_currency": "GBP", 
511
-        "product": 10, 
512
-        "partner_sku": "tng-med", 
513
-        "price_retail": null, 
514
-        "date_updated": "2013-12-13T11:39:12.947Z", 
515
-        "num_in_stock": 200, 
516
-        "num_allocated": null, 
517
-        "low_stock_threshold": null, 
518
-        "date_created": "2013-12-13T11:39:12.947Z", 
519
-        "partner": 2, 
520
-        "price_excl_tax": "15", 
521
-        "cost_price": null
522
-    }
523
-},
524
-{
525
-    "pk": 5, 
526
-    "model": "partner.stockrecord", 
527
-    "fields": {
528
-        "price_currency": "GBP", 
529
-        "product": 11, 
530
-        "partner_sku": "tng-large", 
531
-        "price_retail": null, 
532
-        "date_updated": "2013-12-13T11:39:53.162Z", 
533
-        "num_in_stock": 0, 
534
-        "num_allocated": null, 
535
-        "low_stock_threshold": null, 
536
-        "date_created": "2013-12-13T11:39:53.162Z", 
537
-        "partner": 2, 
538
-        "price_excl_tax": "15", 
539
-        "cost_price": null
453
+    "pk": 1,
454
+    "model": "partner.stockrecord",
455
+    "fields": {
456
+        "price_currency": "GBP",
457
+        "product": 6,
458
+        "partner_sku": "clf-large",
459
+        "date_updated": "2013-12-13T11:37:08.232Z",
460
+        "num_in_stock": 0,
461
+        "num_allocated": null,
462
+        "low_stock_threshold": null,
463
+        "date_created": "2013-12-13T11:37:08.232Z",
464
+        "partner": 2,
465
+        "price": "10"
466
+    }
467
+},
468
+{
469
+    "pk": 2,
470
+    "model": "partner.stockrecord",
471
+    "fields": {
472
+        "price_currency": "GBP",
473
+        "product": 7,
474
+        "partner_sku": "clf-med",
475
+        "date_updated": "2013-12-13T11:37:45.928Z",
476
+        "num_in_stock": 0,
477
+        "num_allocated": null,
478
+        "low_stock_threshold": null,
479
+        "date_created": "2013-12-13T11:37:45.928Z",
480
+        "partner": 2,
481
+        "price": "10"
482
+    }
483
+},
484
+{
485
+    "pk": 3,
486
+    "model": "partner.stockrecord",
487
+    "fields": {
488
+        "price_currency": "GBP",
489
+        "product": 9,
490
+        "partner_sku": "tng-small",
491
+        "date_updated": "2013-12-13T11:38:49.858Z",
492
+        "num_in_stock": 100,
493
+        "num_allocated": null,
494
+        "low_stock_threshold": null,
495
+        "date_created": "2013-12-13T11:38:49.858Z",
496
+        "partner": 2,
497
+        "price": "15"
498
+    }
499
+},
500
+{
501
+    "pk": 4,
502
+    "model": "partner.stockrecord",
503
+    "fields": {
504
+        "price_currency": "GBP",
505
+        "product": 10,
506
+        "partner_sku": "tng-med",
507
+        "date_updated": "2013-12-13T11:39:12.947Z",
508
+        "num_in_stock": 200,
509
+        "num_allocated": null,
510
+        "low_stock_threshold": null,
511
+        "date_created": "2013-12-13T11:39:12.947Z",
512
+        "partner": 2,
513
+        "price": "15"
514
+    }
515
+},
516
+{
517
+    "pk": 5,
518
+    "model": "partner.stockrecord",
519
+    "fields": {
520
+        "price_currency": "GBP",
521
+        "product": 11,
522
+        "partner_sku": "tng-large",
523
+        "date_updated": "2013-12-13T11:39:53.162Z",
524
+        "num_in_stock": 0,
525
+        "num_allocated": null,
526
+        "low_stock_threshold": null,
527
+        "date_created": "2013-12-13T11:39:53.162Z",
528
+        "partner": 2,
529
+        "price": "15"
540 530
     }
541 531
 }
542 532
 ]

+ 2
- 6
sandbox/fixtures/multi-stockrecord-product.json ファイルの表示

@@ -81,15 +81,13 @@
81 81
         "price_currency": "GBP",
82 82
         "product": 1,
83 83
         "partner_sku": "a1",
84
-        "price_retail": null,
85 84
         "date_updated": "2013-07-18T12:25:41.107Z",
86 85
         "num_in_stock": 5,
87 86
         "num_allocated": null,
88 87
         "low_stock_threshold": null,
89 88
         "date_created": "2013-07-18T12:25:41.107Z",
90 89
         "partner": 1,
91
-        "price_excl_tax": "20",
92
-        "cost_price": null
90
+        "price": "20"
93 91
     }
94 92
 },
95 93
 {
@@ -99,15 +97,13 @@
99 97
         "price_currency": "GBP",
100 98
         "product": 1,
101 99
         "partner_sku": "a2",
102
-        "price_retail": null,
103 100
         "date_updated": "2013-07-18T12:25:49.939Z",
104 101
         "num_in_stock": 15,
105 102
         "num_allocated": null,
106 103
         "low_stock_threshold": null,
107 104
         "date_created": "2013-07-18T12:25:49.939Z",
108 105
         "partner": 1,
109
-        "price_excl_tax": "10",
110
-        "cost_price": null
106
+        "price": "10"
111 107
     }
112 108
 }
113 109
 ]

+ 0
- 3
sandbox/fixtures/orders.json ファイルの表示

@@ -47,7 +47,6 @@
47 47
         "stockrecord": 6,
48 48
         "partner_sku": "9780553380958",
49 49
         "line_price_excl_tax": "7.99",
50
-        "unit_retail_price": null,
51 50
         "partner_line_reference": "",
52 51
         "partner_name": "Book partner",
53 52
         "line_price_incl_tax": "7.99",
@@ -56,10 +55,8 @@
56 55
         "line_price_before_discounts_excl_tax": "7.99",
57 56
         "upc": "9780553380958",
58 57
         "line_price_before_discounts_incl_tax": "7.99",
59
-        "est_dispatch_date": null,
60 58
         "partner_line_notes": "",
61 59
         "unit_price_incl_tax": "7.99",
62
-        "unit_cost_price": null,
63 60
         "partner": 3,
64 61
         "order": 1,
65 62
         "quantity": 1

+ 2
- 2
src/oscar/apps/dashboard/catalogue/forms.py ファイルの表示

@@ -80,7 +80,7 @@ class StockRecordForm(forms.ModelForm):
80 80
                 if field_name in self.fields:
81 81
                     del self.fields[field_name]
82 82
         else:
83
-            for field_name in ['price_excl_tax', 'num_in_stock']:
83
+            for field_name in ['price', 'num_in_stock']:
84 84
                 if field_name in self.fields:
85 85
                     self.fields[field_name].required = True
86 86
 
@@ -88,7 +88,7 @@ class StockRecordForm(forms.ModelForm):
88 88
         model = StockRecord
89 89
         fields = [
90 90
             'partner', 'partner_sku',
91
-            'price_currency', 'price_excl_tax', 'price_retail', 'cost_price',
91
+            'price_currency', 'price',
92 92
             'num_in_stock', 'low_stock_threshold',
93 93
         ]
94 94
 

+ 0
- 12
src/oscar/apps/order/abstract_models.py ファイルの表示

@@ -543,10 +543,6 @@ class AbstractLine(models.Model):
543 543
         _("Price before discounts (excl. tax)"),
544 544
         decimal_places=2, max_digits=12)
545 545
 
546
-    # Deprecated - will be removed in Oscar 2.1
547
-    unit_cost_price = models.DecimalField(
548
-        _("Unit Cost Price"), decimal_places=2, max_digits=12, blank=True,
549
-        null=True)
550 546
     # Normal site price for item (without discounts)
551 547
     unit_price_incl_tax = models.DecimalField(
552 548
         _("Unit Price (inc. tax)"), decimal_places=2, max_digits=12,
@@ -554,19 +550,11 @@ class AbstractLine(models.Model):
554 550
     unit_price_excl_tax = models.DecimalField(
555 551
         _("Unit Price (excl. tax)"), decimal_places=2, max_digits=12,
556 552
         blank=True, null=True)
557
-    # Deprecated - will be removed in Oscar 2.1
558
-    unit_retail_price = models.DecimalField(
559
-        _("Unit Retail Price"), decimal_places=2, max_digits=12,
560
-        blank=True, null=True)
561 553
 
562 554
     # Partners often want to assign some status to each line to help with their
563 555
     # own business processes.
564 556
     status = models.CharField(_("Status"), max_length=255, blank=True)
565 557
 
566
-    # Deprecated - will be removed in Oscar 2.1
567
-    est_dispatch_date = models.DateField(
568
-        _("Estimated Dispatch Date"), blank=True, null=True)
569
-
570 558
     #: Order status pipeline.  This should be a dict where each (key, value)
571 559
     #: corresponds to a status and the possible statuses that can follow that
572 560
     #: one.

+ 25
- 0
src/oscar/apps/order/migrations/0010_auto_20200724_0909.py ファイルの表示

@@ -0,0 +1,25 @@
1
+# Generated by Django 2.2.10 on 2020-07-24 08:09
2
+
3
+from django.db import migrations
4
+
5
+
6
+class Migration(migrations.Migration):
7
+
8
+    dependencies = [
9
+        ('order', '0009_surcharge'),
10
+    ]
11
+
12
+    operations = [
13
+        migrations.RemoveField(
14
+            model_name='line',
15
+            name='est_dispatch_date',
16
+        ),
17
+        migrations.RemoveField(
18
+            model_name='line',
19
+            name='unit_cost_price',
20
+        ),
21
+        migrations.RemoveField(
22
+            model_name='line',
23
+            name='unit_retail_price',
24
+        ),
25
+    ]

+ 0
- 5
src/oscar/apps/order/utils.py ファイルの表示

@@ -179,13 +179,8 @@ class OrderCreator(object):
179 179
             'line_price_before_discounts_incl_tax':
180 180
             basket_line.line_price_incl_tax,
181 181
             # Reporting details
182
-            'unit_cost_price': stockrecord.cost_price,
183 182
             'unit_price_incl_tax': basket_line.unit_price_incl_tax,
184 183
             'unit_price_excl_tax': basket_line.unit_price_excl_tax,
185
-            'unit_retail_price': stockrecord.price_retail,
186
-            # Shipping details
187
-            'est_dispatch_date':
188
-            basket_line.purchase_info.availability.dispatch_date
189 184
         }
190 185
         extra_line_fields = extra_line_fields or {}
191 186
         if hasattr(settings, 'OSCAR_INITIAL_LINE_STATUS'):

+ 6
- 18
src/oscar/apps/partner/abstract_models.py ファイルの表示

@@ -109,24 +109,12 @@ class AbstractStockRecord(models.Model):
109 109
     price_currency = models.CharField(
110 110
         _("Currency"), max_length=12, default=get_default_currency)
111 111
 
112
-    # This is the base price for calculations - tax should be applied by the
113
-    # appropriate method.  We don't store tax here as its calculation is highly
114
-    # domain-specific.  It is NULLable because some items don't have a fixed
115
-    # price but require a runtime calculation (possible from an external
116
-    # service). Current field name `price_excl_tax` is deprecated and will be
117
-    # renamed into `price` in Oscar 2.1.
118
-    price_excl_tax = models.DecimalField(
119
-        _("Price (excl. tax)"), decimal_places=2, max_digits=12,
120
-        blank=True, null=True)
121
-
122
-    # Deprecated - will be removed in Oscar 2.1
123
-    price_retail = models.DecimalField(
124
-        _("Price (retail)"), decimal_places=2, max_digits=12,
125
-        blank=True, null=True)
126
-
127
-    # Deprecated - will be removed in Oscar 2.1
128
-    cost_price = models.DecimalField(
129
-        _("Cost Price"), decimal_places=2, max_digits=12,
112
+    # This is the base price for calculations - whether this is inclusive or exclusive of
113
+    # tax depends on your implementation, as this is highly domain-specific.
114
+    # It is nullable because some items don't have a fixed
115
+    # price but require a runtime calculation (possibly from an external service).
116
+    price = models.DecimalField(
117
+        _("Price"), decimal_places=2, max_digits=12,
130 118
         blank=True, null=True)
131 119
 
132 120
     #: Number of items in stock

+ 1
- 1
src/oscar/apps/partner/admin.py ファイルの表示

@@ -7,7 +7,7 @@ StockRecord = get_model('partner', 'StockRecord')
7 7
 
8 8
 
9 9
 class StockRecordAdmin(admin.ModelAdmin):
10
-    list_display = ('product', 'partner', 'partner_sku', 'price_excl_tax', 'num_in_stock')
10
+    list_display = ('product', 'partner', 'partner_sku', 'price', 'num_in_stock')
11 11
     list_filter = ('partner',)
12 12
 
13 13
 

+ 2
- 3
src/oscar/apps/partner/importers.py ファイルの表示

@@ -101,8 +101,7 @@ class CatalogueImporter(object):
101 101
 
102 102
         return item
103 103
 
104
-    def _create_stockrecord(self, item, partner_name, partner_sku,
105
-                            price_excl_tax, num_in_stock, stats):
104
+    def _create_stockrecord(self, item, partner_name, partner_sku, price, num_in_stock, stats):
106 105
         # Create partner and stock record
107 106
         partner, _ = Partner.objects.get_or_create(
108 107
             name=partner_name)
@@ -114,7 +113,7 @@ class CatalogueImporter(object):
114 113
         stock.product = item
115 114
         stock.partner = partner
116 115
         stock.partner_sku = partner_sku
117
-        stock.price_excl_tax = D(price_excl_tax)
116
+        stock.price = D(price)
118 117
         stock.num_in_stock = num_in_stock
119 118
         stock.save()
120 119
 

+ 31
- 0
src/oscar/apps/partner/migrations/0006_auto_20200724_0909.py ファイルの表示

@@ -0,0 +1,31 @@
1
+# Generated by Django 2.2.10 on 2020-07-24 08:09
2
+
3
+from django.db import migrations, models
4
+
5
+
6
+class Migration(migrations.Migration):
7
+
8
+    dependencies = [
9
+        ('partner', '0005_auto_20181115_1953'),
10
+    ]
11
+
12
+    operations = [
13
+        migrations.RemoveField(
14
+            model_name='stockrecord',
15
+            name='cost_price',
16
+        ),
17
+        migrations.RemoveField(
18
+            model_name='stockrecord',
19
+            name='price_retail',
20
+        ),
21
+        migrations.AlterField(
22
+            model_name='stockrecord',
23
+            name='price_excl_tax',
24
+            field=models.DecimalField(blank=True, decimal_places=2, max_digits=12, null=True, verbose_name='Price'),
25
+        ),
26
+        migrations.RenameField(
27
+            model_name='stockrecord',
28
+            old_name='price_excl_tax',
29
+            new_name='price',
30
+        ),
31
+    ]

+ 12
- 12
src/oscar/apps/partner/strategy.py ファイルの表示

@@ -229,17 +229,17 @@ class StockRequired(object):
229 229
 class NoTax(object):
230 230
     """
231 231
     Pricing policy mixin for use with the ``Structured`` base strategy.
232
-    This mixin specifies zero tax and uses the ``price_excl_tax`` from the
232
+    This mixin specifies zero tax and uses the ``price`` from the
233 233
     stockrecord.
234 234
     """
235 235
 
236 236
     def pricing_policy(self, product, stockrecord):
237 237
         # Check stockrecord has the appropriate data
238
-        if not stockrecord or stockrecord.price_excl_tax is None:
238
+        if not stockrecord or stockrecord.price is None:
239 239
             return UnavailablePrice()
240 240
         return FixedPrice(
241 241
             currency=stockrecord.price_currency,
242
-            excl_tax=stockrecord.price_excl_tax,
242
+            excl_tax=stockrecord.price,
243 243
             tax=D('0.00'))
244 244
 
245 245
     def parent_pricing_policy(self, product, children_stock):
@@ -250,7 +250,7 @@ class NoTax(object):
250 250
         stockrecord = stockrecords[0]
251 251
         return FixedPrice(
252 252
             currency=stockrecord.price_currency,
253
-            excl_tax=stockrecord.price_excl_tax,
253
+            excl_tax=stockrecord.price,
254 254
             tax=D('0.00'))
255 255
 
256 256
 
@@ -265,14 +265,14 @@ class FixedRateTax(object):
265 265
     exponent = D('0.01')  # Default to two decimal places
266 266
 
267 267
     def pricing_policy(self, product, stockrecord):
268
-        if not stockrecord or stockrecord.price_excl_tax is None:
268
+        if not stockrecord or stockrecord.price is None:
269 269
             return UnavailablePrice()
270 270
         rate = self.get_rate(product, stockrecord)
271 271
         exponent = self.get_exponent(stockrecord)
272
-        tax = (stockrecord.price_excl_tax * rate).quantize(exponent)
272
+        tax = (stockrecord.price * rate).quantize(exponent)
273 273
         return TaxInclusiveFixedPrice(
274 274
             currency=stockrecord.price_currency,
275
-            excl_tax=stockrecord.price_excl_tax,
275
+            excl_tax=stockrecord.price,
276 276
             tax=tax)
277 277
 
278 278
     def parent_pricing_policy(self, product, children_stock):
@@ -284,11 +284,11 @@ class FixedRateTax(object):
284 284
         stockrecord = stockrecords[0]
285 285
         rate = self.get_rate(product, stockrecord)
286 286
         exponent = self.get_exponent(stockrecord)
287
-        tax = (stockrecord.price_excl_tax * rate).quantize(exponent)
287
+        tax = (stockrecord.price * rate).quantize(exponent)
288 288
 
289 289
         return FixedPrice(
290 290
             currency=stockrecord.price_currency,
291
-            excl_tax=stockrecord.price_excl_tax,
291
+            excl_tax=stockrecord.price,
292 292
             tax=tax)
293 293
 
294 294
     def get_rate(self, product, stockrecord):
@@ -318,11 +318,11 @@ class DeferredTax(object):
318 318
     """
319 319
 
320 320
     def pricing_policy(self, product, stockrecord):
321
-        if not stockrecord or stockrecord.price_excl_tax is None:
321
+        if not stockrecord or stockrecord.price is None:
322 322
             return UnavailablePrice()
323 323
         return FixedPrice(
324 324
             currency=stockrecord.price_currency,
325
-            excl_tax=stockrecord.price_excl_tax)
325
+            excl_tax=stockrecord.price)
326 326
 
327 327
     def parent_pricing_policy(self, product, children_stock):
328 328
         stockrecords = [x[1] for x in children_stock if x[1] is not None]
@@ -334,7 +334,7 @@ class DeferredTax(object):
334 334
 
335 335
         return FixedPrice(
336 336
             currency=stockrecord.price_currency,
337
-            excl_tax=stockrecord.price_excl_tax)
337
+            excl_tax=stockrecord.price)
338 338
 
339 339
 
340 340
 # Example strategy composed of above mixins.  For real projects, it's likely

+ 1
- 8
src/oscar/templates/oscar/checkout/thank_you.html ファイルの表示

@@ -136,14 +136,7 @@
136 136
                     </div>
137 137
                     <div class="col-sm-7">
138 138
                         <h3><a href="{{ line.product.get_absolute_url }}">{{ line.description }}</a></h3>
139
-                        <p>
140
-                        {% if line.upc %}{{ line.upc }}<br/>{% endif %}
141
-                        {% if line.est_dispatch_date %}
142
-                            {% blocktrans with date=line.est_dispatch_date %}
143
-                                Estimated dispatch: <strong>{{ date }}</strong>
144
-                            {% endblocktrans %}
145
-                        {% endif %}
146
-                        </p>
139
+                        {% if line.upc %}<p>{{ line.upc }}</p>{% endif %}
147 140
                     </div>
148 141
                     <div class="col-sm-1 align-center">
149 142
                         {{ line.quantity }}

+ 1
- 3
src/oscar/templates/oscar/customer/anon_order.html ファイルの表示

@@ -40,7 +40,7 @@
40 40
                     <th>{% trans 'Notes' %}</th>
41 41
                     <td>{{ address.notes|linebreaks }}</td>
42 42
                 </tr>
43
-            {% endif %} 
43
+            {% endif %}
44 44
         </table>
45 45
     {% endwith %}
46 46
 
@@ -57,7 +57,6 @@
57 57
         <tr>
58 58
             <th>{% trans 'Product' %}</th>
59 59
             <th>{% trans 'Status' %}</th>
60
-            <th>{% trans 'Estimated dispatch date' %}</th>
61 60
             <th>{% trans 'Quantity' %}</th>
62 61
             <th>{% trans 'Line price excl. tax' %}</th>
63 62
             <th>{% trans 'Line price incl. tax' %}</th>
@@ -75,7 +74,6 @@
75 74
                     {% endif %}
76 75
                 </td>
77 76
                 <td>{{ line.shipping_status|default:"-" }}</td>
78
-                <td>{{ line.est_dispatch_date|default:"-" }}</td>
79 77
                 <td>{{ line.quantity }}</td>
80 78
                 <td>{{ line.line_price_before_discounts_excl_tax|currency:order.currency }}</td>
81 79
                 <td>{{ line.line_price_before_discounts_incl_tax|currency:order.currency }}</td>

+ 0
- 2
src/oscar/templates/oscar/customer/order/order_detail.html ファイルの表示

@@ -21,7 +21,6 @@
21 21
         <thead>
22 22
             <tr>
23 23
                 <th>{% trans 'Product' %}</th>
24
-                <th>{% trans 'Dispatch date' %}</th>
25 24
                 <th>{% trans 'Qty' %}</th>
26 25
                 <th>{% trans 'Line price excl. tax' %}</th>
27 26
                 <th>{% trans 'Line price incl. tax' %}</th>
@@ -54,7 +53,6 @@
54 53
                                 </p>
55 54
                             {% endif %}
56 55
                         </td>
57
-                        <td>{{ line.est_dispatch_date|default:"-" }}</td>
58 56
                         <td>{{ line.quantity }}</td>
59 57
                         <td>{{ line.line_price_before_discounts_excl_tax|currency:order.currency }}</td>
60 58
                         <td>{{ line.line_price_before_discounts_incl_tax|currency:order.currency }}</td>

+ 2
- 6
src/oscar/templates/oscar/dashboard/catalogue/product_update.html ファイルの表示

@@ -194,9 +194,7 @@
194 194
                                                     <th>{% trans "Low stock threshold" %}</th>
195 195
                                                 {% endif %}
196 196
                                                 <th>{% trans "Currency" %}</th>
197
-                                                <th>{% trans "Cost price" %}</th>
198
-                                                <th>{% trans "Price (excl tax)" %}</th>
199
-                                                <th>{% trans "Retail price" %}</th>
197
+                                                <th>{% trans "Price" %}</th>
200 198
                                                 <th>{% trans "Delete?" %}</th>
201 199
                                             </tr>
202 200
                                         </thead>
@@ -220,9 +218,7 @@
220 218
                                                         <td>{% include "oscar/dashboard/partials/form_field.html" with field=stockrecord_form.low_stock_threshold nolabel=True %}</td>
221 219
                                                     {% endif %}
222 220
                                                     <td>{% include "oscar/dashboard/partials/form_field.html" with field=stockrecord_form.price_currency nolabel=True %}</td>
223
-                                                    <td>{% include "oscar/dashboard/partials/form_field.html" with field=stockrecord_form.cost_price nolabel=True %}</td>
224
-                                                    <td>{% include "oscar/dashboard/partials/form_field.html" with field=stockrecord_form.price_excl_tax nolabel=True %}</td>
225
-                                                    <td>{% include "oscar/dashboard/partials/form_field.html" with field=stockrecord_form.price_retail nolabel=True %}</td>
221
+                                                    <td>{% include "oscar/dashboard/partials/form_field.html" with field=stockrecord_form.price nolabel=True %}</td>
226 222
                                                     <td>
227 223
                                                         {% include "oscar/dashboard/partials/form_field.html" with field=stockrecord_form.id nolabel=True %}
228 224
                                                         {% include "oscar/dashboard/partials/form_field.html" with field=stockrecord_form.DELETE nolabel=True %}

+ 0
- 3
src/oscar/templates/oscar/dashboard/orders/line_detail.html ファイルの表示

@@ -92,9 +92,6 @@
92 92
                 <tr>
93 93
                     <th>{% trans "Partner notes" %}</th><td>{{ line.partner_line_notes|default:"-" }}</td>
94 94
                 </tr>
95
-                <tr>
96
-                    <th>{% trans "Estimate dispatch date" %}</th><td>{{ line.est_dispatch_date|default:"-" }}</td>
97
-                </tr>
98 95
             </table>
99 96
         </div>
100 97
     </div>

+ 0
- 2
src/oscar/templates/oscar/dashboard/orders/order_detail.html ファイルの表示

@@ -111,7 +111,6 @@
111 111
                                     <th>{% trans "Status" %}</th>
112 112
                                     <th>{% trans "Supplier" %}</th>
113 113
                                     <th>{% trans "Supplier SKU" %}</th>
114
-                                    <th>{% trans "Est. dispatch date" %}</th>
115 114
                                     <th>{% trans "Price excl tax (before discounts)" %}</th>
116 115
                                     <th>{% trans "Price inc tax (before discounts)" %}</th>
117 116
                                     <th>{% trans "Actions" %}</th>
@@ -145,7 +144,6 @@
145 144
                                             {% endif %}
146 145
                                         </td>
147 146
                                         <td>{{ line.partner_sku }}</td>
148
-                                        <td>{{ line.est_dispatch_date|default:"-" }}</td>
149 147
                                         <td class="text-right">{{ line.line_price_before_discounts_excl_tax|currency:order.currency }}</td>
150 148
                                         <td class="text-right">{{ line.line_price_before_discounts_incl_tax|currency:order.currency }}</td>
151 149
                                         <td>

+ 1
- 1
src/oscar/test/basket.py ファイルの表示

@@ -23,7 +23,7 @@ def add_product(basket, price=None, quantity=1, product=None):
23 23
         record = product.stockrecords.all()[0]
24 24
     else:
25 25
         record = factories.create_stockrecord(
26
-            product=product, price_excl_tax=price,
26
+            product=product, price=price,
27 27
             num_in_stock=quantity + 1)
28 28
     basket.add_product(record.product, quantity)
29 29
 

+ 7
- 8
src/oscar/test/factories/__init__.py ファイルの表示

@@ -49,7 +49,7 @@ Benefit = get_model('offer', 'Benefit')
49 49
 ConditionalOffer = get_model('offer', 'ConditionalOffer')
50 50
 
51 51
 
52
-def create_stockrecord(product=None, price_excl_tax=None, partner_sku=None,
52
+def create_stockrecord(product=None, price=None, partner_sku=None,
53 53
                        num_in_stock=None, partner_name=None,
54 54
                        currency=settings.OSCAR_DEFAULT_CURRENCY,
55 55
                        partner_users=None):
@@ -59,21 +59,21 @@ def create_stockrecord(product=None, price_excl_tax=None, partner_sku=None,
59 59
     if partner_users:
60 60
         for user in partner_users:
61 61
             partner.users.add(user)
62
-    if price_excl_tax is None:
63
-        price_excl_tax = D('9.99')
62
+    if price is None:
63
+        price = D('9.99')
64 64
     if partner_sku is None:
65 65
         partner_sku = 'sku_%d_%d' % (product.id, random.randint(0, 10000))
66 66
     return product.stockrecords.create(
67 67
         partner=partner, partner_sku=partner_sku,
68 68
         price_currency=currency,
69
-        price_excl_tax=price_excl_tax, num_in_stock=num_in_stock)
69
+        price=price, num_in_stock=num_in_stock)
70 70
 
71 71
 
72 72
 def create_purchase_info(record):
73 73
     return PurchaseInfo(
74 74
         price=FixedPrice(
75 75
             record.price_currency,
76
-            record.price_excl_tax,
76
+            record.price,
77 77
             D('0.00')  # Default to no tax
78 78
         ),
79 79
         availability=StockRequired(
@@ -109,7 +109,7 @@ def create_product(upc=None, title="Dùmϻϒ title",
109 109
         price, partner_sku, partner_name, num_in_stock, partner_users]
110 110
     if any([field is not None for field in stockrecord_fields]):
111 111
         create_stockrecord(
112
-            product, price_excl_tax=price, num_in_stock=num_in_stock,
112
+            product, price=price, num_in_stock=num_in_stock,
113 113
             partner_users=partner_users, partner_sku=partner_sku,
114 114
             partner_name=partner_name)
115 115
     return product
@@ -157,8 +157,7 @@ def create_order(number=None, basket=None, user=None, shipping_address=None,
157 157
         basket = Basket.objects.create()
158 158
         basket.strategy = Default()
159 159
         product = create_product()
160
-        create_stockrecord(
161
-            product, num_in_stock=10, price_excl_tax=D('10.00'))
160
+        create_stockrecord(product, num_in_stock=10, price=D('10.00'))
162 161
         basket.add_product(product)
163 162
     if not basket.id:
164 163
         basket.save()

+ 4
- 12
src/oscar/test/factories/order.py ファイルの表示

@@ -100,24 +100,16 @@ class OrderLineFactory(factory.DjangoModelFactory):
100 100
         lambda l: l.product.stockrecords.first())
101 101
     quantity = 1
102 102
 
103
-    line_price_incl_tax = factory.LazyAttribute(
104
-        lambda obj: tax_add(obj.stockrecord.price_excl_tax) * obj.quantity)
105
-    line_price_excl_tax = factory.LazyAttribute(
106
-        lambda obj: obj.stockrecord.price_excl_tax * obj.quantity)
103
+    line_price_incl_tax = factory.LazyAttribute(lambda obj: tax_add(obj.stockrecord.price) * obj.quantity)
104
+    line_price_excl_tax = factory.LazyAttribute(lambda obj: obj.stockrecord.price * obj.quantity)
107 105
 
108 106
     line_price_before_discounts_incl_tax = (
109 107
         factory.SelfAttribute('.line_price_incl_tax'))
110 108
     line_price_before_discounts_excl_tax = (
111 109
         factory.SelfAttribute('.line_price_excl_tax'))
112 110
 
113
-    unit_price_incl_tax = factory.LazyAttribute(
114
-        lambda obj: tax_add(obj.stockrecord.price_excl_tax))
115
-    unit_cost_price = factory.LazyAttribute(
116
-        lambda obj: obj.stockrecord.cost_price)
117
-    unit_price_excl_tax = factory.LazyAttribute(
118
-        lambda obj: obj.stockrecord.price_excl_tax)
119
-    unit_retail_price = factory.LazyAttribute(
120
-        lambda obj: obj.stockrecord.price_retail)
111
+    unit_price_incl_tax = factory.LazyAttribute(lambda obj: tax_add(obj.stockrecord.price))
112
+    unit_price_excl_tax = factory.LazyAttribute(lambda obj: obj.stockrecord.price)
121 113
 
122 114
     class Meta:
123 115
         model = get_model('order', 'Line')

+ 1
- 1
src/oscar/test/factories/partner.py ファイルの表示

@@ -29,7 +29,7 @@ class StockRecordFactory(factory.DjangoModelFactory):
29 29
     partner = factory.SubFactory(PartnerFactory)
30 30
     partner_sku = factory.Sequence(lambda n: 'unit%d' % n)
31 31
     price_currency = "GBP"
32
-    price_excl_tax = D('9.99')
32
+    price = D('9.99')
33 33
     num_in_stock = 100
34 34
 
35 35
     class Meta:

+ 31
- 0
tests/_site/apps/partner/migrations/0007_auto_20200724_0909.py ファイルの表示

@@ -0,0 +1,31 @@
1
+# Generated by Django 2.2.10 on 2020-07-24 08:09
2
+
3
+from django.db import migrations, models
4
+
5
+
6
+class Migration(migrations.Migration):
7
+
8
+    dependencies = [
9
+        ('partner', '0006_auto_20190816_0910'),
10
+    ]
11
+
12
+    operations = [
13
+        migrations.RemoveField(
14
+            model_name='stockrecord',
15
+            name='cost_price',
16
+        ),
17
+        migrations.RemoveField(
18
+            model_name='stockrecord',
19
+            name='price_retail',
20
+        ),
21
+        migrations.AlterField(
22
+            model_name='stockrecord',
23
+            name='price_excl_tax',
24
+            field=models.DecimalField(blank=True, decimal_places=2, max_digits=12, null=True, verbose_name='Price'),
25
+        ),
26
+        migrations.RenameField(
27
+            model_name='stockrecord',
28
+            old_name='price_excl_tax',
29
+            new_name='price',
30
+        ),
31
+    ]

+ 2
- 2
tests/functional/checkout/__init__.py ファイルの表示

@@ -17,14 +17,14 @@ class CheckoutMixin(object):
17 17
             requires_shipping=False, track_stock=False)
18 18
         product = factories.ProductFactory(product_class=product_class)
19 19
         factories.StockRecordFactory(
20
-            num_in_stock=None, price_excl_tax=D('12.00'), product=product)
20
+            num_in_stock=None, price=D('12.00'), product=product)
21 21
         return product
22 22
 
23 23
     def add_product_to_basket(self, product=None):
24 24
         if product is None:
25 25
             product = factories.ProductFactory()
26 26
             factories.StockRecordFactory(
27
-                num_in_stock=10, price_excl_tax=D('12.00'), product=product)
27
+                num_in_stock=10, price=D('12.00'), product=product)
28 28
         detail_page = self.get(product.get_absolute_url())
29 29
         form = detail_page.forms['add_to_basket_form']
30 30
         form.submit()

+ 1
- 1
tests/functional/dashboard/test_catalogue.py ファイルの表示

@@ -127,7 +127,7 @@ class TestAStaffUser(WebTestCase):
127 127
         form['stockrecords-0-partner'] = self.partner.id
128 128
         form['stockrecords-0-partner_sku'] = '14'
129 129
         form['stockrecords-0-num_in_stock'] = '555'
130
-        form['stockrecords-0-price_excl_tax'] = '13.99'
130
+        form['stockrecords-0-price'] = '13.99'
131 131
         page = form.submit(name='action', value='continue')
132 132
 
133 133
         self.assertEqual(Product.objects.count(), 1)

+ 1
- 1
tests/functional/test_basket.py ファイルの表示

@@ -64,7 +64,7 @@ class AnonAddToBasketViewTests(WebTestCase):
64 64
         basket = Basket.objects.get(id=basket_id)
65 65
         line = basket.lines.get(product=self.product)
66 66
         stockrecord = self.product.stockrecords.all()[0]
67
-        self.assertEqual(stockrecord.price_excl_tax, line.price_excl_tax)
67
+        self.assertEqual(stockrecord.price, line.price_excl_tax)
68 68
 
69 69
 
70 70
 class BasketSummaryViewTests(WebTestCase):

+ 12
- 12
tests/integration/basket/test_models.py ファイルの表示

@@ -84,7 +84,7 @@ class TestBasketLine(TestCase):
84 84
         product = factories.create_product()
85 85
         # Tax for the default strategy will be 0
86 86
         factories.create_stockrecord(
87
-            product, price_excl_tax=D('75.00'), num_in_stock=10)
87
+            product, price=D('75.00'), num_in_stock=10)
88 88
         basket.add(product, 1)
89 89
 
90 90
         self.assertEqual(basket.lines.first().line_tax, D('0'))
@@ -95,7 +95,7 @@ class TestBasketLine(TestCase):
95 95
             """ A test strategy where the tax is not known """
96 96
 
97 97
             def pricing_policy(self, product, stockrecord):
98
-                return prices.FixedPrice('GBP', stockrecord.price_excl_tax, tax=None)
98
+                return prices.FixedPrice('GBP', stockrecord.price, tax=None)
99 99
 
100 100
         basket = Basket()
101 101
         basket.strategy = UnknownTaxStrategy()
@@ -114,7 +114,7 @@ class TestAddingAProductToABasket(TestCase):
114 114
         self.product = factories.create_product()
115 115
         self.record = factories.create_stockrecord(
116 116
             currency='GBP',
117
-            product=self.product, price_excl_tax=D('10.00'))
117
+            product=self.product, price=D('10.00'))
118 118
         self.purchase_info = factories.create_purchase_info(self.record)
119 119
         self.basket.add(self.product)
120 120
 
@@ -136,7 +136,7 @@ class TestAddingAProductToABasket(TestCase):
136 136
     def test_means_another_currency_product_cannot_be_added(self):
137 137
         product = factories.create_product()
138 138
         factories.create_stockrecord(
139
-            currency='USD', product=product, price_excl_tax=D('20.00'))
139
+            currency='USD', product=product, price=D('20.00'))
140 140
         with self.assertRaises(ValueError):
141 141
             self.basket.add(product)
142 142
 
@@ -153,7 +153,7 @@ class TestANonEmptyBasket(TestCase):
153 153
         self.basket.strategy = strategy.Default()
154 154
         self.product = factories.create_product()
155 155
         self.record = factories.create_stockrecord(
156
-            self.product, price_excl_tax=D('10.00'))
156
+            self.product, price=D('10.00'))
157 157
         self.purchase_info = factories.create_purchase_info(self.record)
158 158
         self.basket.add(self.product, 10)
159 159
 
@@ -171,21 +171,21 @@ class TestANonEmptyBasket(TestCase):
171 171
 
172 172
     def test_returns_zero_line_quantity_for_alternative_stockrecord(self):
173 173
         record = factories.create_stockrecord(
174
-            self.product, price_excl_tax=D('5.00'))
174
+            self.product, price=D('5.00'))
175 175
         self.assertEqual(0, self.basket.line_quantity(
176 176
             self.product, record))
177 177
 
178 178
     def test_returns_zero_line_quantity_for_missing_product_and_stockrecord(self):
179 179
         product = factories.create_product()
180 180
         record = factories.create_stockrecord(
181
-            product, price_excl_tax=D('5.00'))
181
+            product, price=D('5.00'))
182 182
         self.assertEqual(0, self.basket.line_quantity(
183 183
             product, record))
184 184
 
185 185
     def test_returns_correct_quantity_for_existing_product_and_stockrecord_and_options(self):
186 186
         product = factories.create_product()
187 187
         record = factories.create_stockrecord(
188
-            product, price_excl_tax=D('5.00'))
188
+            product, price=D('5.00'))
189 189
         option = Option.objects.create(name="Message")
190 190
         options = [{"option": option, "value": "2"}]
191 191
 
@@ -198,7 +198,7 @@ class TestANonEmptyBasket(TestCase):
198 198
     def test_total_sums_product_totals(self):
199 199
         product = factories.create_product()
200 200
         factories.create_stockrecord(
201
-            product, price_excl_tax=D('5.00'))
201
+            product, price=D('5.00'))
202 202
         self.basket.add(product, 1)
203 203
         self.assertEqual(self.basket.total_excl_tax, 105)
204 204
 
@@ -208,7 +208,7 @@ class TestANonEmptyBasket(TestCase):
208 208
         # Add a zero-priced product to the basket
209 209
         product = factories.create_product()
210 210
         factories.create_stockrecord(
211
-            product, price_excl_tax=D('0.00'), num_in_stock=10)
211
+            product, price=D('0.00'), num_in_stock=10)
212 212
         basket.add(product, 1)
213 213
 
214 214
         self.assertEqual(basket.lines.count(), 1)
@@ -218,7 +218,7 @@ class TestANonEmptyBasket(TestCase):
218 218
     def test_basket_prices_calculation_for_unavailable_pricing(self):
219 219
         new_product = factories.create_product()
220 220
         factories.create_stockrecord(
221
-            new_product, price_excl_tax=D('5.00'))
221
+            new_product, price=D('5.00'))
222 222
         self.basket.add(new_product, 1)
223 223
 
224 224
         class UnavailableProductStrategy(strategy.Default):
@@ -288,7 +288,7 @@ class TestMergingTwoBaskets(TestCase):
288 288
     def setUp(self):
289 289
         self.product = factories.create_product()
290 290
         self.record = factories.create_stockrecord(
291
-            self.product, price_excl_tax=D('10.00'))
291
+            self.product, price=D('10.00'))
292 292
         self.purchase_info = factories.create_purchase_info(self.record)
293 293
 
294 294
         self.main_basket = Basket()

+ 1
- 1
tests/integration/partner/test_availability_mixin.py ファイルの表示

@@ -12,7 +12,7 @@ class TestStockRequiredMixin(TestCase):
12 12
         self.mixin = strategy.StockRequired()
13 13
         self.product = mock.Mock()
14 14
         self.stockrecord = mock.Mock()
15
-        self.stockrecord.price_excl_tax = D('12.00')
15
+        self.stockrecord.price = D('12.00')
16 16
 
17 17
     def test_returns_unavailable_without_stockrecord(self):
18 18
         policy = self.mixin.availability_policy(

+ 1
- 1
tests/integration/partner/test_import.py ファイルの表示

@@ -96,7 +96,7 @@ class ImportSmokeTest(TestCase):
96 96
 
97 97
     def test_price_is_imported(self):
98 98
         stockrecord = self.product.stockrecords.all()[0]
99
-        self.assertEqual(D('10.32'), stockrecord.price_excl_tax)
99
+        self.assertEqual(D('10.32'), stockrecord.price)
100 100
 
101 101
     def test_num_in_stock_is_imported(self):
102 102
         stockrecord = self.product.stockrecords.all()[0]

+ 4
- 4
tests/integration/partner/test_models.py ファイルの表示

@@ -15,10 +15,10 @@ class TestStockRecord(TestCase):
15 15
     def setUp(self):
16 16
         self.product = factories.create_product()
17 17
         self.stockrecord = factories.create_stockrecord(
18
-            self.product, price_excl_tax=D('10.00'), num_in_stock=10)
18
+            self.product, price=D('10.00'), num_in_stock=10)
19 19
 
20 20
     def test_get_price_excl_tax_returns_correct_value(self):
21
-        self.assertEqual(D('10.00'), self.stockrecord.price_excl_tax)
21
+        self.assertEqual(D('10.00'), self.stockrecord.price)
22 22
 
23 23
     def test_net_stock_level_with_no_allocation(self):
24 24
         self.assertEqual(10, self.stockrecord.net_stock_level)
@@ -64,7 +64,7 @@ class TestStockRecordNoStockTrack(TestCase):
64 64
     def test_allocate_does_nothing(self):
65 65
         product = factories.ProductFactory(product_class=self.product_class)
66 66
         stockrecord = factories.create_stockrecord(
67
-            product, price_excl_tax=D('10.00'), num_in_stock=10)
67
+            product, price=D('10.00'), num_in_stock=10)
68 68
 
69 69
         self.assertFalse(stockrecord.can_track_allocations)
70 70
         stockrecord.allocate(5)
@@ -76,7 +76,7 @@ class TestStockRecordNoStockTrack(TestCase):
76 76
         child_product = factories.ProductFactory(
77 77
             parent=parent_product, product_class=None, structure='child')
78 78
         stockrecord = factories.create_stockrecord(
79
-            child_product, price_excl_tax=D('10.00'), num_in_stock=10)
79
+            child_product, price=D('10.00'), num_in_stock=10)
80 80
 
81 81
         self.assertFalse(stockrecord.can_track_allocations)
82 82
         stockrecord.allocate(5)

+ 3
- 3
tests/integration/partner/test_strategy.py ファイルの表示

@@ -53,7 +53,7 @@ class TestDefaultStrategy(TestCase):
53 53
         # The availability policy should be independent of price.
54 54
         product_class = factories.ProductClassFactory(track_stock=False)
55 55
         product = factories.ProductFactory(product_class=product_class, stockrecords=[])
56
-        factories.StockRecordFactory(price_excl_tax=None, product=product)
56
+        factories.StockRecordFactory(price=None, product=product)
57 57
         info = self.strategy.fetch_for_product(product)
58 58
         self.assertTrue(info.availability.is_available_to_buy)
59 59
 
@@ -123,7 +123,7 @@ class TestFixedRateTax(TestCase):
123 123
 
124 124
     def test_pricing_policy_unavailable_if_no_price_excl_tax(self):
125 125
         product = factories.ProductFactory(stockrecords=[])
126
-        factories.StockRecordFactory(price_excl_tax=None, product=product)
126
+        factories.StockRecordFactory(price=None, product=product)
127 127
         info = strategy.UK().fetch_for_product(product)
128 128
         self.assertFalse(info.price.exists)
129 129
 
@@ -132,6 +132,6 @@ class TestDeferredTax(TestCase):
132 132
 
133 133
     def test_pricing_policy_unavailable_if_no_price_excl_tax(self):
134 134
         product = factories.ProductFactory(stockrecords=[])
135
-        factories.StockRecordFactory(price_excl_tax=None, product=product)
135
+        factories.StockRecordFactory(price=None, product=product)
136 136
         info = strategy.US().fetch_for_product(product)
137 137
         self.assertFalse(info.price.exists)

+ 3
- 3
tests/integration/partner/test_tax_mixin.py ファイルの表示

@@ -12,7 +12,7 @@ class TestNoTaxMixin(TestCase):
12 12
         self.mixin = strategy.NoTax()
13 13
         self.product = mock.Mock()
14 14
         self.stockrecord = mock.Mock()
15
-        self.stockrecord.price_excl_tax = D('12.00')
15
+        self.stockrecord.price = D('12.00')
16 16
 
17 17
     def test_returns_no_prices_without_stockrecord(self):
18 18
         policy = self.mixin.pricing_policy(
@@ -37,7 +37,7 @@ class TestFixedRateTaxMixin(TestCase):
37 37
         self.mixin.rate = D('0.10')
38 38
         self.product = mock.Mock()
39 39
         self.stockrecord = mock.Mock()
40
-        self.stockrecord.price_excl_tax = D('12.00')
40
+        self.stockrecord.price = D('12.00')
41 41
 
42 42
     def test_returns_no_prices_without_stockrecord(self):
43 43
         policy = self.mixin.pricing_policy(
@@ -47,7 +47,7 @@ class TestFixedRateTaxMixin(TestCase):
47 47
     def test_returns_correct_tax(self):
48 48
         policy = self.mixin.pricing_policy(
49 49
             self.product, self.stockrecord)
50
-        expected_tax = self.stockrecord.price_excl_tax * self.mixin.get_rate(
50
+        expected_tax = self.stockrecord.price * self.mixin.get_rate(
51 51
             self.product, self.stockrecord)
52 52
         self.assertEqual(expected_tax, policy.tax)
53 53
 

+ 4
- 4
tests/integration/shipping/test_model_method.py ファイルの表示

@@ -69,7 +69,7 @@ class ZeroFreeThresholdTest(TestCase):
69 69
         self.assertEqual(D('0.00'), charge.incl_tax)
70 70
 
71 71
     def test_free_shipping_with_nonempty_basket(self):
72
-        record = factories.create_stockrecord(price_excl_tax=D('5.00'))
72
+        record = factories.create_stockrecord(price=D('5.00'))
73 73
         self.basket.add_product(record.product)
74 74
         charge = self.method.calculate(self.basket)
75 75
         self.assertEqual(D('0.00'), charge.incl_tax)
@@ -83,7 +83,7 @@ class TestNonZeroFreeThreshold(TestCase):
83 83
         self.basket = factories.create_basket(empty=True)
84 84
 
85 85
     def test_basket_below_threshold(self):
86
-        record = factories.create_stockrecord(price_excl_tax=D('5.00'))
86
+        record = factories.create_stockrecord(price=D('5.00'))
87 87
         self.basket.add_product(record.product)
88 88
 
89 89
         charge = self.method.calculate(self.basket)
@@ -91,7 +91,7 @@ class TestNonZeroFreeThreshold(TestCase):
91 91
         self.assertEqual(D('10.00'), charge.incl_tax)
92 92
 
93 93
     def test_basket_on_threshold(self):
94
-        record = factories.create_stockrecord(price_excl_tax=D('5.00'))
94
+        record = factories.create_stockrecord(price=D('5.00'))
95 95
         self.basket.add_product(record.product, quantity=4)
96 96
 
97 97
         charge = self.method.calculate(self.basket)
@@ -99,7 +99,7 @@ class TestNonZeroFreeThreshold(TestCase):
99 99
         self.assertEqual(D('0.00'), charge.incl_tax)
100 100
 
101 101
     def test_basket_above_threshold(self):
102
-        record = factories.create_stockrecord(price_excl_tax=D('5.00'))
102
+        record = factories.create_stockrecord(price=D('5.00'))
103 103
         self.basket.add_product(record.product, quantity=8)
104 104
 
105 105
         charge = self.method.calculate(self.basket)

+ 2
- 6
tests/unit/fixtures/catalogue.json ファイルの表示

@@ -159,9 +159,7 @@
159 159
         "partner": 1,
160 160
         "partner_sku": "henk",
161 161
         "price_currency": "EUR",
162
-        "price_excl_tax": "400.00",
163
-        "price_retail": "500.00",
164
-        "cost_price": "300.00",
162
+        "price": "400.00",
165 163
         "num_in_stock": 23,
166 164
         "num_allocated": null,
167 165
         "low_stock_threshold": null,
@@ -177,9 +175,7 @@
177 175
         "partner": 1,
178 176
         "partner_sku": "asdasd",
179 177
         "price_currency": "EUR",
180
-        "price_excl_tax": "23.00",
181
-        "price_retail": "0.05",
182
-        "cost_price": null,
178
+        "price": "23.00",
183 179
         "num_in_stock": null,
184 180
         "num_allocated": null,
185 181
         "low_stock_threshold": null,

+ 4
- 12
tests/unit/fixtures/productattributes.json ファイルの表示

@@ -803,9 +803,7 @@
803 803
         "partner": 1,
804 804
         "partner_sku": "henk",
805 805
         "price_currency": "EUR",
806
-        "price_excl_tax": "400.00",
807
-        "price_retail": "500.00",
808
-        "cost_price": "300.00",
806
+        "price": "400.00",
809 807
         "num_in_stock": 23,
810 808
         "num_allocated": null,
811 809
         "low_stock_threshold": null,
@@ -821,9 +819,7 @@
821 819
         "partner": 1,
822 820
         "partner_sku": "asdasd",
823 821
         "price_currency": "EUR",
824
-        "price_excl_tax": "23.00",
825
-        "price_retail": "0.05",
826
-        "cost_price": null,
822
+        "price": "23.00",
827 823
         "num_in_stock": null,
828 824
         "num_allocated": null,
829 825
         "low_stock_threshold": null,
@@ -839,9 +835,7 @@
839 835
         "partner": 1,
840 836
         "partner_sku": "err56",
841 837
         "price_currency": "EUR",
842
-        "price_excl_tax": "234.00",
843
-        "price_retail": "123.00",
844
-        "cost_price": null,
838
+        "price": "234.00",
845 839
         "num_in_stock": 345,
846 840
         "num_allocated": null,
847 841
         "low_stock_threshold": 12,
@@ -857,9 +851,7 @@
857 851
         "partner": 1,
858 852
         "partner_sku": "23478",
859 853
         "price_currency": "EUR",
860
-        "price_excl_tax": "12.00",
861
-        "price_retail": "11.00",
862
-        "cost_price": null,
854
+        "price": "12.00",
863 855
         "num_in_stock": 34,
864 856
         "num_allocated": null,
865 857
         "low_stock_threshold": 8,

読み込み中…
キャンセル
保存