changeset 92299b5810d5 in modules/account_statement_rule:6.2
details: 
https://hg.tryton.org/modules/account_statement_rule?cmd=changeset&node=92299b5810d5
description:
        Fallback to keyword search

        We do not need to test variable being empty to search by keyword as the
        variable may be unbound.

        issue11009
        review376121002
        (grafted from 9f99341984e7847653dc595a267489e2794ef32d)
diffstat:

 account.py |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (26 lines):

diff -r e79f8eaf1cee -r 92299b5810d5 account.py
--- a/account.py        Mon Nov 01 17:20:23 2021 +0100
+++ b/account.py        Thu Dec 16 00:05:10 2021 +0100
@@ -395,11 +395,11 @@
                     number, = numbers
                     if number.account.owners:
                         party = number.account.owners[0]
-                if not number:
+                else:
                     lines = Line.search([
                             ('statement.state', 'in', ['validated', 'posted']),
                             ('origin.keywords.bank_account', '=',
-                                keywords['bank_account']),
+                                bank_account),
                             ('party', '!=', None),
                             ],
                         order=[('date', 'DESC')], limit=1)
@@ -411,7 +411,7 @@
                     [('rec_name', 'ilike', keywords['party'])])
                 if len(parties) == 1:
                     party, = parties
-                if not party:
+                else:
                     lines = Line.search([
                             ('statement.state', 'in', ['validated', 'posted']),
                             ('origin.keywords.party', '=', keywords['party']),

Reply via email to