diff options
| author | HafidBuroiroh <hafidburoiroh09@gmail.com> | 2025-10-07 10:27:52 +0700 |
|---|---|---|
| committer | HafidBuroiroh <hafidburoiroh09@gmail.com> | 2025-10-07 10:27:52 +0700 |
| commit | 540690de9d9da5805671f047151bf1d09d98c07c (patch) | |
| tree | 8d2cf29623d3176551bcc1aa80e67b5d45c79340 | |
| parent | e6bd4a34387c344835f738ba346697931171c252 (diff) | |
push
| -rw-r--r-- | indoteknik_custom/models/refund_sale_order.py | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/indoteknik_custom/models/refund_sale_order.py b/indoteknik_custom/models/refund_sale_order.py index a866af6e..f9adeeff 100644 --- a/indoteknik_custom/models/refund_sale_order.py +++ b/indoteknik_custom/models/refund_sale_order.py @@ -643,12 +643,14 @@ class RefundSaleOrder(models.Model): ('journal_id', '=', 7), ('state', '=', 'posted'), ]) - misc = self.env['account.move'].search([ - ('ref', 'ilike', all_invoices.mapped('name')[0]), - ('ref', 'not ilike', 'reklas'), - ('journal_id', '=', 13), - ('state', '=', 'posted'), - ]) + misc = self.env['account.move'] + if all_invoices: + misc = self.env['account.move'].search([ + ('ref', 'ilike', all_invoices.mapped('name')[0]), + ('ref', 'not ilike', 'reklas'), + ('journal_id', '=', 13), + ('state', '=', 'posted'), + ]) moves2 = self.env['account.move'] if so_ids: so_records = self.env['sale.order'].browse(so_ids) |
