Merge lp:~camptocamp/banking-addons/improve_lookup into lp:banking-addons/bank-statement-reconcile-70
Proposed by
Nicolas Bessi - Camptocamp
Status: | Merged |
---|---|
Merged at revision: | 88 |
Proposed branch: | lp:~camptocamp/banking-addons/improve_lookup |
Merge into: | lp:banking-addons/bank-statement-reconcile-70 |
Diff against target: |
125 lines (+47/-36) 1 file modified
account_statement_base_completion/statement.py (+47/-36) |
To merge this branch: | bzr merge lp:~camptocamp/banking-addons/improve_lookup |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Alexandre Fayolle - camptocamp | Approve | ||
Review via email: mp+154730@code.launchpad.net |
Description of the change
Fixes performance trouble when using bank_statement_
Add lines in context to be able to acces them in completion rules. It is not mandatory as we can do line.satement_
Some minor cleanup
To post a comment you must log in.
My main concern is the generation of an invalid regular expression on lines 30-31 : what if the partner. bank_statement_ label contains "special" characters such as .[]()^$+*? this could lead to a crash in the query.
Unless we are really really sure this is not possible, there should be some escaping performed on this string before converting it to a regex. I think there is a re.escape function available in Python to do just this.
line 37-38: useless, please remove
line 23: is context[ 'label_ memoizer' ] used outside this function? If not, this could be simply a local variable.
line 101: get is a method -> use () instead of [] (or if you're sure the key is in there, just [] without get)