From 016a551340b95fe1e496843a28aa43a7ffe253b4 Mon Sep 17 00:00:00 2001
From: Deniz Ceylan <154223392+dCeylan@users.noreply.github.com>
Date: Thu, 18 Jul 2024 13:15:06 +0200
Subject: [PATCH] Removed total field to speed up view task #165822 (#12)
#165822
---
payment.py | 12 ------------
view/payment_group_form.xml | 2 --
view/payment_group_list.xml | 1 -
3 files changed, 15 deletions(-)
diff --git a/payment.py b/payment.py
index f97f343..e610f67 100644
--- a/payment.py
+++ b/payment.py
@@ -9,7 +9,6 @@
from trytond.exceptions import UserError
from trytond.transaction import Transaction
from trytond.modules.currency.fields import Monetary
-
__all__ = ['Journal', 'Group', 'Payment', 'PayLine']
_ZERO = Decimal(0)
@@ -36,8 +35,6 @@ class Group(metaclass=PoolMeta):
'on_change_with_payment_type')
currency = fields.Function(fields.Many2One('currency.currency', 'Currency'),
'on_change_with_currency')
- amount = fields.Function(Monetary('Total',
- digits='currency', currency='currency'), 'get_amount')
@fields.depends('journal')
def on_change_with_payment_type(self, name=None):
@@ -49,15 +46,6 @@ def on_change_with_currency(self, name=None):
if self.journal and self.journal.currency:
return self.journal.currency.id
- def get_amount(self, name):
- amount = _ZERO
- for payment in self.payments:
- amount += payment.amount
- if self.journal and self.journal.currency:
- return self.journal.currency.round(amount)
- else:
- return amount
-
class Payment(metaclass=PoolMeta):
__name__ = 'account.payment'
diff --git a/view/payment_group_form.xml b/view/payment_group_form.xml
index b5ddbde..ed6d882 100644
--- a/view/payment_group_form.xml
+++ b/view/payment_group_form.xml
@@ -7,8 +7,6 @@ copyright notices and license terms. -->
position="after">
-
-
diff --git a/view/payment_group_list.xml b/view/payment_group_list.xml
index 0bce331..2645657 100644
--- a/view/payment_group_list.xml
+++ b/view/payment_group_list.xml
@@ -6,6 +6,5 @@ copyright notices and license terms. -->
-