Skip to Content
Menu
This question has been flagged
1 Reply
2452 Views


i want to change the dot to change color green if active and red if not active
anyone know how?

this is my code below

        dokter.rumah.sakit.view.tree

        dokter.rumah.sakit

       

           

               

               

               

               

               

               

               

               

               

               

           

       

   

from odoo import models, fields, api


class DokterRumahSakit(models.Model):

    _name = 'dokter.rumah.sakit'

    _description = 'dokter rumah sakit'


    id = fields.Char(string='ID Dokter')

    Nama = fields.Char(string='Nama Dokter')

    Alamat = fields.Text(string='Alamat Dokter')

    Tanggal = fields.Date(string='Tanggal Lahir Dokter')

    Tampilkan_Salary = fields.Boolean(string='tampilkan salary', default=False)

    Salary = fields.Float(string='Gaji', readonly=True)

    Rumah_Sakit = fields.Many2one(comodel_name='rumah.sakit', 

                                  string='Rumah Sakit')

    Spesialisasi = fields.Many2one(comodel_name='spesialisasi.penyakit', 

                                   string='Spesialisasi')

    state = fields.Selection(string='', selection=[('active', 'Active'), 

                                                   ('not_active', 'Not Active'),])

    

    

   

Avatar
Discard
Best Answer

You can learn from the examble of https://github.com/odoo/odoo/blob/0fa2ce8212077facace67a0072aa4ddebc9b55f0/addons/project/models/project.py#L401

Hope this help, if it does please up vote me and make this into best answer, thanks


Avatar
Discard
Related Posts Replies Views Activity
1
Jul 23
2073
1
Jun 23
2746
0
Mar 24
2813
1
Jun 23
2892
1
May 25
2136