diff options
| author | Indoteknik . <it@fixcomart.co.id> | 2025-08-06 11:22:37 +0700 |
|---|---|---|
| committer | Indoteknik . <it@fixcomart.co.id> | 2025-08-06 11:22:37 +0700 |
| commit | 33621956bdb9d807b480eda44ce7f2152f508695 (patch) | |
| tree | 89f18f905f71dc0c39a9b891b3c671de0b5fdaea /indoteknik_custom/models/down_payment.py | |
| parent | 4a995bd555f1c9c766941cc4ad1286e60beb524b (diff) | |
(andri) add button check/uncheck all line use PUM
Diffstat (limited to 'indoteknik_custom/models/down_payment.py')
| -rw-r--r-- | indoteknik_custom/models/down_payment.py | 16 |
1 files changed, 16 insertions, 0 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': |
