Skip to Content
Odoo Menu
  • Log ind
  • Prøv gratis
  • apps
    Økonomi
    • Bogføring
    • Fakturering
    • Udgifter
    • Regneark (BI)
    • Dokumenter
    • e-Signatur
    Salg
    • CRM
    • Salg
    • POS Butik
    • POS Restaurant
    • Abonnementer
    • Udlejning
    Hjemmeside
    • Hjemmesidebygger
    • e-Handel
    • Blog
    • Forum
    • LiveChat
    • e-Læring
    Forsyningskæde
    • Lagerbeholdning
    • Produktion
    • PLM
    • Indkøb
    • Vedligeholdelse
    • Kvalitet
    HR
    • Medarbejdere
    • Rekruttering
    • Fravær
    • Medarbejdersamtaler
    • Anbefalinger
    • Flåde
    Marketing
    • Markedsføring på sociale medier
    • E-mailmarketing
    • SMS-marketing
    • Arrangementer
    • Automatiseret marketing
    • Spørgeundersøgelser
    Tjenester
    • Projekt
    • Timesedler
    • Udkørende Service
    • Kundeservice
    • Planlægning
    • Aftaler
    Produktivitet
    • Dialog
    • Godkendelser
    • IoT
    • VoIP
    • Vidensdeling
    • WhatsApp
    Tredjepartsapps Odoo Studio Odoo Cloud-platform
  • Brancher
    Detailhandel
    • Boghandel
    • Tøjforretning
    • Møbelforretning
    • Dagligvarebutik
    • Byggemarked
    • Legetøjsforretning
    Mad og værtsskab
    • Bar og pub
    • Restaurant
    • Fastfood
    • Gæstehus
    • Drikkevareforhandler
    • Hotel
    Ejendom
    • Ejendomsmægler
    • Arkitektfirma
    • Byggeri
    • Ejendomsadministration
    • Havearbejde
    • Boligejerforening
    Rådgivning
    • Regnskabsfirma
    • Odoo-partner
    • Marketingbureau
    • Advokatfirma
    • Rekruttering
    • Audit & certificering
    Produktion
    • Tekstil
    • Metal
    • Møbler
    • Fødevareproduktion
    • Bryggeri
    • Firmagave
    Heldbred & Fitness
    • Sportsklub
    • Optiker
    • Fitnesscenter
    • Kosmetolog
    • Apotek
    • Frisør
    Håndværk
    • Handyman
    • IT-hardware og support
    • Solenergisystemer
    • Skomager
    • Rengøringsservicer
    • VVS- og ventilationsservice
    Andet
    • Nonprofitorganisation
    • Miljøagentur
    • Udlejning af billboards
    • Fotografi
    • Cykeludlejning
    • Softwareforhandler
    Gennemse alle brancher
  • Community
    Få mere at vide
    • Tutorials
    • Dokumentation
    • Certificeringer
    • Oplæring
    • Blog
    • Podcast
    Bliv klogere
    • Udannelselsesprogram
    • Scale Up!-virksomhedsspillet
    • Besøg Odoo
    Få softwaren
    • Download
    • Sammenlign versioner
    • Udgaver
    Samarbejde
    • Github
    • Forum
    • Arrangementer
    • Oversættelser
    • Bliv partner
    • Tjenester til partnere
    • Registrér dit regnskabsfirma
    Modtag tjenester
    • Find en partner
    • Find en bogholder
    • Kontakt en rådgiver
    • Implementeringstjenester
    • Kundereferencer
    • Support
    • Opgraderinger
    Github Youtube Twitter LinkedIn Instagram Facebook Spotify
    +1 (650) 691-3277
    Få en demo
  • Prissætning
  • Hjælp

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

  • CRM
  • e-Commerce
  • Bogføring
  • Lager
  • PoS
  • Projekt
  • MRP
All apps
Du skal være registreret for at interagere med fællesskabet.
All Posts People Emblemer
Tags (View all)
odoo accounting v14 pos v15
Om dette forum
Du skal være registreret for at interagere med fællesskabet.
All Posts People Emblemer
Tags (View all)
odoo accounting v14 pos v15
Om dette forum
Hjælp

how to invisible graph bar in kanban

Tilmeld

Få besked, når der er aktivitet på dette indlæg

Dette spørgsmål er blevet anmeldt
graphkanbaninvisiblecardbar
2 Besvarelser
2134 Visninger
Avatar
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
Avatar
Kassér
Avatar
Shajahan
Bedste svar

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
Avatar
Kassér
Avatar
Uzair
Forfatter Bedste svar

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

0
Avatar
Kassér
Enjoying the discussion? Don't just read, join in!

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

Tilmeld dig
Related Posts Besvarelser Visninger Aktivitet
Graph bar in kanban
graph kanban card bar odoo
Avatar
Avatar
Avatar
2
maj 24
2740
How to conditionally invisible field in a graph view in Odoo
graph invisible Odoo 18
Avatar
Avatar
1
maj 25
1515
How to have multiple bars per item on the x-axis on graph view?
development graph bar
Avatar
Avatar
Avatar
2
sep. 23
12376
kanban view inherit fields and make invisible Løst
inheritance kanban invisible
Avatar
Avatar
Avatar
2
jan. 24
15291
How to make bar graph colored like the pie graph in OpenERP 7.0 ??
graph openerp7 bar
Avatar
0
apr. 15
5420
Community
  • Tutorials
  • Dokumentation
  • Forum
Open Source
  • Download
  • Github
  • Runbot
  • Oversættelser
Tjenester
  • Odoo.sh-hosting
  • Support
  • Opgradere
  • Individuelt tilpasset udvikling
  • Uddannelse
  • Find en bogholder
  • Find en partner
  • Bliv partner
Om os
  • Vores virksomhed
  • Brandaktiver
  • Kontakt os
  • Stillinger
  • Arrangementer
  • Podcast
  • Blog
  • Kunder
  • Juridiske dokumenter • Privatlivspolitik
  • Sikkerhedspolitik
الْعَرَبيّة 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 er en samling open source-forretningsapps, der dækker alle dine virksomhedsbehov – lige fra CRM, e-handel og bogføring til lagerstyring, POS, projektledelse og meget mere.

Det unikke ved Odoo er, at systemet både er brugervenligt og fuldt integreret.

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