Is it possible to set two or more types(Integre or float) for 1 field by setting codition in Odoo 9?
<p>I am try to learn how to customize the odoo system to sovle specific problem in business. I am using  odoo9.0. 
Could we set two types of value(integre and float) for a file by setting the specific conditions for each of them? if it is possible, please teach me ththe right steps to follow. Thanks for your time.</p>

<p>In Odoo it's not possible to set two data-type for single field.
But you can create 2 fields Integer and Float and show/hide by setting condition in view.</p>

<p>.py file</p>

<pre><code>is_integer = fields.Boolean('Is Integer?')
integer_field = fields.Integer('Integer Field')
float_field = fields.Float('Float Field')
</code></pre>

<p>.xml file</p>

<pre><code>&lt;field name="is_integer" invisible="1" /&gt;
&lt;field name="integer_field" attrs="{'invisible': [('is_intiger', '==', False)]}"/&gt;   
&lt;field name="float_field" attrs="{'invisible': [('is_intiger', '==', True)]}"/&gt;
</code></pre>

python file-type odoo-9