Перейти к содержимому
Меню
Чтобы взаимодействовать с сообществом, необходимо зарегистрироваться.
Этот вопрос был отмечен
1 Ответить
2695 Представления


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'),])

    

    

   

Аватар
Отменить
Лучший ответ

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


Аватар
Отменить
Related Posts Ответы Просмотры Активность
1
июл. 23
2238
1
июн. 23
2908
0
мар. 24
3012
1
июн. 23
3094
3
авг. 25
2342