diff options
| author | FIN-IT_AndriFP <it@fixcomart.co.id> | 2025-10-07 18:44:12 +0700 |
|---|---|---|
| committer | FIN-IT_AndriFP <it@fixcomart.co.id> | 2025-10-07 18:44:12 +0700 |
| commit | 776bc2d9f132050ceed95ef2a96eb1dcf8ad1c44 (patch) | |
| tree | c6004c87a0591f199408ea1d3850247526cbefd2 | |
| parent | ec5053921c0e858a4c33fb2cddf1152600831f7a (diff) | |
(andri) add button select & unselect all
| -rw-r--r-- | indoteknik_custom/models/letter_receivable.py | 12 | ||||
| -rw-r--r-- | indoteknik_custom/views/letter_receivable.xml | 16 |
2 files changed, 26 insertions, 2 deletions
diff --git a/indoteknik_custom/models/letter_receivable.py b/indoteknik_custom/models/letter_receivable.py index f75af92e..370e0909 100644 --- a/indoteknik_custom/models/letter_receivable.py +++ b/indoteknik_custom/models/letter_receivable.py @@ -69,6 +69,18 @@ class SuratPiutang(models.Model): "sp1": "sp2", "sp2": "sp3", } + + def action_select_all_lines(self): + for rec in self: + if not rec.line_ids: + raise UserError(_("Tidak ada invoice line untuk dipilih.")) + rec.line_ids.write({'selected': True}) + + def action_unselect_all_lines(self): + for rec in self: + if not rec.line_ids: + raise UserError(_("Tidak ada invoice line untuk dihapus seleksinya.")) + rec.line_ids.write({'selected': False}) @api.onchange('partner_id') def _onchange_partner_id_domain(self): diff --git a/indoteknik_custom/views/letter_receivable.xml b/indoteknik_custom/views/letter_receivable.xml index 98186862..3241d5f1 100644 --- a/indoteknik_custom/views/letter_receivable.xml +++ b/indoteknik_custom/views/letter_receivable.xml @@ -128,11 +128,23 @@ </div> </div> <div> + <button name="action_select_all_lines" + type="object" + string="Select All" + class="btn btn-secondary" + icon="fa-check-square"/> + <button name="action_unselect_all_lines" + type="object" + string="Unselect All" + class="btn btn-secondary" + icon="fa-square-o" + style="margin-left:5px;"/> <button name="action_refresh_lines" string="Refresh Invoices" type="object" - class="btn-primary" - style="margin-left:10px;" + class="btn btn-secondary" + icon="fa-refresh" + style="margin-left:5px;" help="Refresh Invoices agar data tetap update"/> </div> </div> |
