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
=== modified file 'account_banking/wizard/banktools.py'
--- account_banking/wizard/banktools.py 2012-06-26 11:17:32 +0000
+++ account_banking/wizard/banktools.py 2012-12-05 07:24:20 +0000
@@ -125,6 +125,9 @@
125 country_code, log):125 country_code, log):
126 '''126 '''
127 Get or create the partner belonging to the account holders name <name>127 Get or create the partner belonging to the account holders name <name>
128
129 If multiple partners are found with the same name, select the first and
130 add a warning to the import log.
128 '''131 '''
129 partner_obj = pool.get('res.partner')132 partner_obj = pool.get('res.partner')
130 partner_ids = partner_obj.search(cursor, uid, [('name', 'ilike', name)])133 partner_ids = partner_obj.search(cursor, uid, [('name', 'ilike', name)])
@@ -177,13 +180,12 @@
177 'country_id': country_id,180 'country_id': country_id,
178 })],181 })],
179 ))182 ))
180 elif len(partner_ids) > 1:
181 log.append(
182 _('More then one possible match found for partner with name %(name)s')
183 % {'name': name}
184 )
185 return False
186 else:183 else:
184 if len(partner_ids) > 1:
185 log.append(
186 _('More than one possible match found for partner with name %(name)s')
187 % {'name': name}
188 )
187 partner_id = partner_ids[0]189 partner_id = partner_ids[0]
188 return partner_id190 return partner_id
189191

Subscribers

People subscribed via source and target branches