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

« back to all changes in this revision

Viewing changes to msf_doc_import/wizard/wizard_import_ir_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:
234
234
 
235
235
                        # write order line on FO
236
236
                        vals['order_line'].append((0, 0, to_write))
237
 
                        sale_line_obj.create(cr, uid, to_write, context=context)
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
 
237
                        if sale_obj._check_service(cr, uid, fo_id, vals, context=context):
 
238
                            sale_line_obj.create(cr, uid, to_write, context=context)
 
239
                            if to_write['error_list']:
 
240
                                lines_to_correct += 1
 
241
                            percent_completed = float(line_num)/float(total_line_num-1)*100.0
 
242
                            complete_lines += 1
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)
244
245
                        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))
260
261
                        self.write(cr, uid, ids, {'percent_completed':percent_completed})
261
262
                        if not context.get('yml_test', False):
262
263
                            cr.commit()
 
264
                sale_obj._check_service(cr, uid, ids, vals, context=context)
263
265
            error_log += '\n'.join(error_list)
264
266
            if error_log:
265
267
                error_log = _("Reported errors for ignored lines : \n") + error_log.decode('utf-8')