~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: Quentin THEURET
  • Date: 2016-02-19 09:09:29 UTC
  • Revision ID: qt@tempo-consulting.fr-20160219090929-8tdq1manigke86yg
US-826 [FIX] Add message on non-consistency of order and products in order lines at import

Show diffs side-by-side

added added

removed removed

Lines of Context:
262
262
                            cr.commit()
263
263
 
264
264
                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')
265
268
            error_log += '\n'.join(error_list)
266
269
            if error_log:
267
270
                error_log = _("Reported errors for ignored lines : \n") + error_log
268
271
            end_time = time.time()
269
272
            total_time = str(round(end_time-start_time)) + _(' second(s)')
270
273
            final_message = _('''
 
274
%s
271
275
Importation completed in %s!
272
276
# of imported lines : %s on %s lines
273
277
# of ignored lines: %s
275
279
%s
276
280
 
277
281
%s
278
 
''') % (total_time ,complete_lines, line_num, ignore_lines, lines_to_correct, error_log, message)
 
282
''') % (categ_log, total_time ,complete_lines, line_num, ignore_lines, lines_to_correct, error_log, message)
279
283
            wizard_vals = {'message': final_message, 'state': 'done'}
280
284
            if line_with_error:
281
285
                file_to_export = wiz_common_import.export_file_with_error(cr, uid, ids, line_with_error=line_with_error, header_index=header_index)