From 5d9509cb8a3e1b4c7b93a8797e4a5200767c2c96 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Thu, 3 Feb 2022 22:13:48 +0100 Subject: [PATCH] Enforce currency and amount sign for payment of statement line issue11170 review397151002 --- payment.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/payment.py b/payment.py index ca1508ee9b..33ceac003a 100644 --- a/payment.py +++ b/payment.py @@ -80,7 +80,7 @@ class Group(ModelSQL, ModelView): depends=['company', 'journal']) currency = fields.Function(fields.Many2One( 'currency.currency', "Currency"), - 'on_change_with_currency') + 'on_change_with_currency', searcher='search_currency') payment_count = fields.Function(fields.Integer( "Payment Count", help="The number of payments in the group."), @@ -268,6 +268,10 @@ class Group(ModelSQL, ModelView): if self.journal: return self.journal.currency.id + @classmethod + def search_currency(cls, name, clause): + return [('journal.' + clause[0],) + tuple(clause[1:])] + _STATES = { 'readonly': Eval('state') != 'draft',