From: Bernd Bleßmann Date: Fri, 22 Apr 2022 15:21:03 +0000 (+0200) Subject: Artikel-Controller: Workflow zu Lieferantenauftrag: Lieferant vorauswählen, … X-Git-Tag: kivitendo-mebil_0.1-0~10^2~2^2~47 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=2b2a37fd95a5cae44a8c6862e79f86d2cbc2a189;p=kivitendo-erp.git Artikel-Controller: Workflow zu Lieferantenauftrag: Lieferant vorauswählen, … … wenn es genau einen Lieferanten beim Artikel gibt. --- 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');