|
|
@@ -208,13 +208,12 @@ class ProductUpdateView(generic.UpdateView):
|
|
208
|
208
|
stock record it will be passed into the form as
|
|
209
|
209
|
``instance``.
|
|
210
|
210
|
"""
|
|
211
|
|
- if not self.is_stockrecord_submitted():
|
|
212
|
|
- return StockRecordForm(self.object.product_class)
|
|
213
|
|
-
|
|
214
|
211
|
stockrecord = None
|
|
215
|
212
|
if self.object.has_stockrecord:
|
|
216
|
213
|
stockrecord = self.object.stockrecord
|
|
217
|
|
-
|
|
|
214
|
+ if not self.is_stockrecord_submitted():
|
|
|
215
|
+ return StockRecordForm(self.object.product_class,
|
|
|
216
|
+ instance=stockrecord)
|
|
218
|
217
|
return StockRecordForm(
|
|
219
|
218
|
self.object.product_class,
|
|
220
|
219
|
self.request.POST,
|