summaryrefslogtreecommitdiff
path: root/indoteknik_custom/models
diff options
context:
space:
mode:
authorMqdd <ahmadmiqdad27@gmail.com>2026-03-05 15:18:50 +0700
committerMqdd <ahmadmiqdad27@gmail.com>2026-03-05 15:18:50 +0700
commite3385d7f17ec3817b562cc1d9045b633ead00487 (patch)
tree7c61c1e1f87a4d78f86e4724c830d5e379029901 /indoteknik_custom/models
parent633087b3d49f880a9fbc90aac6b1275f224f2083 (diff)
<Miqdad> done. TODO line
Diffstat (limited to 'indoteknik_custom/models')
-rw-r--r--indoteknik_custom/models/upah_harian_office.py20
1 files changed, 16 insertions, 4 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: