Since template cost_price is updated on any product purchase and stock in, and template price_list is user in value, a user requirement uses price lists feature in order to calculate prices, however this calculation uses price list, but since purchase update template cost_price, my customer requires to use it. I have done an implementation on tryton 4.2 on update_product_cost_price on stock.move module, but on tryton 5.0, this method is no used anymore.
I was looking for a solution and I have find the set_cost_value method, but, since it is using a mixing, I couldnt find a way to solve it on a customer module customization.
I don’t know in wich version was introduced that change but you can look for wich part of code defines that expression and implement it in your code at least you upgrade the version. This is a bad practice very used by us.
I mean: “No touch core tryton or core tryton modules code”
I usually prefer extend functionality on modules, but this change is required to do on the tryton core modules ( product_price_list ), that is the reason on asking the version in order to use the core patch to update my current version.
As you said on a previous comment, probably the current solution is apply the change on a manual edition to the product_price_list.price_list module and keep it on mind to the next upgrade.