changeset aebcb1357c32 in modules/account_payment:default
details:
https://hg.tryton.org/modules/account_payment?cmd=changeset&node=aebcb1357c32
description:
Enforce currency and amount sign for payment of statement line
issue11170
review397151002
diffstat:
payment.py | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)
diffs (23 lines):
diff -r ff7d1bdb78cb -r aebcb1357c32 payment.py
--- a/payment.py Sun Jan 30 01:21:05 2022 +0100
+++ b/payment.py Thu Feb 03 22:13:48 2022 +0100
@@ -80,7 +80,7 @@
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 @@
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',