Update quantities after new production schedule

I have a stock control and management information system, when a new production order is created a quantity of the specific product is entered. I want to add a method to the production controller so that every time a new production order is created the production quantity is added to the quantity in the stock table.

So the production->qty + stock->qty and the update be made to the qty in stock table.

You should override the operation afterSave or beforeSave in your Production Order class. Here you can update the stock quantity each time a production order is inserted from any controller action.