I am using Drupal 7 and Commerce.
I have Product display where is custom field called Stock (field_stock). This field holds stock value (integer) for Product.
In Product display I have Product Variations. Variations has custom field called Stock Value (field_stock_value).
When adding new Product display and setting field Stock to value 10. And then adding first Variation and setting field Stock Value to 6. And to second Variation field Stock Value to 4.
I need to have rules which decreases Stock field from Product display. So it is simple: take value from Stock Value field and reduce that amount from Stock field.
But I have not succeeded to make working rules for that. Any help needed. Thanks!