From: Sven Schöling Date: Wed, 24 Sep 2014 09:12:38 +0000 (+0200) Subject: CsvImport/Parts: makemodels fix inidzieren X-Git-Tag: release-3.2.0beta~307 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=0c537bffbf60f078202ca72977b3e35f2e0f0fd7;p=kivitendo-erp.git CsvImport/Parts: makemodels fix inidzieren --- diff --git a/SL/Controller/CsvImport/Part.pm b/SL/Controller/CsvImport/Part.pm index 763793243..75adc9778 100644 --- a/SL/Controller/CsvImport/Part.pm +++ b/SL/Controller/CsvImport/Part.pm @@ -436,13 +436,16 @@ sub handle_makemodel { if ($makemodel_orig) { $makemodel_orig->model($makemodel->model); $makemodel_orig->lastcost($makemodel->lastcost); - $makemodel_orig->sortorder(undef); } else { $entry->{part}->add_makemodels($makemodel); } } + # reindex makemodels + my $i = 0; + $_->sortorder(++$i) for @{ $entry->{part}->makemodels }; + $entry->{part}->makemodel($object->makemodel); $self->save_with_cascade(1) if $found_any;