I have a model in which I created all the data types of Odoo, char, float, many2many…. etc, I show this model in a view where, depending on the type of data selected by the user, “only one” of these types of data will be shown to enter a value. I am showing the type of data selected by this domain in the view -> attrs = "{'invisible': [('fields_type', '! =', 'Char')]}"
In addition, when “only one” of the fields is saved in the database, the other values in the line are in <null>
.
My questions are:
Will there be any “dynamic” way to show only the selected field, without having to load all fields in the view and hide them with attrs?
What would be an "optimal" way to store these values in a database? Do all fields in a single model or should I separate the different fields using some kind of inheritance?
Thank you !