diff options
| author | Indoteknik . <it@fixcomart.co.id> | 2025-07-17 13:57:47 +0700 |
|---|---|---|
| committer | Indoteknik . <it@fixcomart.co.id> | 2025-07-17 13:57:47 +0700 |
| commit | 2fe077d802bf143b110bc681ac039ba8bcfccb26 (patch) | |
| tree | 708e6d2000e6ab720c0d3e6537b288f333086de0 | |
| parent | 861ceb85ad813050331200b41ba4fe08b314d08f (diff) | |
(andri) init action dll
| -rwxr-xr-x | indoteknik_custom/__manifest__.py | 1 | ||||
| -rwxr-xr-x | indoteknik_custom/models/__init__.py | 1 | ||||
| -rw-r--r-- | indoteknik_custom/models/down_payment.py | 49 | ||||
| -rwxr-xr-x | indoteknik_custom/security/ir.model.access.csv | 1 | ||||
| -rw-r--r-- | indoteknik_custom/views/down_payment.xml | 87 | ||||
| -rw-r--r-- | indoteknik_custom/views/ir_sequence.xml | 10 |
6 files changed, 140 insertions, 9 deletions
diff --git a/indoteknik_custom/__manifest__.py b/indoteknik_custom/__manifest__.py index 21afc26f..7539f23f 100755 --- a/indoteknik_custom/__manifest__.py +++ b/indoteknik_custom/__manifest__.py @@ -170,6 +170,7 @@ 'views/public_holiday.xml', 'views/stock_inventory.xml', 'views/sale_order_delay.xml', + 'views/down_payment.xml', ], 'demo': [], 'css': [], diff --git a/indoteknik_custom/models/__init__.py b/indoteknik_custom/models/__init__.py index b815b472..1c54efc6 100755 --- a/indoteknik_custom/models/__init__.py +++ b/indoteknik_custom/models/__init__.py @@ -153,3 +153,4 @@ from . import sale_order_delay from . import approval_invoice_date from . import approval_payment_term # from . import patch +from . import down_payment diff --git a/indoteknik_custom/models/down_payment.py b/indoteknik_custom/models/down_payment.py index 8b57bc2f..7a3a39f1 100644 --- a/indoteknik_custom/models/down_payment.py +++ b/indoteknik_custom/models/down_payment.py @@ -5,13 +5,17 @@ from datetime import datetime import logging from terbilang import Terbilang import pytz +from pytz import timezone class DownPayment(models.Model): _name = 'down.payment' _description = 'Down Payment Management' + _rec_name = 'number' - number = fields.Char(string='No. Dokumen', required=True, tracking=3) + user_id = fields.Many2one('res.users', string='Diajukan Oleh', default=lambda self: self.env.user, tracking=3) + + number = fields.Char(string='No. Dokumen', default='New Draft', tracking=3) applicant_name = fields.Char(string='Nama Pemohon', tracking=3, required=True) nominal = fields.Float(string='Nominal', tracking=3, required=True) @@ -23,12 +27,12 @@ class DownPayment(models.Model): status = fields.Selection([ ('draft', 'Draft'), - ('pengajuan1', 'Approval Departement'), - ('pengajuan2', 'Approval AP'), - ('pengajuan3', 'Approval Pimpinan'), + ('pengajuan1', 'Menunggu Approval Departement'), + ('pengajuan2', 'Menunggu Pengecekan AP'), + ('pengajuan3', 'Menunggu Approval Pimpinan'), ('approved', 'Approved'), ('reject', 'Rejected') - ], string='Status Down Payment', default='draft', tracking=3) + ], string='Status', default='draft', tracking=3, index=True, track_visibility='onchange') status_pay_down_payment = fields.Selection([ ('pending', 'Pending'), @@ -37,7 +41,7 @@ class DownPayment(models.Model): departement_type = fields.Selection([ ('sales', 'Sales'), - ('md', 'MD'), + ('merchandiser', 'Merchandiser'), ('marketing', 'Marketing'), ('logistic', 'Logistic'), ('procurement', 'Procurement'), @@ -53,24 +57,50 @@ class DownPayment(models.Model): # --------------------------------------- # AP : Manzila (Finance) ID 23 - created_date = fields.Datetime(string='Created Date', default=lambda self: fields.Datetime.now(), tracking=3) + def action_realisasi_pum(self): + self.ensure_one() + # Logic untuk realisasi PUM + return + + def action_confirm_payment(self): + self.ensure_one() + # Logic untuk konfirmasi pembayaran + return + + def action_reject(self): + self.ensure_one() + # Logic untuk konfirmasi pembayaran + return + + def action_approval_check(self): + self.ensure_one() + # Logic untuk konfirmasi pembayaran + return + + @api.model + def create(self, vals): + if not vals.get('number') or vals['number'] == 'New Draft': + vals['number'] = self.env['ir.sequence'].next_by_code('down.payment') or 'New Draft' + return super(DownPayment, self).create(vals) + class RealizationDownPayment(models.Model): _name = 'realization.down.payment' _description = 'Realization Down Payment Management' + # number = fields.Char(string='No. Dokumen', tracking=3) title = fields.Char(string='Judul', required=True, tracking=3) goals = fields.Text(string='Tujuan', tracking=3, required=True) related = fields.Char(string='Terkait', tracking=3, required=True) - # Rincian Pemberian PUM + # Page Rincian Pemberian PUM date_line = fields.Date(string='Tanggal', required=True, tracking=3, default=lambda self: fields.Date.today()) info_line = fields.Char(string='Description', required=True, tracking=3) value_line = fields.Float(string='Nilai', required=True, tracking=3) grand_total = fields.Float(string='Grand Total', tracking=3) - # Rincian Penggunaan PUM + # Page Rincian Penggunaan PUM date_line_use = fields.Date(string='Tanggal', required=True, tracking=3, default=lambda self: fields.Date.today()) info_line_use = fields.Char(string='Description', required=True, tracking=3) value_line_use = fields.Float(string='Nominal', required=True, tracking=3) @@ -88,6 +118,7 @@ class RealizationDownPayment(models.Model): + diff --git a/indoteknik_custom/security/ir.model.access.csv b/indoteknik_custom/security/ir.model.access.csv index 2b970cfd..c4347709 100755 --- a/indoteknik_custom/security/ir.model.access.csv +++ b/indoteknik_custom/security/ir.model.access.csv @@ -183,3 +183,4 @@ access_production_purchase_match,access.production.purchase.match,model_producti access_image_carousel,access.image.carousel,model_image_carousel,,1,1,1,1 access_v_sale_notin_matchpo,access.v.sale.notin.matchpo,model_v_sale_notin_matchpo,,1,1,1,1 access_approval_payment_term,access.approval.payment.term,model_approval_payment_term,,1,1,1,1 +access_down_payment,access.down.payment,model_down_payment,,1,1,1,1
\ No newline at end of file diff --git a/indoteknik_custom/views/down_payment.xml b/indoteknik_custom/views/down_payment.xml new file mode 100644 index 00000000..f418b932 --- /dev/null +++ b/indoteknik_custom/views/down_payment.xml @@ -0,0 +1,87 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<odoo> + <record id="view_form_down_payment" model="ir.ui.view"> + <field name="name">down.payment.form</field> + <field name="model">down.payment</field> + <field name="arch" type="xml"> + <form string="Pengajuan Uang Muka (PUM)"> + <header> + <button name="action_realisasi_pum" + type="object" + string="Realisasi" + class="btn-primary" + attrs="{}"/> + <button name="action_reject" + type="object" + string="Reject" + attrs="{}"/> + <button name="action_confirm_payment" + type="object" + string="Konfirmasi Pembayaran" + attrs="{}"/> + <button name="action_approval_check" + type="object" + string="Checking/Approval" + attrs="{}"/> + <field name="status" widget="statusbar" + statusbar_visible="draft,pengajuan1,pengajuan2,pengajuan3,approved" + statusbar_colors='{"reject":"red"}' + readonly="1"/> + </header> + <sheet> + <h1> + <field name="number" readonly="1" class="oe_title"/> + </h1> + <group col="2"> + <group string=""> + <field name="applicant_name" colspan="2"/> + <field name="nominal" colspan="2"/> + <field name="bank_name" colspan="2"/> + <field name="account_name" colspan="2"/> + <field name="bank_account" colspan="2"/> + </group> + + <group string="" col="2"> + <field name="user_id" readonly="1"/> + <field name="departement_type"/> + <field name="status_pay_down_payment" readonly="1"/> + <field name="create_date" readonly="1"/> + </group> + </group> + + <group string=""> + <field name="detail_note"/> + </group> + </sheet> + </form> + </field> + </record> + <record id="view_tree_down_payment" model="ir.ui.view"> + <field name="name">down.payment.tree</field> + <field name="model">down.payment</field> + <field name="arch" type="xml"> + <tree> + <field name="number"/> + <field name="user_id" optional='hide'/> + <field name="applicant_name"/> + <field name="nominal"/> + <field name="departement_type" optional='hide'/> + <field name="status"/> + <field name="status_pay_down_payment"/> + </tree> + </field> + </record> + <record id="action_down_payment" model="ir.actions.act_window"> + <field name="name">Pengajuan Uang Muka (Down Payment)</field> + <field name="type">ir.actions.act_window</field> + <field name="res_model">down.payment</field> + <field name="view_mode">tree,form</field> + </record> + + <menuitem id="menu_down_payment" + name="Pengajuan Uang Muka (Down Payment)" + parent="sale.product_menu_catalog" + sequence="101" + action="action_down_payment" + /> +</odoo>
\ No newline at end of file diff --git a/indoteknik_custom/views/ir_sequence.xml b/indoteknik_custom/views/ir_sequence.xml index f2b42c3b..e959f562 100644 --- a/indoteknik_custom/views/ir_sequence.xml +++ b/indoteknik_custom/views/ir_sequence.xml @@ -200,5 +200,15 @@ <field name="number_next">1</field> <field name="number_increment">1</field> </record> + + <record id="sequence_down_payment" model="ir.sequence"> + <field name="name">Down Payment Sequence</field> + <field name="code">down.payment</field> + <field name="prefix">PUM/%(year)s/</field> + <field name="padding">5</field> + <field name="number_next">1</field> + <field name="number_increment">1</field> + <field name="active">True</field> + </record> </data> </odoo>
\ No newline at end of file |
