Deleting the databse row you can activate the margin module again but, after that, the module doesnt work as expected, not like in previous version 3.6.0.
You can introduce the buying price when creating a new line in a budget, but after save this line you can not modify the buying price, only option is to create a new line with the product or service and delete the previous…
I found what was causing that problem, in not the database nor the 3.7.0 update is my curiosity (sorry), if this GLOBAL OPTION is set to 1, (tested with Firefox and Chrome, lastest versions).