Merge lp:~julie-w/unifield-server/US-6753 into lp:unifield-server

Proposed by jftempo
Status: Merged
Merged at revision: 5603
Proposed branch: lp:~julie-w/unifield-server/US-6753
Merge into: lp:unifield-server
Diff against target: 33 lines (+6/-3)
1 file modified
bin/addons/register_accounting/wizard/wizard_register_import.py (+6/-3)
To merge this branch: bzr merge lp:~julie-w/unifield-server/US-6753
Reviewer Review Type Date Requested Status
UniField Reviewer Team Pending
Review via email: mp+378500@code.launchpad.net
To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'bin/addons/register_accounting/wizard/wizard_register_import.py'
2--- bin/addons/register_accounting/wizard/wizard_register_import.py 2019-10-30 16:33:21 +0000
3+++ bin/addons/register_accounting/wizard/wizard_register_import.py 2020-02-04 10:20:33 +0000
4@@ -471,7 +471,8 @@
5 if line[cols['third_party']]:
6 # Type Operational Advance ==> EMPLOYEE required
7 if type_for_register == 'advance':
8- tp_ids = employee_obj.search(cr, uid, [('name', '=', line[cols['third_party']])], context=context)
9+ tp_ids = employee_obj.search(cr, uid, [('name', '=', line[cols['third_party']])],
10+ order='active desc, id', limit=1, context=context)
11 partner_type = 'employee'
12 # Type Internal transfer ==> JOURNAL required
13 elif type_for_register in ['transfer', 'transfer_same']:
14@@ -497,7 +498,8 @@
15 if tp_ids:
16 partner_type = 'partner'
17 else:
18- tp_ids = employee_obj.search(cr, uid, [('name', '=', line[cols['third_party']])], context=context)
19+ tp_ids = employee_obj.search(cr, uid, [('name', '=', line[cols['third_party']])],
20+ order='active desc, id', limit=1, context=context)
21 partner_type = 'employee'
22 # Any type for Spec. Treatment listed above ==> EMPTY partner NOT allowed
23 if not tp_ids:
24@@ -512,7 +514,8 @@
25 tp_ids = partner_obj.search(cr, uid, [('name', '=', line[cols['third_party']])], context=context)
26 partner_type = 'partner'
27 if not tp_ids:
28- tp_ids = employee_obj.search(cr, uid, [('name', '=', line[cols['third_party']])], context=context)
29+ tp_ids = employee_obj.search(cr, uid, [('name', '=', line[cols['third_party']])],
30+ order='active desc, id', limit=1, context=context)
31 partner_type = 'employee'
32 if not tp_ids:
33 errors.append(_('Line %s. Third party not found: %s') % (current_line_num, line[cols['third_party']],))

Subscribers

People subscribed via source and target branches