Setting product unit price from production cost

We have an use case of a company who manufactures pieces of steel on demand for its customers.
At the moment of accepting the order they know which procedures and materials they should do but they do not now the final price to invoice the customer because they invoice their cost of production plus a margin percentage.

I think we can add this information as following:

  • Create a sale order for a producible product with zero unit_price.
  • Use the sale_supply_production module to create the production ondemand for the materials.
  • Once the production is finished we will know the cost_price of the production so we can compute the unit_price based on a margin. This unit price can then be set on the output move and so on the related invoice lines.

Note that the production may require to purchase some materials or produce them internally, so we need to create the production order before knowing the price to generate the need for stock_supply modules.

I’m wondering if somebody had a similar case and how they solved.
Do you think there is some part of this workflow that can be included on some standard module?

Any comments will be much appreciated.

Indeed I would set invoice on shipment and extend the Sale to fill the invoice line with the properly computed unit price.

I do not see anything generic in the small customization needed.