Merge lp:~therp-nl/banking-addons/ba61-multicompany_safe_partner_search into lp:banking-addons/6.1
Proposed by
Stefan Rijnhart (Opener)
Status: | Merged |
---|---|
Merged at revision: | 161 |
Proposed branch: | lp:~therp-nl/banking-addons/ba61-multicompany_safe_partner_search |
Merge into: | lp:banking-addons/6.1 |
Diff against target: |
133 lines (+31/-39) 2 files modified
account_banking/banking_import_transaction.py (+1/-2) account_banking/wizard/banktools.py (+30/-37) |
To merge this branch: | bzr merge lp:~therp-nl/banking-addons/ba61-multicompany_safe_partner_search |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Alexandre Fayolle - camptocamp | Approve | ||
Guewen Baconnier @ Camptocamp | code review, no test | Approve | |
Ronald Portier (Therp) | Approve | ||
Review via email:
|
Description of the change
This branch fixes partner search in a multicompany database. As there are no multicompany rules on addresses, the module can trigger the 'Access prohibited by access rules' error when trying to read partners through their addresses.
Additionally:
- match by partner name is slightly improved by disregarding very short partner names.
- name of the database cursor has been standardized to 'cr' in this method.
- already disabled code for searching by address components has been removed
- renamed variable name 'filter' to 'filter_' as 'filter' is a keyword (adding trailing underscore as per pep8)
- context propagation and PEP8
- removed unused imports
To post a comment you must log in.
Why not replace filter with criteria (for example)? IMHO the trailing underscore is a pain on the eyes.
More importantly, I get the impression that the way the code is changed will result in a great multitude of false positives. Especially when searching for very common names.
Maybe I see it completely wrong, but it seems that on l.26 you empty all criteria, and then on l.46 you are going to search for ALL partners with an address in the same country. Later, on lines 59-62 you filter out all partners with a name (that should be longer then 3 positions) that is not part of the name passed.
I think the search for city and postal code are not disabled in the original code, and should not be in the adapted code.
My apologies in advance if I somehow misread your changes.
One thing more: there should no print statement left in the final code.