X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/blobdiff_plain/afd5395bfad1a84a590d567f8cb2d4e4967b16e3..2b2a37fd95a5cae44a8c6862e79f86d2cbc2a189:/SL/Controller/Part.pm diff --git a/SL/Controller/Part.pm b/SL/Controller/Part.pm index 061a532b5..aae4e531e 100644 --- a/SL/Controller/Part.pm +++ b/SL/Controller/Part.pm @@ -163,11 +163,18 @@ sub action_save { sub action_save_and_purchase_order { my ($self) = @_; - delete $::form->{previousform}; + my $session_value; + if (1 == scalar @{$self->part->makemodels}) { + my $prepared_form = Form->new(''); + $prepared_form->{vendor_id} = $self->part->makemodels->[0]->make; + $session_value = $::auth->save_form_in_session(form => $prepared_form); + } + $::form->{callback} = $self->url_for( controller => 'Order', action => 'return_from_create_part', type => 'purchase_order', + previousform => $session_value, ); $self->_run_action('save');