From 56521e04d3ea44d9f0115ef327b48e2c97f92fcc Mon Sep 17 00:00:00 2001 From: "Indoteknik ." Date: Mon, 18 Aug 2025 13:39:21 +0700 Subject: (andri) fix --- indoteknik_custom/models/down_payment.py | 8 ++++---- indoteknik_custom/views/down_payment.xml | 2 +- indoteknik_custom/views/down_payment_realization.xml | 18 +++++++++++------- 3 files changed, 16 insertions(+), 12 deletions(-) diff --git a/indoteknik_custom/models/down_payment.py b/indoteknik_custom/models/down_payment.py index 9c200cca..1152fcbf 100644 --- a/indoteknik_custom/models/down_payment.py +++ b/indoteknik_custom/models/down_payment.py @@ -745,9 +745,9 @@ class RealizationDownPayment(models.Model): is_cab_visible = fields.Boolean(string='Is Journal Uang Muka Visible', compute='_compute_is_cab_visible') def action_toggle_check_attachment(self): - # ap_user_ids = [23, 9468] - # if self.env.user.id not in ap_user_ids: - # raise UserError('Hanya User AP yang dapat menggunakan tombol ini.') + ap_user_ids = [23, 9468] + if self.env.user.id not in ap_user_ids: + raise UserError('Hanya User AP yang dapat menggunakan tombol ini.') for rec in self: if not rec.penggunaan_line_ids: @@ -862,7 +862,7 @@ class RealizationDownPayment(models.Model): account_uang_muka = 403 # Tanggal pakai create_date atau hari ini - account_date = self.date_done_not_realized + account_date = self.date_done_not_realized or fields.Date.today() ref_label = f"Realisasi {self.pum_id.number} Biaya {self.pum_id.detail_note} ({cab_move.name})" diff --git a/indoteknik_custom/views/down_payment.xml b/indoteknik_custom/views/down_payment.xml index 8fd8fc76..020ed110 100644 --- a/indoteknik_custom/views/down_payment.xml +++ b/indoteknik_custom/views/down_payment.xml @@ -34,7 +34,7 @@ type="object" string="AP Only" class="btn-info" - attrs="{'invisible': [('status', '=', 'reject')]}"/> + attrs="{'invisible': ['|', ('status', '=', 'reject'), ('is_cab_visible', '=', True)]}"/> -