Skip to Content
Odoo Menu
  • Prijavi
  • Try it free
  • Apps
    Finance
    • Accounting
    • Invoicing
    • Expenses
    • Spreadsheet (BI)
    • Documents
    • Sign
    Sales
    • CRM
    • Sales
    • POS Shop
    • POS Restaurant
    • Subscriptions
    • Rental
    Websites
    • Website Builder
    • eCommerce
    • Blog
    • Forum
    • Live Chat
    • eLearning
    Supply Chain
    • Inventory
    • Manufacturing
    • PLM
    • Purchase
    • Maintenance
    • Quality
    Human Resources
    • Employees
    • Recruitment
    • Time Off
    • Appraisals
    • Referrals
    • Fleet
    Marketing
    • Social Marketing
    • Email Marketing
    • SMS Marketing
    • Events
    • Marketing Automation
    • Surveys
    Services
    • Project
    • Timesheets
    • Field Service
    • Helpdesk
    • Planning
    • Appointments
    Productivity
    • Discuss
    • Approvals
    • IoT
    • VoIP
    • Knowledge
    • WhatsApp
    Third party apps Odoo Studio Odoo Cloud Platform
  • Industries
    Retail
    • Book Store
    • Clothing Store
    • Furniture Store
    • Grocery Store
    • Hardware Store
    • Toy Store
    Food & Hospitality
    • Bar and Pub
    • Restaurant
    • Fast Food
    • Guest House
    • Beverage Distributor
    • Hotel
    Real Estate
    • Real Estate Agency
    • Architecture Firm
    • Construction
    • Estate Management
    • Gardening
    • Property Owner Association
    Consulting
    • Accounting Firm
    • Odoo Partner
    • Marketing Agency
    • Law firm
    • Talent Acquisition
    • Audit & Certification
    Manufacturing
    • Textile
    • Metal
    • Furnitures
    • Food
    • Brewery
    • Corporate Gifts
    Health & Fitness
    • Sports Club
    • Eyewear Store
    • Fitness Center
    • Wellness Practitioners
    • Pharmacy
    • Hair Salon
    Trades
    • Handyman
    • IT Hardware & Support
    • Solar Energy Systems
    • Shoe Maker
    • Cleaning Services
    • HVAC Services
    Others
    • Nonprofit Organization
    • Environmental Agency
    • Billboard Rental
    • Photography
    • Bike Leasing
    • Software Reseller
    Browse all Industries
  • Community
    Learn
    • Tutorials
    • Documentation
    • Certifications
    • Training
    • Blog
    • Podcast
    Empower Education
    • Education Program
    • Scale Up! Business Game
    • Visit Odoo
    Get the Software
    • Download
    • Compare Editions
    • Releases
    Collaborate
    • Github
    • Forum
    • Events
    • Translations
    • Become a Partner
    • Services for Partners
    • Register your Accounting Firm
    Get Services
    • Find a Partner
    • Find an Accountant
    • Meet an advisor
    • Implementation Services
    • Customer References
    • Support
    • Upgrades
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Get a demo
  • Pricing
  • Help

Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:

  • CRM
  • e-Commerce
  • Knjigovodstvo
  • Zaloga
  • PoS
  • Projekt
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
Ključne besede (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Ključne besede (View all)
odoo accounting v14 pos v15
About this forum
Pomoč

How to create custom decorations in the tree view?

Naroči se

Get notified when there's activity on this post

This question has been flagged
treeviewdecorationv15
3 Odgovori
9357 Prikazi
Avatar
Guillaume Deflaux

Hi,

I'd like to know if it's possible to define custom decorations for the tree view or if there is a way to specify custom colors for lines.

Thanks!

0
Avatar
Opusti
Ibrahim Boudmir

Hi,

Possible decorations are listed here: https://www.odoo.com/fr_FR/forum/aide-1/what-are-the-possibilities-of-decoration-100630

you can check in code how they are defined and add, likewise, your custom ones.

Guillaume Deflaux
Avtor

Thanks!

Sehrish

Decoration in Tree View: https://learnopenerp.blogspot.com/2022/05/decorate-text-bold-italic-colors-field-in-tree-view-column-odoo-15.html

Avatar
Cybrosys Techno Solutions Pvt.Ltd
Best Answer

Hi,


Try referring the blog on How to Add Colors to Tree View in Odoo 15 :  https://www.cybrosys.com/blog/how-to-add-colors-to-tree-view-in-odoo-15


Hope it helps

0
Avatar
Opusti
Avatar
Gaston Carrera
Best Answer

Hi! I was able to create one IN ODOO 12!, but i needed to modify some little things in the base and web modules, wich isnt too recomended, but are little changes without risk of "watefall failure"

(essentialy i search in base and web the appears of "decoration-success" together with the other decorators and repast him defining for "decoration-customized1" , and finally creating in one .css  in my main module the style for o_list_view o_data_row o_text-customized1)


1)  base-> ir_ui_view python

