Explorar el Código

Fix issue with updating stockrecords within product dashboard

Fixes #355
master
David Winterbottom hace 13 años
padre
commit
3d1e9a770f
Se han modificado 1 ficheros con 1 adiciones y 2 borrados
  1. 1
    2
      oscar/apps/dashboard/catalogue/views.py

+ 1
- 2
oscar/apps/dashboard/catalogue/views.py Ver fichero

235
 
235
 
236
     def form_valid(self, form):
236
     def form_valid(self, form):
237
         stockrecord_form = self.get_stockrecord_form()
237
         stockrecord_form = self.get_stockrecord_form()
238
-
239
         category_formset = ProductCategoryFormSet(self.request.POST,
238
         category_formset = ProductCategoryFormSet(self.request.POST,
240
                                                   instance=self.object)
239
                                                   instance=self.object)
241
         image_formset = ProductImageFormSet(self.request.POST,
240
         image_formset = ProductImageFormSet(self.request.POST,
252
         if is_valid:
251
         if is_valid:
253
             form.save()
252
             form.save()
254
             if self.is_stockrecord_submitted():
253
             if self.is_stockrecord_submitted():
255
-                stockrecord = stockrecord_form.save()
254
+                stockrecord = stockrecord_form.save(commit=False)
256
                 stockrecord.product = self.object
255
                 stockrecord.product = self.object
257
                 stockrecord.save()
256
                 stockrecord.save()
258
             category_formset.save()
257
             category_formset.save()

Loading…
Cancelar
Guardar