Merge lp:~dorian-kemps/unifield-server/US-10168 into lp:unifield-server
- US-10168
- Merge into trunk
Proposed by
jftempo
Status: | Merged |
---|---|
Merged at revision: | 6290 |
Proposed branch: | lp:~dorian-kemps/unifield-server/US-10168 |
Merge into: | lp:unifield-server |
Diff against target: |
754 lines (+125/-91) 18 files modified
bin/addons/kit/wizard/kit_mass_import.py (+1/-4) bin/addons/msf_doc_import/check_line.py (+2/-2) bin/addons/msf_doc_import/stock_cost_reevaluation.py (+1/-1) bin/addons/msf_doc_import/wizard/abstract_wizard_import.py (+2/-3) bin/addons/msf_doc_import/wizard/wiz_common_import.py (+12/-13) bin/addons/msf_doc_import/wizard/wizard_import_ad_line.py (+2/-2) bin/addons/msf_doc_import/wizard/wizard_import_fo_line.py (+3/-4) bin/addons/msf_doc_import/wizard/wizard_import_invoice_line.py (+2/-3) bin/addons/msf_doc_import/wizard/wizard_import_po_line.py (+10/-11) bin/addons/msf_doc_import/wizard/wizard_import_ppl_to_create_ship.py (+2/-2) bin/addons/msf_doc_import/wizard/wizard_import_supplier_catalogue.py (+2/-2) bin/addons/msf_doc_import/wizard/wizard_in_simulation_screen.py (+7/-7) bin/addons/msf_doc_import/wizard/wizard_po_simulation_screen.py (+5/-5) bin/addons/msf_profile/i18n/fr_MF.po (+59/-16) bin/addons/msf_supply_doc_export/wizard/wizard_pick_import.py (+1/-1) bin/addons/procurement_cycle/replenishment.py (+8/-9) bin/addons/sale/wizard/internal_request_import.py (+2/-2) bin/addons/stock/physical_inventory.py (+4/-4) |
To merge this branch: | bzr merge lp:~dorian-kemps/unifield-server/US-10168 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
UniField Reviewer Team | Pending | ||
Review via email: mp+425930@code.launchpad.net |
Commit message
Description of the change
To post a comment you must log in.
- 6262. By Dorian
-
US-10168 [FIX] FO line import: headers are case incensitive now
- 6263. By Dorian
-
US-10168 [FIX] IN VI import: removed the case sensitivity on the packing headers. Stock Out import: Qty missed will be empty if data beyond days of stock out
- 6264. By Dorian
-
US-10168 [FIX] IN VI import: Fixed the header checks for P/P/S
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'bin/addons/kit/wizard/kit_mass_import.py' |
2 | --- bin/addons/kit/wizard/kit_mass_import.py 2020-10-21 14:16:24 +0000 |
3 | +++ bin/addons/kit/wizard/kit_mass_import.py 2022-07-21 13:40:33 +0000 |
4 | @@ -601,7 +601,6 @@ |
5 | |
6 | return True |
7 | |
8 | - |
9 | def _get_record(self, cr, uid, field, value, model, cache=None): |
10 | """ |
11 | Search in cache or fill the cache with the ID of the db. |
12 | @@ -610,9 +609,7 @@ |
13 | cache = {} |
14 | |
15 | if value not in cache: |
16 | - record_ids = self.pool.get(model).search(cr, uid, [ |
17 | - (field, '=', value), |
18 | - ]) |
19 | + record_ids = self.pool.get(model).search(cr, uid, [(field, '=ilike', value)]) |
20 | if record_ids: |
21 | cache[value] = record_ids[0] |
22 | else: |
23 | |
24 | === modified file 'bin/addons/msf_doc_import/check_line.py' |
25 | --- bin/addons/msf_doc_import/check_line.py 2022-05-10 14:16:17 +0000 |
26 | +++ bin/addons/msf_doc_import/check_line.py 2022-07-21 13:40:33 +0000 |
27 | @@ -290,8 +290,8 @@ |
28 | if row.cells[cell_nb] and row.cells[cell_nb].data: |
29 | product_code = row.cells[cell_nb].data |
30 | if product_code and row.cells[cell_nb].type == 'str': |
31 | - product_code = product_code.strip() |
32 | - p_ids = product_obj.search(cr, uid, [('default_code', '=ilike', product_code)], context=context) |
33 | + product_code = product_code.strip().upper() |
34 | + p_ids = product_obj.search(cr, uid, [('default_code', '=', product_code)], context=context) |
35 | if not p_ids: |
36 | comment += _(' Code: %s') % (product_code) |
37 | msg = _('Product code %s doesn\'t exist in the DB.') % product_code |
38 | |
39 | === modified file 'bin/addons/msf_doc_import/stock_cost_reevaluation.py' |
40 | --- bin/addons/msf_doc_import/stock_cost_reevaluation.py 2015-07-15 11:57:19 +0000 |
41 | +++ bin/addons/msf_doc_import/stock_cost_reevaluation.py 2022-07-21 13:40:33 +0000 |
42 | @@ -123,7 +123,7 @@ |
43 | |
44 | # Currency |
45 | currency_name = row.cells[3].data |
46 | - if not currency_name or currency_name != comp_currency_name: |
47 | + if not currency_name or currency_name.lower() != comp_currency_name.lower(): |
48 | raise osv.except_osv(_('Error'), |
49 | _("The Product [%s] %s is not in company currency. Company currency is '%s' and the product currency is '%s'.") % ( |
50 | product_code or '', product_name or '', comp_currency_name, currency_name or '', )) |
51 | |
52 | === modified file 'bin/addons/msf_doc_import/wizard/abstract_wizard_import.py' |
53 | --- bin/addons/msf_doc_import/wizard/abstract_wizard_import.py 2021-07-07 16:30:21 +0000 |
54 | +++ bin/addons/msf_doc_import/wizard/abstract_wizard_import.py 2022-07-21 13:40:33 +0000 |
55 | @@ -475,12 +475,11 @@ |
56 | :return: The ID of the product.product |
57 | """ |
58 | p_obj = self.pool.get('product.product') |
59 | - p_ids = p_obj.search(cr, uid, [ |
60 | - ('default_code', '=', default_code), |
61 | - ], limit=1, order='NO_ORDER', context=context) |
62 | + p_ids = p_obj.search(cr, uid, [('default_code', '=ilike', default_code)], limit=1, order='NO_ORDER', context=context) |
63 | if not p_ids: |
64 | raise UnifieldImportException(_('No product found for the code \'%s\'') % default_code) |
65 | |
66 | return p_ids[0] |
67 | |
68 | + |
69 | abstract_wizard_import() |
70 | |
71 | === modified file 'bin/addons/msf_doc_import/wizard/wiz_common_import.py' |
72 | --- bin/addons/msf_doc_import/wizard/wiz_common_import.py 2022-05-02 09:01:40 +0000 |
73 | +++ bin/addons/msf_doc_import/wizard/wiz_common_import.py 2022-07-21 13:40:33 +0000 |
74 | @@ -74,33 +74,32 @@ |
75 | cell_data = row.cells[cell_nb].data |
76 | return cell_data |
77 | |
78 | - def get_header_index(self, cr, uid, ids, row, error_list, line_num, context): |
79 | + def get_header_index(self, cr, uid, ids, row, error_list, line_num, origin=False, context=None): |
80 | """ |
81 | Return dict with {'header_name0': header_index0, 'header_name1': header_index1...} |
82 | """ |
83 | + if context is None: |
84 | + context = {} |
85 | header_dict = {} |
86 | for cell_nb in range(len(row.cells)): |
87 | - header_dict.update({self.get_cell_data(cr, uid, ids, row, cell_nb, error_list, line_num, context): cell_nb}) |
88 | + col_name = self.get_cell_data(cr, uid, ids, row, cell_nb, error_list, line_num, context) |
89 | + if col_name and origin == 'PO': |
90 | + col_name = col_name.lower() |
91 | + header_dict.update({col_name: cell_nb}) |
92 | return header_dict |
93 | |
94 | - def check_header_values(self, cr, uid, ids, context, header_index, |
95 | - real_columns, origin=False, ignore_case=False): |
96 | + def check_header_values(self, cr, uid, ids, context, header_index, real_columns, origin=False): |
97 | """ |
98 | Check that the columns in the header will be taken into account. |
99 | """ |
100 | translated_headers = [_(f) for f in real_columns] |
101 | - upper_translated_headers = translated_headers |
102 | - if origin == 'FO' or ignore_case: |
103 | - upper_translated_headers = [_(f).upper() for f in real_columns] |
104 | - for k,v in header_index.items(): |
105 | - upper_k = k |
106 | - if k and (origin == 'FO' or ignore_case): |
107 | - upper_k = k.upper() |
108 | + upper_translated_headers = [_(f).upper() for f in real_columns] |
109 | + for k, v in header_index.items(): |
110 | + upper_k = k and k.upper() or '' |
111 | if upper_k not in upper_translated_headers: |
112 | if origin: |
113 | # special case from document origin |
114 | - if origin == 'PO' and k == _('Delivery requested date') \ |
115 | - and 'Delivery Request Date' in real_columns: |
116 | + if origin == 'PO' and k == _('Delivery requested date') and 'Delivery Request Date' in real_columns: |
117 | continue # 'Delivery requested date' tolerated (for Rfq vs 'Delivery Requested Date' of PO_COLUMNS_HEADER_FOR_IMPORT) |
118 | vals = {'state': 'draft', |
119 | 'message': _('The column "%s" is not taken into account. Please correct it. The list of columns accepted is: %s' |
120 | |
121 | === modified file 'bin/addons/msf_doc_import/wizard/wizard_import_ad_line.py' |
122 | --- bin/addons/msf_doc_import/wizard/wizard_import_ad_line.py 2022-02-18 16:02:20 +0000 |
123 | +++ bin/addons/msf_doc_import/wizard/wizard_import_ad_line.py 2022-07-21 13:40:33 +0000 |
124 | @@ -95,7 +95,7 @@ |
125 | ''', (doc.id, )) # not_a_user_entry |
126 | |
127 | for x in cr.fetchall(): |
128 | - key = (x[1], x[2]) |
129 | + key = (x[1], x[2].lower()) |
130 | current_line_add.setdefault(key, []).append(x) |
131 | |
132 | |
133 | @@ -122,7 +122,7 @@ |
134 | |
135 | for row in ws.rows: |
136 | if len(row) > percentage_col: |
137 | - key = (row[0].value, row[1].value) |
138 | + key = (row[0].value, row[1].value.lower()) |
139 | if not row[0].value or not row[1].value: |
140 | # empty line |
141 | continue |
142 | |
143 | === modified file 'bin/addons/msf_doc_import/wizard/wizard_import_fo_line.py' |
144 | --- bin/addons/msf_doc_import/wizard/wizard_import_fo_line.py 2022-05-10 09:08:50 +0000 |
145 | +++ bin/addons/msf_doc_import/wizard/wizard_import_fo_line.py 2022-07-21 13:40:33 +0000 |
146 | @@ -126,10 +126,9 @@ |
147 | if h_name != 'State' or len(header_row) != mandatory_col_count: |
148 | tr_header_row = _(tools.ustr(header_row[i])) |
149 | tr_h_name = _(h_name) |
150 | - if len(header_row) > i and tr_header_row != tr_h_name: |
151 | + if len(header_row) > i and tr_header_row.upper() != tr_h_name.upper(): |
152 | header_error = True |
153 | - if tr_header_row.upper() == tr_h_name.upper(): |
154 | - error_list.append(_("\n\tPlease check spelling on column '%s'.") % tr_header_row) |
155 | + error_list.append(_("\n\tPlease check spelling on column '%s'.") % tr_header_row) |
156 | |
157 | if header_error: |
158 | msg = _("\n\tYou can not import this file because the header of columns doesn't match with the expected headers: %s") % ','.join([_(x) for x in columns_for_fo_line_import]) |
159 | @@ -177,7 +176,7 @@ |
160 | col_count = len(row) |
161 | template_col_count = len(header_index.items()) |
162 | if col_count != template_col_count and col_count != mandatory_col_count: |
163 | - message += _("""Line %s in the Excel file: You should have exactly %s columns in this order: %s \n""") % (line_num, template_col_count,','.join(columns_for_fo_line_import)) |
164 | + message += _("""Line %s in the Excel file: You should have exactly %s columns in this order: %s \n""") % (line_num, template_col_count,', '.join(columns_for_fo_line_import)) |
165 | line_with_error.append(wiz_common_import.get_line_values(cr, uid, ids, row, cell_nb=False, error_list=error_list, line_num=line_num, context=context)) |
166 | ignore_lines += 1 |
167 | line_ignored_num.append(line_num) |
168 | |
169 | === modified file 'bin/addons/msf_doc_import/wizard/wizard_import_invoice_line.py' |
170 | --- bin/addons/msf_doc_import/wizard/wizard_import_invoice_line.py 2021-11-10 16:14:10 +0000 |
171 | +++ bin/addons/msf_doc_import/wizard/wizard_import_invoice_line.py 2022-07-21 13:40:33 +0000 |
172 | @@ -337,9 +337,8 @@ |
173 | header_index = wiz_common_import.get_header_index( |
174 | cr, uid, ids, first_row, error_list=[], line_num=0, context=context) |
175 | context.update({'invoice_id': invoice_id, 'header_index': header_index}) |
176 | - res, res1 = wiz_common_import.check_header_values( |
177 | - cr, uid, ids, context, header_index, |
178 | - columns_for_account_line_import) |
179 | + res, res1 = wiz_common_import.check_header_values(cr, uid, ids, context, header_index, |
180 | + columns_for_account_line_import) |
181 | if not res: |
182 | return self.write(cr, uid, ids, res1, context) |
183 | except osv.except_osv as osv_error: |
184 | |
185 | === modified file 'bin/addons/msf_doc_import/wizard/wizard_import_po_line.py' |
186 | --- bin/addons/msf_doc_import/wizard/wizard_import_po_line.py 2022-05-10 14:16:17 +0000 |
187 | +++ bin/addons/msf_doc_import/wizard/wizard_import_po_line.py 2022-07-21 13:40:33 +0000 |
188 | @@ -186,18 +186,17 @@ |
189 | total_line_num -= 1 |
190 | continue |
191 | |
192 | - |
193 | # Cell 0 : Line Number (RfQ) |
194 | if is_rfq: |
195 | ln_value = check_line.line_number_value( |
196 | - row=row, cell_nb=header_index[_('Line Number')], to_write=to_write, context=context) |
197 | + row=row, cell_nb=header_index[_('line number')], to_write=to_write, context=context) |
198 | to_write.update( |
199 | line_number=ln_value['line_number'], |
200 | error_list=ln_value['error_list']) |
201 | |
202 | # Cell 1: Product Code |
203 | p_value = check_line.product_value( |
204 | - cr, uid, obj_data=obj_data, cell_nb=header_index[_('Product Code')], |
205 | + cr, uid, obj_data=obj_data, cell_nb=header_index[_('product code')], |
206 | product_obj=product_obj, row=row, to_write=to_write, context=context) |
207 | to_write.update( |
208 | default_code=p_value['default_code'], |
209 | @@ -209,7 +208,7 @@ |
210 | |
211 | # Cell 2: Quantity |
212 | qty_value = check_line.quantity_value( |
213 | - product_obj=product_obj, cell_nb=header_index[_('Quantity')], |
214 | + product_obj=product_obj, cell_nb=header_index[_('quantity')], |
215 | row=row, to_write=to_write, max_qty=max_qty, context=context) |
216 | to_write.update( |
217 | product_qty=qty_value['product_qty'], |
218 | @@ -218,7 +217,7 @@ |
219 | |
220 | # Cell 3: UOM |
221 | uom_value = check_line.compute_uom_value( |
222 | - cr, uid, obj_data=obj_data, cell_nb=header_index[_('UoM')], product_obj=product_obj, |
223 | + cr, uid, obj_data=obj_data, cell_nb=header_index[_('uom')], product_obj=product_obj, |
224 | uom_obj=uom_obj, row=row, to_write=to_write, context=context) |
225 | to_write.update( |
226 | product_uom=uom_value['uom_id'], |
227 | @@ -236,7 +235,7 @@ |
228 | |
229 | # Cell 4: Price |
230 | price_value = check_line.compute_price_value( |
231 | - row=row, to_write=to_write, cell_nb=header_index[_('Price')], price='Cost Price', |
232 | + row=row, to_write=to_write, cell_nb=header_index[_('price')], price='Cost Price', |
233 | is_rfq=is_rfq, context=context) |
234 | to_write.update( |
235 | price_unit=price_value['price_unit'], |
236 | @@ -246,7 +245,7 @@ |
237 | |
238 | # Cell 5: Requested Delivery Date |
239 | # for Rfq 'Requested Delivery Date' tolerated (5th column) |
240 | - cell_nb = header_index[_('Requested Delivery Date')] if _('Requested Delivery Date') in header_index else 6 |
241 | + cell_nb = header_index[_('requested delivery date')] if _('requested delivery date') in header_index else 6 |
242 | date_value = check_line.compute_date_value( |
243 | cell_nb=cell_nb, row=row, to_write=to_write, context=context) |
244 | to_write.update( |
245 | @@ -255,7 +254,7 @@ |
246 | |
247 | # Cell 7: Confirmed Delivery Date |
248 | if is_rfq: |
249 | - cell_nb = header_index[_('Confirmed Delivery Date')] if _('Confirmed Delivery Date') in header_index else 7 |
250 | + cell_nb = header_index[_('confirmed delivery date')] if _('confirmed delivery date') in header_index else 7 |
251 | cdd_value = check_line.compute_confirmed_delivery_date_value( |
252 | cell_nb=cell_nb, row=row, to_write=to_write, context=context) |
253 | to_write.update( |
254 | @@ -264,7 +263,7 @@ |
255 | |
256 | # Cell 6: Currency |
257 | curr_value = check_line.compute_currency_value( |
258 | - cr, uid, cell_nb=header_index[_('Currency')], browse_purchase=wiz.po_id, |
259 | + cr, uid, cell_nb=header_index[_('currency')], browse_purchase=wiz.po_id, |
260 | currency_obj=currency_obj, row=row, to_write=to_write, context=context) |
261 | to_write.update( |
262 | functional_currency_id=curr_value['functional_currency_id'], |
263 | @@ -272,7 +271,7 @@ |
264 | |
265 | # Cell 7: Comment |
266 | c_value = check_line.comment_value( |
267 | - row=row, cell_nb=header_index[_('Comment')], to_write=to_write, context=context) |
268 | + row=row, cell_nb=header_index[_('comment')], to_write=to_write, context=context) |
269 | to_write.update( |
270 | comment=c_value['comment'], |
271 | warning_list=c_value['warning_list']) |
272 | @@ -462,7 +461,7 @@ |
273 | # get first line |
274 | first_row = next(reader_iterator) |
275 | header_index = wiz_common_import.get_header_index( |
276 | - cr, uid, ids, first_row, error_list=[], line_num=0, context=context) |
277 | + cr, uid, ids, first_row, error_list=[], line_num=0, origin='PO', context=context) |
278 | context.update({'po_id': po_id, 'header_index': header_index}) |
279 | rfq = purchase_obj.read(cr, uid, po_id, ['state', 'rfq_ok'], context=context) |
280 | is_rfq = rfq['rfq_ok'] |
281 | |
282 | === modified file 'bin/addons/msf_doc_import/wizard/wizard_import_ppl_to_create_ship.py' |
283 | --- bin/addons/msf_doc_import/wizard/wizard_import_ppl_to_create_ship.py 2022-03-08 13:43:59 +0000 |
284 | +++ bin/addons/msf_doc_import/wizard/wizard_import_ppl_to_create_ship.py 2022-07-21 13:40:33 +0000 |
285 | @@ -275,7 +275,7 @@ |
286 | ('id', 'not in', treated_lines), |
287 | ('picking_id', '=', wiz_browse.picking_id.id), |
288 | ('line_number', '=', imp_line_num), |
289 | - ('product_id.default_code', '=', row.cells[1].data), |
290 | + ('product_id.default_code', '=', row.cells[1].data.upper()), |
291 | ('state', '=', 'assigned'), |
292 | ] |
293 | if row.cells[5].data: |
294 | @@ -527,7 +527,7 @@ |
295 | get_header_index(cr, uid, ids, next(reader_iterator), error_list=[], line_num=0, context=context) |
296 | context.update({'picking_id': picking_id, 'header_index': header_index}) |
297 | res, res1 = wiz_common_import.\ |
298 | - check_header_values(cr, uid, ids, context, header_index, ppl_columns_lines_for_import, ignore_case=True) |
299 | + check_header_values(cr, uid, ids, context, header_index, ppl_columns_lines_for_import) |
300 | if not res: |
301 | return self.write(cr, uid, ids, res1, context) |
302 | except osv.except_osv as osv_error: |
303 | |
304 | === modified file 'bin/addons/msf_doc_import/wizard/wizard_import_supplier_catalogue.py' |
305 | --- bin/addons/msf_doc_import/wizard/wizard_import_supplier_catalogue.py 2021-08-16 13:37:04 +0000 |
306 | +++ bin/addons/msf_doc_import/wizard/wizard_import_supplier_catalogue.py 2022-07-21 13:40:33 +0000 |
307 | @@ -205,7 +205,7 @@ |
308 | else: |
309 | try: |
310 | product_code = product_code.strip() |
311 | - code_ids = product_obj.search(cr, uid, [('default_code', '=', product_code)]) |
312 | + code_ids = product_obj.search(cr, uid, [('default_code', '=ilike', product_code)]) |
313 | if not code_ids: |
314 | default_code = obj_data.get_object_reference(cr, uid, 'msf_doc_import','product_tbd')[1] |
315 | to_correct_ok = True |
316 | @@ -227,7 +227,7 @@ |
317 | else: |
318 | try: |
319 | uom_name = p_uom.strip() |
320 | - uom_ids = uom_obj.search(cr, uid, [('name', '=', uom_name)], context=context) |
321 | + uom_ids = uom_obj.search(cr, uid, [('name', '=ilike', uom_name)], context=context) |
322 | if not uom_ids: |
323 | uom_id = obj_data.get_object_reference(cr, uid, 'msf_doc_import','uom_tbd')[1] |
324 | error_list_line.append(_("The UoM '%s' was not found.") % uom_name) |
325 | |
326 | === modified file 'bin/addons/msf_doc_import/wizard/wizard_in_simulation_screen.py' |
327 | --- bin/addons/msf_doc_import/wizard/wizard_in_simulation_screen.py 2022-03-16 16:37:36 +0000 |
328 | +++ bin/addons/msf_doc_import/wizard/wizard_in_simulation_screen.py 2022-07-21 13:40:33 +0000 |
329 | @@ -448,7 +448,8 @@ |
330 | for row in rows: |
331 | index += 1 |
332 | values.setdefault(index, []) |
333 | - if len(row) > 2 and row[1] and row[1].data == PACK_HEADER[1][0]: |
334 | + if len(row) > 2 and row[1] and row[1].data and (row[1].data == PACK_HEADER[1][0] or |
335 | + (row[1].type == 'str' and row[1].data.lower() == PACK_HEADER[1][0].lower())): |
336 | # this line is for pack header |
337 | nb_pack += 1 |
338 | for nb, x in enumerate(PACK_HEADER): |
339 | @@ -1533,13 +1534,12 @@ |
340 | else: |
341 | prod_id = False |
342 | if values.get('product_code'): |
343 | + values['product_code'] = values['product_code'].upper() |
344 | prod_id = PRODUCT_CODE_ID.get(values['product_code']) |
345 | |
346 | if not prod_id and values['product_code']: |
347 | stripped_product_code = values['product_code'].strip() |
348 | - prod_ids = prod_obj.search(cr, uid, |
349 | - [('default_code', '=', stripped_product_code)], |
350 | - context=context) |
351 | + prod_ids = prod_obj.search(cr, uid, [('default_code', '=ilike', stripped_product_code)], context=context) |
352 | if not prod_ids: |
353 | # if we didn't manage to link our product code with existing product in DB, we cannot continue checks |
354 | # because it needs the product id: |
355 | @@ -1586,12 +1586,12 @@ |
356 | |
357 | # UoM |
358 | uom_value = values.get('product_uom') |
359 | - if tools.ustr(uom_value) == line.move_uom_id.name: |
360 | + if uom_value and line.move_uom_id and tools.ustr(uom_value.lower()) == line.move_uom_id.name.lower(): |
361 | write_vals['imp_uom_id'] = line.move_uom_id.id |
362 | else: |
363 | uom_id = UOM_NAME_ID.get(tools.ustr(uom_value)) |
364 | if not uom_id: |
365 | - uom_ids = uom_obj.search(cr, uid, [('name', '=', tools.ustr(uom_value))], context=context) |
366 | + uom_ids = uom_obj.search(cr, uid, [('name', '=ilike', tools.ustr(uom_value))], context=context) |
367 | if uom_ids: |
368 | write_vals['imp_uom_id'] = uom_ids[0] |
369 | else: |
370 | @@ -1631,7 +1631,7 @@ |
371 | |
372 | if line_currency: |
373 | write_vals['imp_currency_id'] = line_currency.id |
374 | - if tools.ustr(currency_value) != line_currency.name: |
375 | + if tools.ustr(currency_value.upper()) != line_currency.name.upper(): |
376 | err_msg = _('The currency on the Excel file is not the same as the currency of the IN line - You must have the same currency on both side - Currency of the initial line kept.') |
377 | errors.append(err_msg) |
378 | |
379 | |
380 | === modified file 'bin/addons/msf_doc_import/wizard/wizard_po_simulation_screen.py' |
381 | --- bin/addons/msf_doc_import/wizard/wizard_po_simulation_screen.py 2022-03-21 11:06:44 +0000 |
382 | +++ bin/addons/msf_doc_import/wizard/wizard_po_simulation_screen.py 2022-07-21 13:40:33 +0000 |
383 | @@ -1552,7 +1552,7 @@ |
384 | else: |
385 | if values[2]: |
386 | if not PRODUCT_CODE_ID.get(values[2]): |
387 | - prod_ids = prod_obj.search(cr, uid, [('default_code', '=', values[2])], context=context) |
388 | + prod_ids = prod_obj.search(cr, uid, [('default_code', '=ilike', values[2])], context=context) |
389 | if prod_ids: |
390 | PRODUCT_CODE_ID[values[2]] = prod_ids[0] |
391 | else: |
392 | @@ -1605,9 +1605,9 @@ |
393 | else: |
394 | uom_id = UOM_NAME_ID.get(tools.ustr(uom_value)) |
395 | if not uom_id: |
396 | - uom_ids = uom_obj.search(cr, uid, [('name', '=', tools.ustr(uom_value))], context=context) |
397 | + uom_ids = uom_obj.search(cr, uid, [('name', '=ilike', tools.ustr(uom_value))], context=context) |
398 | if uom_ids: |
399 | - UOM_NAME_ID[tools.ustr(uom_value)] = uom_ids[0] |
400 | + UOM_NAME_ID[tools.ustr(uom_value)] = uom_ids[0] |
401 | write_vals['imp_uom'] = uom_ids[0] |
402 | else: |
403 | errors.append(_('UoM not found in database.')) |
404 | @@ -1646,8 +1646,8 @@ |
405 | write_vals.update({'imp_qty': 0.00, 'imp_price': 0.00, 'type_change': 'error'}) |
406 | |
407 | # Currency |
408 | - currency_value = values[7] |
409 | - if tools.ustr(currency_value) == line.in_currency.name: |
410 | + currency_value = values[7].lower() |
411 | + if line.in_currency and tools.ustr(currency_value.lower()) == line.in_currency.name.lower(): |
412 | write_vals['imp_currency'] = line.in_currency.id |
413 | elif line.in_currency.name: |
414 | err_msg = _('The currency on the file is not the same as the currency of the PO line - You must have the same currency on both side - Currency of the initial line kept.') |
415 | |
416 | === modified file 'bin/addons/msf_profile/i18n/fr_MF.po' |
417 | --- bin/addons/msf_profile/i18n/fr_MF.po 2022-07-12 16:14:38 +0000 |
418 | +++ bin/addons/msf_profile/i18n/fr_MF.po 2022-07-21 13:40:33 +0000 |
419 | @@ -8298,7 +8298,6 @@ |
420 | #: code:addons/msf_doc_import/wizard/__init__.py:82 |
421 | #: code:addons/msf_doc_import/wizard/__init__.py:87 |
422 | #: code:addons/msf_doc_import/wizard/wizard_import_invoice_line.py:193 |
423 | -#: code:addons/msf_doc_import/wizard/wizard_import_po_line.py:213 |
424 | #: field:purchase.line.import.xml.line,product_qty:0 |
425 | #: field:internal.move.processor,quantity:0 |
426 | #: report:invoice:0 |
427 | @@ -8375,6 +8374,11 @@ |
428 | msgid "Quantity" |
429 | msgstr "Quantité" |
430 | |
431 | +#. module: msf_doc_import |
432 | +#: code:addons/msf_doc_import/wizard/wizard_import_po_line.py:213 |
433 | +msgid "quantity" |
434 | +msgstr "quantité" |
435 | + |
436 | #. module: account_hq_entries |
437 | #: field:account.account,is_not_ad_correctable:0 |
438 | #: field:hq.entries.split.lines,is_not_ad_correctable:0 |
439 | @@ -24663,7 +24667,6 @@ |
440 | #: code:addons/msf_doc_import/wizard/__init__.py:83 |
441 | #: code:addons/msf_doc_import/wizard/__init__.py:108 |
442 | #: code:addons/msf_doc_import/wizard/__init__.py:127 |
443 | -#: code:addons/msf_doc_import/wizard/wizard_import_po_line.py:275 |
444 | #: code:addons/msf_doc_import/wizard/wizard_po_simulation_screen.py:73 |
445 | #: field:initial.stock.inventory.line,inactive_error:0 |
446 | #: report:po.simulation.screen:0 |
447 | @@ -24758,6 +24761,11 @@ |
448 | msgid "Comment" |
449 | msgstr "Commentaire" |
450 | |
451 | +#. module: msf_doc_import |
452 | +#: code:addons/msf_doc_import/wizard/wizard_import_po_line.py:275 |
453 | +msgid "comment" |
454 | +msgstr "commentaire" |
455 | + |
456 | #. module: sale |
457 | #: view:sale.order:0 |
458 | #: view:sale.order.line:0 |
459 | @@ -25766,12 +25774,17 @@ |
460 | #: code:addons/msf_supply_doc_export/msf_supply_doc_export.py:1065 |
461 | #: code:addons/msf_doc_import/wizard/__init__.py:57 |
462 | #: code:addons/msf_doc_import/wizard/__init__.py:62 |
463 | -#: code:addons/msf_doc_import/wizard/wizard_import_po_line.py:249 |
464 | #: report:addons/msf_supply_doc_export/report/report_request_for_quotation_xls.mako:75 |
465 | #, python-format |
466 | msgid "Requested Delivery Date" |
467 | msgstr "Date de Livraison Demandée" |
468 | |
469 | +#. modules: msf_doc_import |
470 | +#: code:addons/msf_doc_import/wizard/wizard_import_po_line.py:249 |
471 | +#, python-format |
472 | +msgid "requested delivery date" |
473 | +msgstr "date de livraison demandée" |
474 | + |
475 | #. modules: purchase, msf_order_date |
476 | #: field:purchase.order.line,date_planned:0 |
477 | #: field:sale.order.line,date_planned:0 |
478 | @@ -40368,7 +40381,6 @@ |
479 | #: code:addons/msf_doc_import/wizard/__init__.py:100 |
480 | #: code:addons/msf_doc_import/wizard/__init__.py:104 |
481 | #: code:addons/msf_doc_import/wizard/__init__.py:122 |
482 | -#: code:addons/msf_doc_import/wizard/wizard_import_po_line.py:222 |
483 | #: report:po.simulation.screen:0 |
484 | #: field:purchase.line.import.xml.line,product_uom:0 |
485 | #: field:wizard.import.in.line.simulation.screen,imp_uom_id:0 |
486 | @@ -40485,6 +40497,12 @@ |
487 | msgid "UoM" |
488 | msgstr "UdM" |
489 | |
490 | +#. module: msf_doc_import |
491 | +#: code:addons/msf_doc_import/wizard/wizard_import_po_line.py:222 |
492 | +#, python-format |
493 | +msgid "uom" |
494 | +msgstr "udm" |
495 | + |
496 | #. module: msf_accrual |
497 | #: model:ir.model,name:msf_accrual.model_wizard_accrual_validation |
498 | msgid "wizard.accrual.validation" |
499 | @@ -43496,7 +43514,6 @@ |
500 | #: code:addons/msf_doc_import/wizard/__init__.py:104 |
501 | #: code:addons/msf_doc_import/wizard/__init__.py:108 |
502 | #: code:addons/msf_doc_import/wizard/__init__.py:119 |
503 | -#: code:addons/msf_doc_import/wizard/wizard_import_po_line.py:201 |
504 | #: code:addons/msf_doc_import/wizard/wizard_po_simulation_screen.py:66 |
505 | #: field:wizard.simu.import.po.line,import_product_code:0 |
506 | #: field:wizard.simu.import.po.line,initial_product_code:0 |
507 | @@ -43567,6 +43584,12 @@ |
508 | msgid "Product Code" |
509 | msgstr "Code Produit" |
510 | |
511 | +#. module: msf_doc_import |
512 | +#: code:addons/msf_doc_import/wizard/wizard_import_po_line.py:201 |
513 | +#, python-format |
514 | +msgid "product code" |
515 | +msgstr "code produit" |
516 | + |
517 | #. modules: account, analytic_distribution_supply, finance, register_accounting, account_override, msf_audittrail, analytic_distribution |
518 | #: view:account.invoice.line:0 |
519 | #: field:account.invoice.tax,invoice_id:0 |
520 | @@ -51731,7 +51754,6 @@ |
521 | #: field:account.move.line,line_number:0 |
522 | #: report:addons/msf_doc_import/report/po_simulation_screen_xls_report.mako:239 |
523 | #: code:addons/msf_doc_import/wizard/__init__.py:57 |
524 | -#: code:addons/msf_doc_import/wizard/wizard_import_po_line.py:194 |
525 | #: report:addons/msf_supply_doc_export/report/report_request_for_quotation_xls.mako:69 |
526 | #: report:addons/msf_supply_doc_export/report/internal_request_export_xls.mako:129 |
527 | #: field:internal.request.import.line,imp_line_number:0 |
528 | @@ -51744,6 +51766,12 @@ |
529 | msgid "Line Number" |
530 | msgstr "Numéro de Ligne" |
531 | |
532 | +#. module: msf_doc_import |
533 | +#: code:addons/msf_doc_import/wizard/wizard_import_po_line.py:194 |
534 | +#, python-format |
535 | +msgid "line number" |
536 | +msgstr "numéro de ligne" |
537 | + |
538 | #. module: product_nomenclature, product |
539 | #: help:product.category,active:0 |
540 | #: help:product.nomenclature,active:0 |
541 | @@ -57861,7 +57889,6 @@ |
542 | #: report:account.invoice2:0 |
543 | #: code:addons/msf_doc_import/wizard/__init__.py:57 |
544 | #: code:addons/msf_doc_import/wizard/__init__.py:88 |
545 | -#: code:addons/msf_doc_import/wizard/wizard_import_po_line.py:240 |
546 | #: report:addons/msf_supply_doc_export/report/report_purchase_order_xls.mako:74 |
547 | #: report:addons/msf_supply_doc_export/report/report_request_for_quotation_xls.mako:74 |
548 | #: report:addons/msf_supply_doc_export/report/report_sale_order_xls.mako:74 |
549 | @@ -57876,6 +57903,12 @@ |
550 | msgstr "Prix" |
551 | |
552 | #. module: msf_doc_import |
553 | +#: code:addons/msf_doc_import/wizard/wizard_import_po_line.py:240 |
554 | +#, python-format |
555 | +msgid "price" |
556 | +msgstr "prix" |
557 | + |
558 | +#. module: msf_doc_import |
559 | #: view:wizard.import.po:0 |
560 | #: view:wizard.import.po.line:0 |
561 | #: view:wizard.import.ad.line:0 |
562 | @@ -66696,12 +66729,17 @@ |
563 | #: field:purchase.order,delivery_confirmed_date:0 |
564 | #: code:addons/msf_supply_doc_export/msf_supply_doc_export.py:1067 |
565 | #: code:addons/msf_doc_import/wizard/__init__.py:57 |
566 | +#: report:addons/msf_supply_doc_export/report/report_request_for_quotation_xls.mako:76 |
567 | +#: field:update.lines,delivery_confirmed_date:0 |
568 | +#, python-format |
569 | +msgid "Confirmed Delivery Date" |
570 | +msgstr "Date de Livraison Confirmée" |
571 | + |
572 | +#. module: msf_doc_import |
573 | #: code:addons/msf_doc_import/wizard/wizard_import_po_line.py:258 |
574 | -#: report:addons/msf_supply_doc_export/report/report_request_for_quotation_xls.mako:76 |
575 | -#: field:update.lines,delivery_confirmed_date:0 |
576 | #, python-format |
577 | -msgid "Confirmed Delivery Date" |
578 | -msgstr "Date de Livraison Confirmée" |
579 | +msgid "confirmed delivery date" |
580 | +msgstr "date de livraison confirmée" |
581 | |
582 | #. modules: purchase, msf_order_date, purchase_override |
583 | #: field:purchase.order.line,confirmed_delivery_date:0 |
584 | @@ -93148,7 +93186,6 @@ |
585 | #: report:addons/msf_doc_import/report/po_simulation_screen_xls_report.mako:245 |
586 | #: code:addons/msf_doc_import/wizard/__init__.py:58 |
587 | #: code:addons/msf_doc_import/wizard/__init__.py:83 |
588 | -#: code:addons/msf_doc_import/wizard/wizard_import_po_line.py:267 |
589 | #: code:addons/msf_doc_import/wizard/wizard_in_simulation_screen.py:45 |
590 | #: code:addons/msf_doc_import/wizard/wizard_po_simulation_screen.py:71 |
591 | #: field:msf.doc.import.accounting.lines,currency_id:0 |
592 | @@ -93267,6 +93304,12 @@ |
593 | msgid "Currency" |
594 | msgstr "Devise" |
595 | |
596 | +#. module: msf_doc_import |
597 | +#: code:addons/msf_doc_import/wizard/wizard_import_po_line.py:267 |
598 | +#, python-format |
599 | +msgid "currency" |
600 | +msgstr "devise" |
601 | + |
602 | #. module: base |
603 | #: selection:res.config.users,context_tz:0 |
604 | #: selection:res.users,context_tz:0 |
605 | @@ -110797,8 +110840,8 @@ |
606 | #. module: procurement_cycle |
607 | #: code:addons/procurement_cycle/replenishment.py:3005 |
608 | #, python-format |
609 | -msgid "XLS Line %d: FROM DATE %d, date is not valid, found %s" |
610 | -msgstr "Ligne XLS %d: DATE DE %d invalide, trouvé %s" |
611 | +msgid "XLS Line %d: \"FROM DATE\" date is not valid, found %s" |
612 | +msgstr "Ligne XLS %d: date \"DATE DE\" invalide, trouvé %s" |
613 | |
614 | #. module: procurement_cycle |
615 | #: code:addons/procurement_cycle/replenishment.py:3023 |
616 | @@ -110815,8 +110858,8 @@ |
617 | #. module: procurement_cycle |
618 | #: code:addons/procurement_cycle/replenishment.py:3010 |
619 | #, python-format |
620 | -msgid "XLS Line %d: TO DATE %d, date is not valid, found %s" |
621 | -msgstr "Ligne XLS %d: DATE À %d invalide, trouvé %s" |
622 | +msgid "XLS Line %d: \"TO DATE\" date is not valid, found %s" |
623 | +msgstr "Ligne XLS %d: date \"DATE À\" invalide, trouvé %s" |
624 | |
625 | #. module: procurement_cycle |
626 | #: code:addons/procurement_cycle/replenishment.py:2999 |
627 | |
628 | === modified file 'bin/addons/msf_supply_doc_export/wizard/wizard_pick_import.py' |
629 | --- bin/addons/msf_supply_doc_export/wizard/wizard_pick_import.py 2021-01-14 09:02:32 +0000 |
630 | +++ bin/addons/msf_supply_doc_export/wizard/wizard_pick_import.py 2022-07-21 13:40:33 +0000 |
631 | @@ -236,7 +236,7 @@ |
632 | |
633 | prod_obj = self.pool.get('product.product') |
634 | |
635 | - product_ids = prod_obj.search(cr, uid, [('default_code', '=', line_data['code'])], limit=1, context=context) |
636 | + product_ids = prod_obj.search(cr, uid, [('default_code', '=ilike', line_data['code'])], limit=1, context=context) |
637 | if not product_ids: |
638 | raise osv.except_osv( |
639 | _('Error'), |
640 | |
641 | === modified file 'bin/addons/procurement_cycle/replenishment.py' |
642 | --- bin/addons/procurement_cycle/replenishment.py 2022-05-20 10:03:35 +0000 |
643 | +++ bin/addons/procurement_cycle/replenishment.py 2022-07-21 13:40:33 +0000 |
644 | @@ -3605,7 +3605,7 @@ |
645 | prod_code = row.cells[0].data |
646 | if not prod_code: |
647 | continue |
648 | - prod_code = prod_code.strip() |
649 | + prod_code = prod_code.strip().upper() |
650 | |
651 | seg_ref = row.cells[3].data |
652 | if not seg_ref: |
653 | @@ -4215,7 +4215,6 @@ |
654 | else: |
655 | data_towrite['product_id'] = prod_id[0] |
656 | |
657 | - |
658 | if cells_nb < 5: |
659 | line_error.append(_('XLS Line %d: dates from and to required') % (idx,)) |
660 | error += line_error |
661 | @@ -4223,12 +4222,12 @@ |
662 | continue |
663 | |
664 | if not row.cells[3].type == 'datetime': |
665 | - line_error.append(_('XLS Line %d: FROM DATE %d, date is not valid, found %s') % (idx, row.cells[3].data)) |
666 | + line_error.append(_('XLS Line %d: "FROM DATE" date is not valid, found %s') % (idx, row.cells[3].data)) |
667 | error += line_error |
668 | continue |
669 | |
670 | if not row.cells[4].type == 'datetime': |
671 | - line_error.append(_('XLS Line %d: TO DATE %d, date is not valid, found %s') % (idx, row.cells[4].data)) |
672 | + line_error.append(_('XLS Line %d: "TO DATE" date is not valid, found %s') % (idx, row.cells[4].data)) |
673 | error += line_error |
674 | continue |
675 | |
676 | @@ -4239,11 +4238,11 @@ |
677 | if error_date.get('warning', {}).get('message'): |
678 | line_error.append(_('XLS Line %d: %s') % (idx, error_date['warning']['message'])) |
679 | |
680 | - |
681 | - if cells_nb > 6 and row.cells[6].data and not isinstance(row.cells[6].data, (int, long, float)): |
682 | - line_error.append(_('XLS Line %d: Missing Qty must be a number, found %s') % (idx, row.cells[6].data)) |
683 | - else: |
684 | - data_towrite['qty_missed'] = row.cells[6].data |
685 | + if cells_nb > 6: |
686 | + if row.cells[6].data and not isinstance(row.cells[6].data, (int, long, float)): |
687 | + line_error.append(_('XLS Line %d: Missing Qty must be a number, found %s') % (idx, row.cells[6].data)) |
688 | + else: |
689 | + data_towrite['qty_missed'] = row.cells[6].data |
690 | |
691 | replace_prod_col = 7 |
692 | for sub in [1, 2, 3]: |
693 | |
694 | === modified file 'bin/addons/sale/wizard/internal_request_import.py' |
695 | --- bin/addons/sale/wizard/internal_request_import.py 2022-03-21 10:18:41 +0000 |
696 | +++ bin/addons/sale/wizard/internal_request_import.py 2022-07-21 13:40:33 +0000 |
697 | @@ -612,7 +612,7 @@ |
698 | comment = vals[7] |
699 | if product_code: |
700 | product_code = tools.ustr(product_code) |
701 | - prod_ids = prod_obj.search(cr, uid, [('default_code', '=', product_code)], limit=1, context=context) |
702 | + prod_ids = prod_obj.search(cr, uid, [('default_code', '=ilike', product_code)], limit=1, context=context) |
703 | if prod_ids: |
704 | product_id = prod_ids[0] |
705 | prod_cols = ['standard_price', 'uom_id', 'uom_po_id'] |
706 | @@ -665,7 +665,7 @@ |
707 | line_errors += _('Quantity must be a number. ') |
708 | |
709 | # Cost Price and UoM |
710 | - uom_ids = uom_obj.search(cr, uid, [('name', '=', vals[5])], limit=1, context=context) |
711 | + uom_ids = uom_obj.search(cr, uid, [('name', '=ilike', vals[5])], limit=1, context=context) |
712 | if product_id and product: |
713 | cost_price = vals[4] |
714 | try: |
715 | |
716 | === modified file 'bin/addons/stock/physical_inventory.py' |
717 | --- bin/addons/stock/physical_inventory.py 2022-05-19 09:23:30 +0000 |
718 | +++ bin/addons/stock/physical_inventory.py 2022-07-21 13:40:33 +0000 |
719 | @@ -687,7 +687,7 @@ |
720 | cs_to_reset = [] |
721 | uom_ids = product_uom_obj.search(cr, uid, [], context=context) |
722 | for uom in product_uom_obj.read(cr, uid, uom_ids, ['name'], context=context): |
723 | - all_uom[uom['name']] = uom['id'] |
724 | + all_uom[uom['name'].lower()] = uom['id'] |
725 | |
726 | for row_index, row in enumerate(counting_sheet_file.getRows()): |
727 | # === Process header === |
728 | @@ -742,7 +742,7 @@ |
729 | |
730 | # Check product_code and type |
731 | product_code = row.cells[1].data |
732 | - product_ids = product_obj.search(cr, uid, [('default_code', '=like', product_code)], context=context) |
733 | + product_ids = product_obj.search(cr, uid, [('default_code', '=ilike', product_code)], context=context) |
734 | product_id = False |
735 | if len(product_ids) == 1: |
736 | product_id = product_ids[0] |
737 | @@ -754,7 +754,7 @@ |
738 | |
739 | # Check UoM |
740 | product_uom_id = False |
741 | - product_uom = row.cells[3].data |
742 | + product_uom = row.cells[3].data.lower() |
743 | if product_uom not in all_uom: |
744 | add_error(_("""UoM %s unknown""") % product_uom, row_index, 3) |
745 | else: |
746 | @@ -922,7 +922,7 @@ |
747 | product_code = row.cells[2].data |
748 | line_no = row.cells[0].data |
749 | # check if line number and product code are matching together |
750 | - product_id = product_obj.search(cr, uid, [('default_code', '=like', product_code)], context=context) |
751 | + product_id = product_obj.search(cr, uid, [('default_code', '=ilike', product_code)], context=context) |
752 | disc_line_found = self.pool.get('physical.inventory.discrepancy').search(cr, uid, [ |
753 | ('inventory_id', '=', inventory_rec.id), |
754 | ('line_no', '=', int(line_no)), |