Merge lp:~mukunde/unifield-server/US-9842 into lp:unifield-server

Proposed by jftempo
Status: Merged
Merged at revision: 6302
Proposed branch: lp:~mukunde/unifield-server/US-9842
Merge into: lp:unifield-server
Diff against target: 104 lines (+25/-3) (has conflicts)
4 files modified
bin/addons/msf_homere_interface/hr.py (+7/-2)
bin/addons/msf_homere_interface/wizard/hr_expat_import.py (+1/-1)
bin/addons/msf_profile/data/patches.xml (+8/-0)
bin/addons/msf_profile/msf_profile.py (+9/-0)
Text conflict in bin/addons/msf_profile/data/patches.xml
Text conflict in bin/addons/msf_profile/msf_profile.py
To merge this branch: bzr merge lp:~mukunde/unifield-server/US-9842
Reviewer Review Type Date Requested Status
UniField Reviewer Team Pending
Review via email: mp+424862@code.launchpad.net
To post a comment you must log in.
lp:~mukunde/unifield-server/US-9842 updated
6243. By Gaël Mukunde

US-9842 [IMP] Remove from identification number leading and trailing whitespaces

6244. By Gaël Mukunde

US-9842 [IMP] Reduce code scope to only expat employees

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'bin/addons/msf_homere_interface/hr.py'
2--- bin/addons/msf_homere_interface/hr.py 2022-06-20 09:31:19 +0000
3+++ bin/addons/msf_homere_interface/hr.py 2022-08-18 08:17:35 +0000
4@@ -166,14 +166,15 @@
5 return False
6
7 employee_name = data['name'].strip()
8+ employee_id = data['identification_id']
9 existing_id = self.find_sd_ref(cr, uid, sdref)
10 if not existing_id:
11 # never run, but exists with the same id and name => ignore
12- if self.search_exist(cr, uid, [('identification_id', '=', data['identification_id']), ('name', '=', employee_name)]):
13+ if self.search_exist(cr, uid, [('identification_id', '=', employee_id), ('name', '=', employee_name)]):
14 return True
15
16 else:
17- same_ids = self.search(cr, uid, [('identification_id', '=', data['identification_id']), ('name', '=', employee_name)])
18+ same_ids = self.search(cr, uid, [('identification_id', '=', employee_id), ('name', '=', employee_name)])
19 if same_ids and existing_id not in same_ids:
20 # Run on the instance but has a different Employee ID (identification_id) than on the one run on the instance
21 return True
22@@ -240,6 +241,8 @@
23 context = {}
24 if vals.get('name'):
25 vals['name'] = vals['name'].strip()
26+ if vals.get('identification_id', False) and vals.get('employee_type', False) == 'ex':
27+ vals['identification_id'] = vals['identification_id'].strip()
28 allow_edition = False
29 if 'employee_type' in vals and vals.get('employee_type') == 'local':
30 # Search Payroll functionnality preference (activated or not)
31@@ -278,6 +281,8 @@
32 # Prepare some variable for process
33 if vals.get('name'):
34 vals['name'] = vals['name'].strip()
35+ if vals.get('identification_id', False) and vals.get('employee_type', False) == 'ex':
36+ vals['identification_id'] = vals['identification_id'].strip()
37 if vals.get('employee_type', False):
38 if vals.get('employee_type') == 'local':
39 local = True
40
41=== modified file 'bin/addons/msf_homere_interface/wizard/hr_expat_import.py'
42--- bin/addons/msf_homere_interface/wizard/hr_expat_import.py 2019-11-08 11:28:13 +0000
43+++ bin/addons/msf_homere_interface/wizard/hr_expat_import.py 2022-08-18 08:17:35 +0000
44@@ -109,7 +109,7 @@
45 continue # inserting an invalid date format in the DB would fail
46 else:
47 contract_end_date_str = contract_end_date and contract_end_date.strftime('%Y-%m-%d') or ''
48- code = get_xml_spreadheet_cell_value(1)
49+ code = get_xml_spreadheet_cell_value(1).strip()
50 if not code:
51 msg = "At least one employee in the import file does not" \
52 " have an ID number; make sure all employees in the" \
53
54=== modified file 'bin/addons/msf_profile/data/patches.xml'
55--- bin/addons/msf_profile/data/patches.xml 2022-08-05 15:36:47 +0000
56+++ bin/addons/msf_profile/data/patches.xml 2022-08-18 08:17:35 +0000
57@@ -787,6 +787,7 @@
58 <field name="method">us_5722_update_accruals</field>
59 </record>
60
61+<<<<<<< TREE
62 <!-- UF26.0 -->
63 <record id="us_8259_remove_currency_table_wkf" model="patch.scripts">
64 <field name="method">us_8259_remove_currency_table_wkf</field>
65@@ -811,5 +812,12 @@
66 <record id="us_9229_fix_rt" model="patch.scripts">
67 <field name="method">us_9229_fix_rt</field>
68 </record>
69+=======
70+ <!-- UF27 -->
71+ <record id="us_9842_remove_space" model="patch.scripts">
72+ <field name="method">us_9842_remove_space</field>
73+ </record>
74+
75+>>>>>>> MERGE-SOURCE
76 </data>
77 </openerp>
78
79=== modified file 'bin/addons/msf_profile/msf_profile.py'
80--- bin/addons/msf_profile/msf_profile.py 2022-08-05 15:36:47 +0000
81+++ bin/addons/msf_profile/msf_profile.py 2022-08-18 08:17:35 +0000
82@@ -56,6 +56,7 @@
83 'model': lambda *a: 'patch.scripts',
84 }
85
86+<<<<<<< TREE
87 # UF26.0
88 def fix_us_10163_ocbhq_funct_amount(self, cr, uid, *a, **b):
89 ''' OCBHQ: fix amounts on EOY-2021-14020-OCBVE101-VES'''
90@@ -187,6 +188,14 @@
91
92 return True
93
94+=======
95+ # UF27
96+ def us_9842_remove_space(self, cr, uid, *a, **b):
97+ cr.execute('''SELECT id, identification_id FROM hr_employee WHERE employee_type = %s''', 'ex')
98+ for x in cr.fetchall():
99+ cr.execute('''UPDATE hr_employee SET identification_id = %s WHERE id = %s''', (x[1].strip(), x[0]))
100+
101+>>>>>>> MERGE-SOURCE
102 # UF25.0
103 def us_8451_split_rr(self, cr, uid, *a, **b):
104 if not cr.column_exists('replenishment_segment_line', 'rr_fmc_1') or not cr.column_exists('replenishment_segment_line', 'rr_max_1'):

Subscribers

People subscribed via source and target branches