From 05d63523d021deb820724b90b1c36411d270f39f Mon Sep 17 00:00:00 2001 From: it-fixcomart Date: Thu, 24 Jul 2025 13:12:31 +0700 Subject: undo refund system --- indoteknik_custom/views/account_move.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indoteknik_custom/views/account_move.xml b/indoteknik_custom/views/account_move.xml index 59e89210..9b1c791b 100644 --- a/indoteknik_custom/views/account_move.xml +++ b/indoteknik_custom/views/account_move.xml @@ -36,7 +36,7 @@ - + -- cgit v1.2.3 From bdf6d7dbd8850d525809726036c6783b9113028f Mon Sep 17 00:00:00 2001 From: "Indoteknik ." Date: Thu, 24 Jul 2025 13:33:07 +0700 Subject: (andri) fix raise ppn notif --- indoteknik_custom/models/purchase_order.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indoteknik_custom/models/purchase_order.py b/indoteknik_custom/models/purchase_order.py index 5b9e1acb..a46c51d1 100755 --- a/indoteknik_custom/models/purchase_order.py +++ b/indoteknik_custom/models/purchase_order.py @@ -1043,7 +1043,7 @@ class PurchaseOrder(models.Model): for line in self.order_line: if line.taxes_id != reference_taxes: - raise UserError("PPN harus sama untuk semua baris pada line.") + raise UserError(f"PPN harus sama untuk semua baris pada line {line.product_id.name}") def check_data_vendor(self): vendor = self.partner_id -- cgit v1.2.3 From cbe2c5730bcd82ce594e03425c987b17c583b893 Mon Sep 17 00:00:00 2001 From: it-fixcomart Date: Thu, 24 Jul 2025 14:44:23 +0700 Subject: add journals in so --- indoteknik_custom/models/sale_order.py | 42 ++++++++++++++++++++++++++++++---- indoteknik_custom/views/sale_order.xml | 8 +++---- 2 files changed, 42 insertions(+), 8 deletions(-) diff --git a/indoteknik_custom/models/sale_order.py b/indoteknik_custom/models/sale_order.py index 995cafba..febdaabd 100755 --- a/indoteknik_custom/models/sale_order.py +++ b/indoteknik_custom/models/sale_order.py @@ -364,6 +364,17 @@ class SaleOrder(models.Model): compute='_compute_advance_payment_move', string='Advance Payment Move', ) + advance_payment_move_ids = fields.Many2many( + 'account.move', + compute='_compute_advance_payment_moves', + string='All Advance Payment Moves', + ) + + advance_payment_move_count = fields.Integer( + string='Jumlah Jurnal Uang Muka', + compute='_compute_advance_payment_moves', + store=False + ) @api.depends('order_line.product_id', 'date_order') def _compute_et_products(self): @@ -3191,15 +3202,38 @@ class SaleOrder(models.Model): ('state', '=', 'posted'), ], limit=1, order="id desc") order.advance_payment_move_id = move + + @api.depends('invoice_ids') + def _compute_advance_payment_moves(self): + for order in self: + moves = self.env['account.move'].search([ + ('sale_id', '=', order.id), + ('journal_id', '=', 11), + ('state', '=', 'posted'), + ]) + order.advance_payment_move_ids = moves + + @api.depends('invoice_ids') + def _compute_advance_payment_moves(self): + for order in self: + moves = self.env['account.move'].search([ + ('sale_id', '=', order.id), + ('journal_id', '=', 11), + ('state', '=', 'posted'), + ]) + order.advance_payment_move_ids = moves + order.advance_payment_move_count = len(moves) - def action_open_advance_payment_move(self): + def action_open_advance_payment_moves(self): self.ensure_one() - if not self.advance_payment_move_id: + moves = self.advance_payment_move_ids + if not moves: return return { 'type': 'ir.actions.act_window', + 'name': 'Journals Sales Order', 'res_model': 'account.move', - 'res_id': self.advance_payment_move_id.id, - 'view_mode': 'form', + 'view_mode': 'tree,form', + 'domain': [('id', 'in', moves.ids)], 'target': 'current', } \ No newline at end of file diff --git a/indoteknik_custom/views/sale_order.xml b/indoteknik_custom/views/sale_order.xml index 346dc0f8..5bcd7641 100755 --- a/indoteknik_custom/views/sale_order.xml +++ b/indoteknik_custom/views/sale_order.xml @@ -43,13 +43,13 @@ attrs="{'invisible': ['|', ('state', 'not in', ['sale', 'done']), ('has_refund', '=', True)]}" /> -->
-