Odoo Help


This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.


Change font from column in treeview to BOLD

Mario Gielissen | Openworx
on 10/24/15, 5:11 PM 630 views

How can I change the font from a column in a treeview to BOLD?

 < field name=”start_date” >;


Ankit H Gandhi(AHG)

--Ankit H Gandhi(AHG)--
| 5 3 6
Gandhinagar, India
--Ankit H Gandhi(AHG)--

Learning Python..

Ankit H Gandhi(AHG)
On 10/25/15, 3:05 AM

Dear Mario Gielissen,

Your question is good. Finally I find out your solution.

Please follow below step

1. Create css file and write below code.

your_module_name > static > src > css > my_custom_css.css


.my_custom_css [data-field="your_field_name"]


font-weight: bold;


2. Define css file in template


<?xml version="1.0" encoding="utf-8"?>



<template id="assets_backend" name="your_module_name assets" inherit_id="web.assets_backend">

<xpath expr="." position="inside">

<link rel="stylesheet" href="/your_module_name/static/src/css/my_custom_css.css"/>





3. Define template in __openerp__.py file.


'data': ['template_file_name.xml']

4. Now you can apply css in tree view


<tree string="any name" class="my_custom_css">

class attribute works on tree tag.

This effect you can see only that field which you define in css file.

Hope this code may be helpful for you.

Let me know if any problem. 

Hi Ankit, good answer +1

Akhil P Sivan
on 10/25/15, 4:56 AM

Thank you @ Akhil

Ankit H Gandhi(AHG)
on 10/25/15, 5:00 AM

Ahmed M.Elmubarak

--Ahmed M.Elmubarak--
| 5 3 5
--Ahmed M.Elmubarak--

Ahmed M.Elmubarak
On 10/25/15, 2:31 AM


You can use fonts attribute in the tree tag to specify which record to be bold: you can check the sale view as example.

If you need just one field to be bold, I think you need to define a css class and use the class in your view e.g <field name='start_date' class='your_class_name'/>


Your Answer

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

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)


Asked: 10/24/15, 5:11 PM
Seen: 630 times
Last updated: 10/25/15, 3:14 AM