From 33621956bdb9d807b480eda44ce7f2152f508695 Mon Sep 17 00:00:00 2001 From: "Indoteknik ." Date: Wed, 6 Aug 2025 11:22:37 +0700 Subject: (andri) add button check/uncheck all line use PUM --- indoteknik_custom/models/down_payment.py | 16 +++++++++++ .../views/down_payment_realization.xml | 31 ++++++++++++---------- 2 files changed, 33 insertions(+), 14 deletions(-) diff --git a/indoteknik_custom/models/down_payment.py b/indoteknik_custom/models/down_payment.py index 8d70aa69..5c7c3f49 100644 --- a/indoteknik_custom/models/down_payment.py +++ b/indoteknik_custom/models/down_payment.py @@ -714,6 +714,22 @@ class RealizationDownPayment(models.Model): move_id = fields.Many2one('account.move', string='Journal Entries', domain=[('move_type', '=', 'entry')]) 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.') + + for rec in self: + if not rec.penggunaan_line_ids: + continue + + if all(line.done_attachment for line in rec.penggunaan_line_ids): + for line in rec.penggunaan_line_ids: + line.done_attachment = False + else: + for line in rec.penggunaan_line_ids: + line.done_attachment = True + @api.onchange('lot_of_attachment') def _onchange_lot_of_attachment(self): if self.lot_of_attachment == 'one_for_all_line': diff --git a/indoteknik_custom/views/down_payment_realization.xml b/indoteknik_custom/views/down_payment_realization.xml index 3f52c2a4..b24727e6 100644 --- a/indoteknik_custom/views/down_payment_realization.xml +++ b/indoteknik_custom/views/down_payment_realization.xml @@ -48,6 +48,12 @@ + + + @@ -63,24 +69,14 @@
- - - - - - - - - - + + + @@ -134,6 +130,13 @@ +
+
+ @@ -142,7 +145,7 @@ - +
-- cgit v1.2.3