NotImplementedError: Missing setter function for field "Cost Price" in "Product Template"

by creating a setter function . do you mean to implement a function that would set variant in product.product ?