~unifield-team/unifield-wm/us-826

« back to all changes in this revision

Viewing changes to msf_doc_import/wizard/wizard_import_fo_line.py

  • Committer: jf
  • Date: 2016-02-09 15:00:57 UTC
  • mfrom: (2764.1.4 unifield-wm)
  • Revision ID: jfb@tempo-consulting.fr-20160209150057-o3add088h41lzitp
Tags: uf2.1-0rc3
US-923 [FIX] Physical inventory tree view + PO follow up per supplier: no tree view
lp:~unifield-team/unifield-wm/us-923

Show diffs side-by-side

added added

removed removed

Lines of Context:
233
233
 
234
234
                        # write order line on FO
235
235
                        vals['order_line'].append((0, 0, to_write))
236
 
                        created_line.append(sale_line_obj.create(cr, uid, to_write, context=context_sol_create))
237
 
                        if to_write['error_list']:
238
 
                            lines_to_correct += 1
239
 
                        percent_completed = float(line_num)/float(total_line_num-1)*100.0
240
 
                        complete_lines += 1
 
236
                        if sale_obj._check_service(cr, uid, fo_id, vals, context=context):
 
237
                            created_line.append(sale_line_obj.create(cr, uid, to_write, context=context_sol_create))
 
238
                            if to_write['error_list']:
 
239
                                lines_to_correct += 1
 
240
                            percent_completed = float(line_num)/float(total_line_num-1)*100.0
 
241
                            complete_lines += 1
241
242
 
242
243
                    except IndexError, e:
243
244
                        error_log += _("Line %s in the Excel file was added to the file of the lines with errors, it got elements outside the defined %s columns. Details: %s") % (line_num, template_col_count, e)
262
263
                            cr.commit()
263
264
 
264
265
                sale_line_obj._call_store_function(cr, uid, created_line, keys=None, result=None, bypass=False, context=context)
265
 
                categ_log = sale_obj.onchange_categ(
266
 
                    cr, uid, [fo_id], wiz_browse.fo_id.categ, context=context).get('warning', {}).get('message', '').upper()
267
 
                categ_log = categ_log.replace('THIS', 'THE')
268
266
            error_log += '\n'.join(error_list)
269
267
            if error_log:
270
268
                error_log = _("Reported errors for ignored lines : \n") + error_log
271
269
            end_time = time.time()
272
270
            total_time = str(round(end_time-start_time)) + _(' second(s)')
273
271
            final_message = _('''
274
 
%s
275
272
Importation completed in %s!
276
273
# of imported lines : %s on %s lines
277
274
# of ignored lines: %s
279
276
%s
280
277
 
281
278
%s
282
 
''') % (categ_log, total_time ,complete_lines, line_num, ignore_lines, lines_to_correct, error_log, message)
 
279
''') % (total_time ,complete_lines, line_num, ignore_lines, lines_to_correct, error_log, message)
283
280
            wizard_vals = {'message': final_message, 'state': 'done'}
284
281
            if line_with_error:
285
282
                file_to_export = wiz_common_import.export_file_with_error(cr, uid, ids, line_with_error=line_with_error, header_index=header_index)