跳至內容
選單
此問題已被標幟
1 回覆
2693 瀏覽次數


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
2237
1
6月 23
2908
0
3月 24
3012
1
6月 23
3093
3
8月 25
2336