
Stock Model. This is the model for Stock which have foreign key of Product Model. From this model i want to update product quantity of Product Model.

Stock Viewset. This is the viewset for displaying data.

This is Stock Serializer where i had written logic for updating product quantity from stock model.

This is the Product whose id is 2 and it has quantity of 5. Now i want this quantity to be updated when user add stock from Stock Model.

Now in Stock, i added 15 quantity. So Previously product has 5 quantity. SInce i added 15more quantity for Apple product. I want it to be added on Product Model also.

In console, while printing i can see 5 that is previous quantity and 20 after adding stock. But in Product API i cannot see that updated quantity.

THis is Product model.
I need help for updating Product quantity from Stock model.