yogakumboro
yogakumboro

Reputation: 127

How to change text-align of float field in odoo 9

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.

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

enter image description here

Upvotes: 0

Views: 6902

Answers (1)

Jignesh Jarsaniya
Jignesh Jarsaniya

Reputation: 589

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

1. Right align of Float field

<field name="field_name" style="text-align:right;"/>

2. Right align of Float field value while edit mode

You need to create custom css

File base.css

.openerp .oe_form_editable .oe_form .oe_form_field_float input{
text-align: right !important;}

Add css to assets_common

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

Add xml file into __openerp__.py

Thanks.

Upvotes: 2

Related Questions