add in ATTRS_WITH_FIELD_NAMES the


    'decoration-customized1',


2) in web/static/src/js/views/list/list_renderer.js

in var DECORATIONS = add


    'decoration-customized1',


3) in base/rng/tree_view.rng add:


            <rng:optional><rng:attribute name="decoration-customized1"/></rng:optional>


4)in my main module in

static/src/css/your_custom_classes.css define the style, for example:



.o_list_view .o_data_row.decoration-customized1 {


    background-color: #ffe4b5 !important; /* ejemplo: un beige suave */


    color: #000000 !important; /* texto rojo oscuro */


}


.o_list_view .o_data_row.text-customized1 {


    background-color: #ffe4b5 !important; /* ejemplo: un beige suave */


    color: #000000 !important; /* texto rojo oscuro */


}


5) and then in my main module

views/assets.xml declare


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


<odoo>


  <data>


    <!-- Carga JS y CSS en backend -->


    <template id="assets_backend" inherit_id="web.assets_backend" name="Abatar Trucks Assets">


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


        <link rel="stylesheet" type="text/css" href="/your_custom_module/static/src/css/your_custom_classes.css"/>


      </xpath>


    </template>


  </data>


</odoo>




6) add the "assets.xml" in your manifest declaration



This had to be enough.

If some dont work i call some modifys additionals that made, but im not sure about if are essentially necessary:


in web/static/lib/bootstrap/css/bootstrap.css


.text-customized1 {


  color: #000000 !important;


}




a.text-customized1:hover, a.text-customized1:focus {


  color: #555555 !important;


}



in web/static/lib/bootstrap/scss/_variables.scss

here are some color definitions that can create

replying the "succes" or "mute" for

customized1



and in web/static/lib/bootstrap/scss/utilities/_text.scss 

too


I hope that be useful like a guide at least!

0
Avatar
Opusti
Avatar
Jainesh Shah(Aktiv Software)
Best Answer

Hi Guillaume Deflaux,

Can you please check the below link to define custom decorations for the tree view with specify custom colors for lines:

https://www.cybrosys.com/blog/add-colors-to-tree-view-odoo-13

I Hope this will help you. 

Thanks & Regards,
Email: odoo@aktivsoftware.com
Skype: kalpeshmaheshwari

0
Avatar
Opusti
Enjoying the discussion? Don't just read, join in!

Create an account today to enjoy exclusive features and engage with our awesome community!

Prijavi
Related Posts Odgovori Prikazi Aktivnost
Hide column in list view based on context/domain
treeview v15
Avatar
Avatar
1
maj 22
4054
Call an intermediate wizard on Create or Delete button in a tree view
wizard treeview v15
Avatar
0
jan. 23
2678
CRM LEAD TREE (VIEW:LIST) DECORATION Solved
many2one decoration v15
Avatar
Avatar
Avatar
2
feb. 22
3564
Auto refresh tree view Solved
treeview automated refresh v15
Avatar
Avatar
1
jun. 23
5843
How to change the list view color for dates in odoo ?
treeview listview odoo11 decoration
Avatar
Avatar
Avatar
Avatar
3
apr. 21
6601
Community
  • Tutorials
  • Documentation
  • Forum
Open Source
  • Download
  • Github
  • Runbot
  • Translations
Services
  • Odoo.sh Hosting
  • Support
  • Upgrade
  • Custom Developments
  • Education
  • Find an Accountant
  • Find a Partner
  • Become a Partner
About us
  • Our company
  • Brand Assets
  • Contact us
  • Jobs
  • Events
  • Podcast
  • Blog
  • Customers
  • Legal • Privacy
  • Security
الْعَرَبيّة Català 简体中文 繁體中文 (台灣) Čeština Dansk Nederlands English Suomi Français Deutsch हिंदी Bahasa Indonesia Italiano 日本語 한국어 (KR) Lietuvių kalba Język polski Português (BR) română русский язык Slovenský jazyk slovenščina Español (América Latina) Español ภาษาไทย Türkçe українська Tiếng Việt

Odoo is a suite of open source business apps that cover all your company needs: CRM, eCommerce, accounting, inventory, point of sale, project management, etc.

Odoo's unique value proposition is to be at the same time very easy to use and fully integrated.

Website made with

Odoo Experience on YouTube

1. Use the live chat to ask your questions.
2. The operator answers within a few minutes.

Live support on Youtube
Watch now