跳至内容
菜单
此问题已终结
1 回复
2678 查看


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


形象
丢弃
相关帖文 回复 查看 活动
1
7月 23
2229
1
6月 23
2902
0
3月 24
3003
1
6月 23
3085
3
8月 25
2274