What is the right way to change the text-align property for a column in a tree view.
I have a custom css file in the static/src/css directory.
I also have it registered in the __openerp__.py file in the 'css': [ 'static/src/css/custom_style.css' ].
I also made sure the field in the xml file had the right class name set like class="change_text_align"
For some reason though, it will not change the text-align for the column for the field in the tree view. Is there anything that I am missing? I just want to align the text on the left side of the column instead of the right.
I also tried adding a style attribute to the field like this, but it still didnt work:
<field name="my_field" style="text-align: left" />
quote from question:
I just want to align the text on the left side of the column instead of the right.
NOTE: text is aligned at the left side anyway (fields of type char or text), so question is not correctly describes the problem and requires further clarification.
Perhaps, if question is about numeric (integer or float) fields (as numeric fields are aligned at the right side), then it's possible to align them to the left side like text fields, using type="char" attribute in xml record:
<field name="my_numeric_field" type="char" />
The css and js resource file load have changed since Odoo 8, you need to load using a view extension of the asset_backend, like:
<template id="assets_backend" name="module assets" inherit_id="web.assets_backend">
<xpath expr="." position="inside">
<link rel="stylesheet" href="/module/static/src/css/custom_style.css"/>
Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!
About This Community
|Asked: 10/26/15, 6:20 PM|
|Seen: 602 times|
|Last updated: 10/27/15, 11:23 AM|