How can I change the font from a column in a treeview to BOLD?
< field name=”start_date” >;
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
How can I change the font from a column in a treeview to BOLD?
< field name=”start_date” >;
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
like
.my_custom_css [data-field="your_field_name"]
{
font-weight: bold;
}
2. Define css file in template
like
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<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"/>
</xpath>
</template>
</data>
</openerp>
3. Define template in __openerp__.py file.
like
'data': ['template_file_name.xml']
4. Now you can apply css in tree view
like
<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.
Hello,
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'/>
Regards,
Create an account today to enjoy exclusive features and engage with our awesome community!
Sign up
1. Use the live chat to ask your questions.
2. The operator answers within a few minutes.