Skip to Content
Odoo Meniu
  • Autentificare
  • Try it free
  • Aplicații
    Finanțe
    • Contabilitate
    • Facturare
    • Cheltuieli
    • Spreadsheet (BI)
    • Documente
    • Semn
    Vânzări
    • CRM
    • Vânzări
    • POS Shop
    • POS Restaurant
    • Abonamente
    • Închiriere
    Site-uri web
    • Constructor de site-uri
    • eCommerce
    • Blog
    • Forum
    • Live Chat
    • eLearning
    Lanț Aprovizionare
    • Inventar
    • Producție
    • PLM
    • Achiziție
    • Maintenance
    • Calitate
    Resurse Umane
    • Angajați
    • Recrutare
    • Time Off
    • Evaluări
    • Referințe
    • Flotă
    Marketing
    • Social Marketing
    • Marketing prin email
    • SMS Marketing
    • Evenimente
    • Automatizare marketing
    • Sondaje
    Servicii
    • Proiect
    • Foi de pontaj
    • Servicii de teren
    • Centru de asistență
    • Planificare
    • Programări
    Productivitate
    • Discuss
    • Aprobări
    • IoT
    • VoIP
    • Knowledge
    • WhatsApp
    Aplicații Terțe Odoo Studio Platforma Odoo Cloud
  • Industrii
    Retail
    • Book Store
    • Magazin de îmbrăcăminte
    • Magazin de Mobilă
    • Magazin alimentar
    • Magazin de materiale de construcții
    • Magazin de jucării
    Food & Hospitality
    • Bar and Pub
    • Restaurant
    • Fast Food
    • Guest House
    • Distribuitor de băuturi
    • Hotel
    Proprietate imobiliara
    • Real Estate Agency
    • Firmă de Arhitectură
    • Construcție
    • Estate Managament
    • Grădinărit
    • Asociația Proprietarilor de Proprietăți
    Consultanta
    • Firma de Contabilitate
    • Partener Odoo
    • Agenție de marketing
    • Law firm
    • Atragere de talente
    • Audit & Certification
    Producție
    • Textil
    • Metal
    • Mobilier
    • Mâncare
    • Brewery
    • Cadouri corporate
    Health & Fitness
    • Club Sportiv
    • Magazin de ochelari
    • Centru de Fitness
    • Wellness Practitioners
    • Farmacie
    • Salon de coafură
    Trades
    • Handyman
    • IT Hardware and Support
    • Asigurare socială de stat
    • Cizmar
    • Servicii de curățenie
    • HVAC Services
    Altele
    • Organizație nonprofit
    • Agenție de Mediu
    • Închiriere panouri publicitare
    • Fotografie
    • Închiriere biciclete
    • Asigurare socială
    Browse all Industries
  • Comunitate
    Învăță
    • Tutorials
    • Documentație
    • Certificări
    • Instruire
    • Blog
    • Podcast
    Empower Education
    • Program Educațional
    • Scale Up! Business Game
    • Visit Odoo
    Obține Software-ul
    • Descărcare
    • Compară Edițiile
    • Lansări
    Colaborați
    • Github
    • Forum
    • Evenimente
    • Translations
    • Devino Partener
    • Services for Partners
    • Înregistrează-ți Firma de Contabilitate
    Obține Servicii
    • Găsește un Partener
    • Găsiți un contabil
    • Meet an advisor
    • Servicii de Implementare
    • Referințe ale clienților
    • Suport
    • Actualizări
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Obține un demo
  • Prețuri
  • Ajutor

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

  • CRM
  • e-Commerce
  • Contabilitate
  • Inventar
  • PoS
  • Proiect
  • MRP
All apps
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
All Posts Oameni Insigne
Etichete (View all)
odoo accounting v14 pos v15
Despre acest forum
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
All Posts Oameni Insigne
Etichete (View all)
odoo accounting v14 pos v15
Despre acest forum
Suport

how to invisible graph bar in kanban

Abonare

Primiți o notificare când există activitate la acestă postare

Această întrebare a fost marcată
graphkanbaninvisiblecardbar
2 Răspunsuri
2129 Vizualizări
Imagine profil
Uzair
.py:
colon_data = fields.Boolean('Colon Data',store=True,default=True) count_data = fields.Integer(string='Data check') @api.onchange('plot_colonization_ids') def compute_count_data(self): for rec in self: total_plot_no = 0 for line in rec.plot_colonization_ids: if line.plot_no: rec.count_data += int(line.plot_no) if rec.count_data > 0: self.colon_data = True elif rec.count_data == 0: self.colon_data = False

