From e3385d7f17ec3817b562cc1d9045b633ead00487 Mon Sep 17 00:00:00 2001 From: Mqdd Date: Thu, 5 Mar 2026 15:18:50 +0700 Subject: done. TODO line --- indoteknik_custom/models/upah_harian_office.py | 20 ++++++++--- .../views/upah_harian_office_views.xml | 42 +++++++++++++++++++--- 2 files changed, 53 insertions(+), 9 deletions(-) diff --git a/indoteknik_custom/models/upah_harian_office.py b/indoteknik_custom/models/upah_harian_office.py index 7db56cdd..9666a304 100644 --- a/indoteknik_custom/models/upah_harian_office.py +++ b/indoteknik_custom/models/upah_harian_office.py @@ -6,8 +6,8 @@ class UpahHarianOffice(models.Model): _description = 'Upah Harian' _inherit = ['mail.thread', 'mail.activity.mixin'] - name = fields.Char() - pemohon = fields.Many2one('res.users', String='Pemohon', required=True) + name = fields.Char(readonly=True) + pemohon = fields.Many2one('res.users', String='Pemohon', required=True, domain = ([('active', '=', True), ('share', '=', False)])) tanggal = fields.Date('Tanggal Pengajuan', required=True) upah_harian = fields.Float('Upah Harian') notes = fields.Text('Notes') @@ -29,6 +29,18 @@ class UpahHarianOffice(models.Model): ], string='Departement Type', tracking=3, required=True) is_ganti_jam = fields.Boolean('Ganti Jam?', default="False") total_upah = fields.Float('Total Upah Harian', compute='_compute_total_upah') + attachment_file_image = fields.Binary(string='Attachment Image', attachment_filename='attachment_filename_image') + attachment_file_pdf = fields.Binary(string='Attachment PDF', attachment_filename='attachment_filename_pdf') + attachment_filename_image = fields.Char(string='Filename Image') + attachment_filename_pdf = fields.Char(string='Filename PDF') + + + @api.onchange('attachment_type') + def _onchange_attachment_type(self): + self.attachment_file_image = False + self.attachment_filename_image = False + self.attachment_file_pdf = False + self.attachment_filename_pdf = False @api.model def create(self, vals): @@ -73,10 +85,10 @@ class UpahHarianOfficeLine(models.Model): hari = fields.Char('Hari') jam_masuk = fields.Float('Jam Masuk', required=True) jam_keluar = fields.Float('Jam Keluar', required=True) - tanggal_line = fields.Datetime('Tanggal', required=True) + tanggal_line = fields.Date('Tanggal', required=True) kegiatan = fields.Char('Kegiatan', required=True) - jam = fields.Float('Jam', required=True) total_jam_kerja = fields.Float('Total Jam Kerja', compute='_compute_total_jam_kerja') + is_ganti_jam = fields.Boolean('Ganti Jam Kerja', default = False) def _compute_total_jam_kerja(self): for line in self: diff --git a/indoteknik_custom/views/upah_harian_office_views.xml b/indoteknik_custom/views/upah_harian_office_views.xml index 1ec681d1..9a0c3a2f 100644 --- a/indoteknik_custom/views/upah_harian_office_views.xml +++ b/indoteknik_custom/views/upah_harian_office_views.xml @@ -11,7 +11,6 @@ - @@ -22,7 +21,6 @@ upah.harian
-