diff options
| author | it-fixcomart <it@fixcomart.co.id> | 2025-02-17 08:36:01 +0700 |
|---|---|---|
| committer | it-fixcomart <it@fixcomart.co.id> | 2025-02-17 08:36:01 +0700 |
| commit | 9bd46f112fdfb4fb7f56866b4e260efbd26c6daa (patch) | |
| tree | d1327c128294c5a51bdf812e901d9a3b829a5ed4 /indoteknik_custom/models | |
| parent | 78a7df26d09b64fb9b3b45084212cbf19c1907a1 (diff) | |
<iman> renca req tempo status
Diffstat (limited to 'indoteknik_custom/models')
| -rw-r--r-- | indoteknik_custom/models/user_pengajuan_tempo_request.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/indoteknik_custom/models/user_pengajuan_tempo_request.py b/indoteknik_custom/models/user_pengajuan_tempo_request.py index 4a1994fb..be4293a0 100644 --- a/indoteknik_custom/models/user_pengajuan_tempo_request.py +++ b/indoteknik_custom/models/user_pengajuan_tempo_request.py @@ -63,6 +63,19 @@ class UserPengajuanTempoRequest(models.Model): ('reject', 'Rejected'), ], string='Status',) reason_reject = fields.Char(string='Reason Reaject', tracking=True, track_visibility='onchange') + state_tempo_text = fields.Char(string="Status", compute="_compute_state_tempo_text") + + @api.depends('state_tempo') + def _compute_state_tempo_text(self): + for record in self: + status_mapping = { + 'draft': "Menunggu Approve Manager", + 'approval_sales': "Menunggu Approve Finance", + 'approval_finance': "Menunggu Approve Direktur", + 'approval_director': "Approved", + 'reject': "Rejected", + } + record.state_tempo_text = status_mapping.get(record.state_tempo, "Unknown") # informasi perusahaan name_tempo = fields.Many2one('res.partner', string='Nama Perusahaan', related='pengajuan_tempo_id.name_tempo', store=True, tracking=True, readonly=False) |