i use the following code for a graph in kanban card if there is data graph will be shown otherwise graph will not visible but there are few issue first i need the colonization heading should be invisble for those kanban card which has no data in graph, second thing is if there is no data in graph then the remaining graphs should be adjustable which is not adjust right now in sense of space occupying in kanban card

``​`

Colonization

```

0
Imagine profil
Abandonează
Imagine profil
Shajahan
Cel mai bun răspuns

To address the issues you're facing with the Odoo customization involving graphs on Kanban cards, there are a couple of modifications and clarifications needed in both your backend Python code and your frontend XML/JavaScript.

Python Code Corrections

First, let's correct and optimize your Python code. Your existing code seems to have an intention of counting some data related to plot_colonization_ids. However, there are a few issues in how you handle the counting and setting of colon_data. Here’s a refined version:

pythonCopy codefrom odoo import models, fields, api

class YourModelName(models.Model):
    _name = 'your.model.name'
    _description = 'Model Description'

    colon_data = fields.Boolean('Colon Data', store=True, default=True)
    count_data = fields.Integer(string='Data Check', compute='_compute_count_data', store=True)

    @api.depends('plot_colonization_ids.plot_no')
    def _compute_count_data(self):
        for rec in self:
            rec.count_data = sum(int(line.plot_no or 0) for line in rec.plot_colonization_ids)
            rec.colon_data = rec.count_data > 0

Key Changes:

  • I added @api.depends decorator to properly trigger the compute method when plot_colonization_ids.plot_no changes.
  • Used list comprehension for summation to make the calculation more Pythonic and efficient.
  • Removed the loop that was redundantly resetting colon_data for every record in the compute method, and instead directly set colon_data based on count_data.

Frontend XML/JS Adjustments

For your requirements on the Kanban card:

  1. Hiding the Colonization Heading on Kanban cards without data: You can use the attrs attribute in your XML to conditionally hide elements based on colon_data.
xmlCopy code
    
        

Colonization Data

  1. Adjusting Space for Kanban cards with no data: This typically requires custom CSS or adjustments in JavaScript to ensure that the layout adapts to the absence of certain elements. Here’s an idea on how to approach it using CSS:
cssCopy code

For dynamic behavior adjustments in the Kanban view, depending on whether the customization is heavy, you might also need to extend the Kanban view's JavaScript part using Odoo's JavaScript framework to manipulate the DOM based on colon_data.

These are the foundational adjustments needed. Depending on your specific module and setup, additional modifications might be required to perfectly fit your requirements.

0
Imagine profil
Abandonează
Imagine profil
Uzair
Autor Cel mai bun răspuns

Thank you! by using css,js and the optimization of python worked for me.

0
Imagine profil
Abandonează
Enjoying the discussion? Don't just read, join in!

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

Înscrie-te
Related Posts Răspunsuri Vizualizări Activitate
Graph bar in kanban
graph kanban card bar odoo
Imagine profil
Imagine profil
Imagine profil
2
mai 24
2738
How to conditionally invisible field in a graph view in Odoo
graph invisible Odoo 18
Imagine profil
Imagine profil
1
mai 25
1512
How to have multiple bars per item on the x-axis on graph view?
development graph bar
Imagine profil
Imagine profil
Imagine profil
2
sept. 23
12374
kanban view inherit fields and make invisible Rezolvat
inheritance kanban invisible
Imagine profil
Imagine profil
Imagine profil
2
ian. 24
15287
How to make bar graph colored like the pie graph in OpenERP 7.0 ??
graph openerp7 bar
Imagine profil
0
apr. 15
5418
Comunitate
  • Tutorials
  • Documentație
  • Forum
Open Source
  • Descărcare
  • Github
  • Runbot
  • Translations
Servicii
  • Hosting Odoo.sh
  • Suport
  • Actualizare
  • Custom Developments
  • Educație
  • Găsiți un contabil
  • Găsește un Partener
  • Devino Partener
Despre Noi
  • Compania noastră
  • Active de marcă
  • Contactați-ne
  • Locuri de muncă
  • Evenimente
  • Podcast
  • Blog
  • Clienți
  • Aspecte juridice • Confidențialitate
  • Securitate
الْعَرَبيّة 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 este o suită de aplicații de afaceri open source care acoperă toate nevoile companiei dvs.: CRM, comerț electronic, contabilitate, inventar, punct de vânzare, management de proiect etc.

Propunerea de valoare unică a Odoo este să fie în același timp foarte ușor de utilizat și complet integrat.

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