From 9606b73b33a01291ecbcb9154e32212ba5692bdb Mon Sep 17 00:00:00 2001 From: "Indoteknik ." Date: Mon, 28 Jul 2025 12:56:06 +0700 Subject: (andri) fix status done not realized --- indoteknik_custom/models/down_payment.py | 6 +++++- indoteknik_custom/views/down_payment.xml | 4 ++-- indoteknik_custom/views/ir_sequence.xml | 2 +- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/indoteknik_custom/models/down_payment.py b/indoteknik_custom/models/down_payment.py index 04dfbbc4..7889ac53 100644 --- a/indoteknik_custom/models/down_payment.py +++ b/indoteknik_custom/models/down_payment.py @@ -541,6 +541,8 @@ class RealizationDownPayment(models.Model): ('done_realized', 'Done Realized') ], string='Status Realisasi', tracking=3, default='remaining') + date_done_not_realized = fields.Date(string='Tanggal Done Not Realized', tracking=3) + currency_id = fields.Many2one( 'res.currency', string='Currency', default=lambda self: self.env.company.currency_id @@ -617,6 +619,7 @@ class RealizationDownPayment(models.Model): if self.done_status == 'remaining': self.done_status = 'done_not_realized' + self.date_done_not_realized = fields.Date.today() elif self.done_status == 'done_not_realized': self.done_status = 'done_realized' else: @@ -650,7 +653,7 @@ class RealizationDownPayment(models.Model): account_uang_muka = 403 # Tanggal pakai create_date atau hari ini - account_date = self.create_date.date() if self.create_date else fields.Date.today() + account_date = self.date_done_not_realized ref_label = f"Realisasi {self.pum_id.number} Biaya {self.pum_id.detail_note} ({cab_move.name})" @@ -768,6 +771,7 @@ class RealizationDownPayment(models.Model): rec.date_approved_pimpinan = now rec.position_pimpinan = 'Pimpinan' rec.status = 'approved' + rec.done_status = 'done_not_realized' # Set status done untuk realisasi rec.message_post( body=f"Approval Pimpinan oleh {self.env.user.name} " diff --git a/indoteknik_custom/views/down_payment.xml b/indoteknik_custom/views/down_payment.xml index 49306550..3c8d007e 100644 --- a/indoteknik_custom/views/down_payment.xml +++ b/indoteknik_custom/views/down_payment.xml @@ -10,7 +10,7 @@ type="object" string="Realisasi" class="btn-primary" - attrs="{'invisible': [('status', '=', 'reject')]}"/> + attrs="{'invisible': [('status', 'not in', 'approved')]}"/>