summaryrefslogtreecommitdiff
path: root/indoteknik_custom/models/user_pengajuan_tempo_request.py
diff options
context:
space:
mode:
authorAzka Nathan <darizkyfaz@gmail.com>2025-02-19 09:39:37 +0700
committerAzka Nathan <darizkyfaz@gmail.com>2025-02-19 09:39:37 +0700
commit069b3ba1af8025c75a5a1c2a772137aafb428a85 (patch)
tree980d045c3600d38ae832a45482c7dc62e3fbf730 /indoteknik_custom/models/user_pengajuan_tempo_request.py
parent10c0cd096353397ce26ad13b6967a35d13072fb6 (diff)
parenta9abc6b63f1bafb1e007da4446636ec2da10d493 (diff)
Merge branch 'odoo-production' of bitbucket.org:altafixco/indoteknik-addons into odoo-production
Diffstat (limited to 'indoteknik_custom/models/user_pengajuan_tempo_request.py')
-rw-r--r--indoteknik_custom/models/user_pengajuan_tempo_request.py13
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)