Ir al contenido
Menú
Se marcó esta pregunta
1 Responder
2694 Vistas


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
Descartar
Mejor respuesta

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
Descartar
Publicaciones relacionadas Respuestas Vistas Actividad
1
jul 23
2238
1
jun 23
2908
0
mar 24
3012
1
jun 23
3094
3
ago 25
2340