Merge lp:~therp-nl/banking-addons/ab6.1-lp1085113-take_first_of_two_partners_with_same_name into lp:banking-addons/6.1

Proposed by Stefan Rijnhart (Opener)
Status: Merged
Merged at revision: 141
Proposed branch: lp:~therp-nl/banking-addons/ab6.1-lp1085113-take_first_of_two_partners_with_same_name
Merge into: lp:banking-addons/6.1
Diff against target: 31 lines (+8/-6)
1 file modified
account_banking/wizard/banktools.py (+8/-6)
To merge this branch: bzr merge lp:~therp-nl/banking-addons/ab6.1-lp1085113-take_first_of_two_partners_with_same_name
Reviewer Review Type Date Requested Status
Stefan Rijnhart (Opener) Needs Resubmitting
Guewen Baconnier @ Camptocamp Approve
Paulius Sladkevičius @ hbee Pending
Review via email: mp+137996@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Guewen Baconnier @ Camptocamp (gbaconnier-c2c) wrote :

One typo which was already there but can be corrected in the same time: s/More then/More than/

Otherwise it seems good to me, if we consider that we have to take the first partner found when more than one is found.
Maybe it deserves a comment in the docstring as it may be misleading?

Though, you can merge as is.

review: Approve
142. By Stefan Rijnhart (Opener)

[FIX] Typo and docstring

Revision history for this message
Stefan Rijnhart (Opener) (stefan-opener) wrote :

Thanks for the review! I followed up your suggestions.

review: Needs Resubmitting

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'account_banking/wizard/banktools.py'
2--- account_banking/wizard/banktools.py 2012-06-26 11:17:32 +0000
3+++ account_banking/wizard/banktools.py 2012-12-05 07:24:20 +0000
4@@ -125,6 +125,9 @@
5 country_code, log):
6 '''
7 Get or create the partner belonging to the account holders name <name>
8+
9+ If multiple partners are found with the same name, select the first and
10+ add a warning to the import log.
11 '''
12 partner_obj = pool.get('res.partner')
13 partner_ids = partner_obj.search(cursor, uid, [('name', 'ilike', name)])
14@@ -177,13 +180,12 @@
15 'country_id': country_id,
16 })],
17 ))
18- elif len(partner_ids) > 1:
19- log.append(
20- _('More then one possible match found for partner with name %(name)s')
21- % {'name': name}
22- )
23- return False
24 else:
25+ if len(partner_ids) > 1:
26+ log.append(
27+ _('More than one possible match found for partner with name %(name)s')
28+ % {'name': name}
29+ )
30 partner_id = partner_ids[0]
31 return partner_id
32

Subscribers

People subscribed via source and target branches