X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/blobdiff_plain/fa7a37a2e2d294b1dfe6ef5b89e5acb0f8c4eb3b..fe7ed06d080e72f5435dc2e2fdff3eaf6e158cd6:/SL/Controller/Part.pm?ds=inline diff --git a/SL/Controller/Part.pm b/SL/Controller/Part.pm index 97c0159cc..4349b1fda 100644 --- a/SL/Controller/Part.pm +++ b/SL/Controller/Part.pm @@ -14,7 +14,8 @@ use Rose::Object::MakeMethods::Generic ( ); # safety -__PACKAGE__->run_before(sub { $::auth->assert('part_service_assembly_edit') }); +__PACKAGE__->run_before(sub { $::auth->assert('part_service_assembly_edit') }, + except => [ qw(ajax_autocomplete part_picker_search part_picker_result) ]); sub action_ajax_autocomplete { my ($self, %params) = @_; @@ -50,6 +51,7 @@ sub action_ajax_autocomplete { partnumber => $_->partnumber, description => $_->description, type => $_->type, + unit => $_->unit, } } @{ $self->parts }; # neato: if exact match triggers we don't even need the init_parts @@ -71,7 +73,7 @@ sub action_part_picker_result { } sub init_parts { - $_[0]->models->get (with_objects => [ qw(unit_obj) ]); + $_[0]->models->get; } sub init_models { @@ -79,14 +81,14 @@ sub init_models { SL::Controller::Helper::GetModels->new( controller => $self, - model => 'Part', sorted => { _default => { by => 'partnumber', dir => 1, }, partnumber => t8('Partnumber'), - } + }, + with_objects => [ qw(unit_obj) ], ); }