This question has been flagged
2 Replies
6449 Views

Hello, I am working for a nonprofit company, and we want to manage an inventory of items which are used completely internally. This means that fields like "sale price" are not useful and clutter the interface and database.

I'm wondering if there is a way to add a module that will remove fields from the stock model. I've seen some answers for how to hide a field from the view, which is good, but I think it would be good to remove it from the model as well to clean up the database. Is there any way to make a model that inherits from stock using traditional inheritance, and removes the "sale price" field from the stock model?


Avatar
Discard
Best Answer

There is no stock model. I assume you mean the field list_price, which belongs to the product model. When trying to delete fields from Odoo core models, you will most probably screw your database or instance. Instead, you should follow Niyas' advise and  hide the field from the view.

Avatar
Discard
Best Answer

Hi,

You can also try like this, replacing using the xpath,

<xpath expr="//field[@name='name_of_the_field']" position="replace">
</xpath>

You can  check this answer,

https://www.odoo.com/forum/help-1/question/delete-fields-from-database-without-uninstall-89352

Thanks

Avatar
Discard