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',