Recalculate aggregated stock

Recalculate aggregated stock

Hi,

I was wondering if it's possible to create a field that based on a list of related products, calculate the cumulative sum of all the products stock. For example:

If I have a list of car brands, such as Ford, Chevy or Toyota, and I want to aggregate them in a Category called "Cars". Each Car (product) has its own stock, but the Category "Cars" has a field which represents the sum of all the available cars in stock (Ford + Chevy + Toyota). 
So if I have:

20 x Ford, 10 x Chevy, 10 Toyota, the Stock field in cars should read the aggregated value of "40".

Is there a way to do this in the CRM? I'm currently using my custom webhooks to do the calculation, but an integrated solution in the CRM would be great.

Thanks