From d1a6e4a2d63cf3dd82ede0f8906957675ca38934 Mon Sep 17 00:00:00 2001 From: Azka Nathan Date: Thu, 7 Aug 2025 09:22:07 +0700 Subject: payment partial --- indoteknik_custom/models/account_move.py | 8 ++++++++ indoteknik_custom/views/account_move.xml | 3 ++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/indoteknik_custom/models/account_move.py b/indoteknik_custom/models/account_move.py index 595c5655..c5e01f0c 100644 --- a/indoteknik_custom/models/account_move.py +++ b/indoteknik_custom/models/account_move.py @@ -95,6 +95,14 @@ class AccountMove(models.Model): ) payment_date = fields.Date(string="Payment Date", compute='_compute_payment_date') + partial_payment = fields.Float(string="Partial Payment", compute='compute_partial_payment') + + def compute_partial_payment(self): + for move in self: + if move.amount_total_signed > 0 and move.amount_residual_signed > 0 and move.payment_state == 'partial': + move.partial_payment = move.amount_total_signed - move.amount_residual_signed + else: + move.partial_payment = 0 def _compute_payment_date(self): for move in self: diff --git a/indoteknik_custom/views/account_move.xml b/indoteknik_custom/views/account_move.xml index 23f2d931..e5d1cf8a 100644 --- a/indoteknik_custom/views/account_move.xml +++ b/indoteknik_custom/views/account_move.xml @@ -29,7 +29,8 @@ - + + -- cgit v1.2.3