summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIT Fixcomart <it@fixcomart.co.id>2025-12-10 07:25:06 +0000
committerIT Fixcomart <it@fixcomart.co.id>2025-12-10 07:25:06 +0000
commitfcdb961c42b32887b51c349242ba47312b7110e3 (patch)
treefdb73368750d0a4ba06d01993e1575b96bc36748
parent3a153b5deaf2c11d2deb8aca2318357e4496ac96 (diff)
parent8b1751b59297e27e123579670618e4d0dd031198 (diff)
Merged in refund_system (pull request #473)
<hafid> bug journal bca
-rw-r--r--indoteknik_custom/models/refund_sale_order.py73
-rwxr-xr-xindoteknik_custom/models/sale_order.py24
2 files changed, 57 insertions, 40 deletions
diff --git a/indoteknik_custom/models/refund_sale_order.py b/indoteknik_custom/models/refund_sale_order.py
index fe0002bd..0ff0a2f0 100644
--- a/indoteknik_custom/models/refund_sale_order.py
+++ b/indoteknik_custom/models/refund_sale_order.py
@@ -294,16 +294,20 @@ class RefundSaleOrder(models.Model):
('state', '=', 'posted'),
('ref', 'not ilike', 'dp'),
])
- piutangbca = self.env['account.move'].search([
- ('ref', 'in', invoices.mapped('name')),
- ('journal_id', '=', 4),
- ('state', '=', 'posted'),
- ])
- piutangmdr = self.env['account.move'].search([
- ('ref', 'in', invoices.mapped('name')),
- ('journal_id', '=', 7),
- ('state', '=', 'posted'),
- ])
+ piutangbca = self.env['account.move']
+ piutangmdr = self.env['account.move']
+
+ for inv_name in invoices.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'),
+ ])
misc = self.env['account.move']
if invoices:
@@ -568,17 +572,20 @@ class RefundSaleOrder(models.Model):
('state', '=', 'posted'),
])
- piutangbca = self.env['account.move'].search([
- ('ref', 'in', invoice_ids.mapped('name')),
- ('journal_id', '=', 4),
- ('state', '=', 'posted'),
- ])
+ piutangbca = self.env['account.move']
+ piutangmdr = self.env['account.move']
- piutangmdr = self.env['account.move'].search([
- ('ref', 'in', invoice_ids.mapped('name')),
- ('journal_id', '=', 7),
- ('state', '=', 'posted'),
- ])
+ 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']
if rec.sale_order_ids:
@@ -651,16 +658,22 @@ class RefundSaleOrder(models.Model):
('state', '=', 'posted'),
('ref', 'not ilike', 'dp'),
])
- piutangbca = self.env['account.move'].search([
- ('ref', 'in', all_invoices.mapped('name')),
- ('journal_id', '=', 4),
- ('state', '=', 'posted'),
- ])
- piutangmdr = self.env['account.move'].search([
- ('ref', 'in', all_invoices.mapped('name')),
- ('journal_id', '=', 7),
- ('state', '=', 'posted'),
- ])
+
+ piutangbca = self.env['account.move']
+ piutangmdr = self.env['account.move']
+
+ for inv_name in all_invoices.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'),
+ ])
+
misc = self.env['account.move']
if all_invoices:
misc = self.env['account.move'].search([
diff --git a/indoteknik_custom/models/sale_order.py b/indoteknik_custom/models/sale_order.py
index 9ef9ce9a..17691798 100755
--- a/indoteknik_custom/models/sale_order.py
+++ b/indoteknik_custom/models/sale_order.py
@@ -3445,16 +3445,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),