From 0c537bffbf60f078202ca72977b3e35f2e0f0fd7 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Sven=20Sch=C3=B6ling?= Date: Wed, 24 Sep 2014 11:12:38 +0200 Subject: [PATCH] CsvImport/Parts: makemodels fix inidzieren --- SL/Controller/CsvImport/Part.pm | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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; -- 2.20.1