From 8b1751b59297e27e123579670618e4d0dd031198 Mon Sep 17 00:00:00 2001 From: HafidBuroiroh Date: Wed, 10 Dec 2025 14:24:17 +0700 Subject: bug journal bca --- indoteknik_custom/models/sale_order.py | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) (limited to 'indoteknik_custom/models/sale_order.py') diff --git a/indoteknik_custom/models/sale_order.py b/indoteknik_custom/models/sale_order.py index 2ed4046f..94735617 100755 --- a/indoteknik_custom/models/sale_order.py +++ b/indoteknik_custom/models/sale_order.py @@ -3443,16 +3443,20 @@ class SaleOrder(models.Model): ('journal_id', '=', 11), ('state', '=', 'posted'), ]) - piutangbca = self.env['account.move'].search([ - ('ref', 'in', invoice_ids.mapped('name')), - ('journal_id', '=', 4), - ('state', '=', 'posted'), - ]) - piutangmdr = self.env['account.move'].search([ - ('ref', 'in', invoice_ids.mapped('name')), - ('journal_id', '=', 7), - ('state', '=', 'posted'), - ]) + piutangbca = self.env['account.move'] + piutangmdr = self.env['account.move'] + + for inv_name in invoice_ids.mapped('name'): + piutangbca |= self.env['account.move'].search([ + ('ref', 'ilike', inv_name), + ('journal_id', '=', 4), + ('state', '=', 'posted'), + ]) + piutangmdr |= self.env['account.move'].search([ + ('ref', 'ilike', inv_name), + ('journal_id', '=', 7), + ('state', '=', 'posted'), + ]) moves2 = self.env['account.move'].search([ ('ref', 'ilike', self.name), -- cgit v1.2.3