How to change text-align of float field in odoo 9
<p>I got a float field in my model that left align when I put it in form view. My question is how to change it to right align.</p>

<p>I've tried so many ways to change its align to right but failed. I've tried to add <code>class="oe_right"</code>, create css custom module but not working. please help me</p>

<p><a href="http://i.stack.imgur.com/TG4p2.png" rel="nofollow"><img src="http://i.stack.imgur.com/TG4p2.png" alt="enter image description here"></a></p>

<p>You can set text align right by give in-line style in particular field. Try following code.</p>

<p><strong>1. Right align of Float field</strong></p>

<pre><code>&lt;field name="field_name" style="text-align:right;"/&gt;
</code></pre>

<p><strong>2. Right align of Float field value while edit mode</strong></p>

<p>You need to create custom css</p>

<p>File <strong>base.css</strong></p>

<pre><code>.openerp .oe_form_editable .oe_form .oe_form_field_float input{
text-align: right !important;}
</code></pre>

<p><strong>Add css to assets_common</strong></p>

<pre><code>   &lt;template id="assets_common_float_inherited" inherit_id="web.assets_common"&gt;
        &lt;xpath expr="." position="inside"&gt;
            &lt;link rel="stylesheet" href='/your_module_name/static/src/css/base.css'/&gt;
        &lt;/xpath&gt;
    &lt;/template&gt;
</code></pre>

<p>Add xml file into <strong>__openerp__.py</strong></p>

<p>Thanks.</p>

python css xml openerp