Ideally you have a Vendor Bill, or depreciation entry, or other way of debiting WIP with the $20.
It takes a lot of information, updated frequently, to get the "right" amounts for "cost per hour" for each Work Center.
At the end of each month, you debit WIP based on your actual expenses and see what the difference is, adjusting your hourly work center costs as you go.
In general, automation comes after you have successfully developed and tested and perfected a manual process. You can then define:
what to automate
what not to automate
how the automation should work
what information is needed
how to measure and monitor it
I know I am not providing a solution, I am inviting you to think about how far you are away from identifying the total amount of expenses that you want to inject back into the price of your finished goods.
For some Customers, landing expenses back into the price of finished goods is an easier solution than identifying and updating hourly costs per work center.
For some Customers, hourly costs per work center can be discovered after measuring the last X months of Vendor Bills, payroll and depreciation - segmenting their manufacturing process into "tiers" [easy process on a cheap to run machine, hard process on an expensive to run machine, etc] and assigning a percentage of those total expenses based on the amount produced.
For some Customers, expenses are manually journaled to Cost of Goods based on the percentage of Inventory sold, each month, without using hourly costs per work center.
For some Customers, projects are setup with links to manufacturing orders and analytic entries are posted to help with finer grained costing.
Additional Resources:
https://www.youtube.com/watch?v=E5GBQipGbis
https://www.youtube.com/watch?v=5uG19B8VLo0
https://www.odoo.com/documentation/user/14.0/inventory/management/reporting/integrating_landed_costs.html
https://www.odoo.com/forum/help-1/how-can-i-reclass-or-add-fixed-manufacturing-costs-overhead-like-rent-insurance-utilities-etc-to-finished-goods-after-they-are-made-179454
https://www.odoo.com/forum/help-1/why-is-it-important-to-model-measure-wip-work-in-progress-in-manufacturing-is-this-the-only-way-to-measure-overhead-costs-168395
https://apps.odoo.com/apps/modules/browse?author=Odoo Technical Marketing&search=manufacturing
(also see the Community Apps that have been created to address this)
Old, with some out of date approaches, but still have some value in the concepts:
https://www.odoo.com/forum/help-1/odoo-wip-valuation-139977
https://www.odoo.com/forum/help-1/what-are-my-options-to-record-and-include-labor-cost-in-the-value-of-my-products-147364