From 3df3f47dd4998d9abb21bfbae5b0f4e78d560c72 Mon Sep 17 00:00:00 2001 From: Mqdd Date: Wed, 4 Mar 2026 18:44:37 +0700 Subject: initial Commit --- indoteknik_custom/models/upah_harian_office.py | 43 ++++++++++++++++++++++++++ indoteknik_custom/views/ir_sequence.xml | 9 ++++++ 2 files changed, 52 insertions(+) create mode 100644 indoteknik_custom/models/upah_harian_office.py diff --git a/indoteknik_custom/models/upah_harian_office.py b/indoteknik_custom/models/upah_harian_office.py new file mode 100644 index 00000000..cc81530a --- /dev/null +++ b/indoteknik_custom/models/upah_harian_office.py @@ -0,0 +1,43 @@ +from odoo import models, fields, api + +class UpahHarianOffice(models.Model): + _name = 'upah.harian.office' + _description = 'Upah Harian Office' + + name = fields.Char() + upah_harian = fields.Float('Upah Harian', required=True) + pemohon = fields.Many2one('res.users', String='Pemohon', required=True) + tanggal = fields.Date('Tanggal Pengajuan', required=True) + state = fields.Selection([('draft', 'Draft'), ('done', 'Done')], default='draft') + attachment = fields.Binary('Attachment') + approved_by = fields.Char('Approved By') + attachment_type = fields.Selection([('pdf', 'PDF'), ('image', 'Image')]) + upah_harian_line = fields.One2many('upah.harian.line', 'upah_harian_id') + departement_type = fields.Selection([ + ('sales', 'Sales'), + ('merchandiser', 'Merchandiser'), + ('marketing', 'Marketing'), + ('logistic', 'Logistic'), + ('procurement', 'Procurement'), + ('fat', 'FAT'), + ('it', 'IT'), + ('hr_ga', 'HR & GA'), + ('pimpinan', 'Pimpinan') + ], string='Departement Type', tracking=3, required=True) + + @api.models + def create(self, vals): + vals['name'] = self.env['ir.sequence'].next_by_code('upah.harian.office') + return super(UpahHarianOffice, self).create(vals) + + + +class UpahHarianOfficeLine(models.Model): + _name = 'upah.harian.line' + _description = 'Upah Harian Line' + + name = fields.Char() + upah_harian_id = fields.Many2one('upah.harian.office') + tanggal_line = fields.Datetime('Tanggal', required=True) + kegiatan = fields.Char('Kegiatan', required=True) + jam = fields.Float('Jam', required=True) diff --git a/indoteknik_custom/views/ir_sequence.xml b/indoteknik_custom/views/ir_sequence.xml index 55e48300..aa56e46a 100644 --- a/indoteknik_custom/views/ir_sequence.xml +++ b/indoteknik_custom/views/ir_sequence.xml @@ -269,5 +269,14 @@ 1 1 + + + + upah.harian.office + UPHO/%(year)s/%(month)s/ + 4 + 1 + 1 + \ No newline at end of file -- cgit v1.2.3