From 2b2a37fd95a5cae44a8c6862e79f86d2cbc2a189 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Bernd=20Ble=C3=9Fmann?= Date: Fri, 22 Apr 2022 17:21:03 +0200 Subject: [PATCH] =?utf8?q?Artikel-Controller:=20Workflow=20zu=20Lieferante?= =?utf8?q?nauftrag:=20Lieferant=20vorausw=C3=A4hlen,=20=E2=80=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit … wenn es genau einen Lieferanten beim Artikel gibt. --- SL/Controller/Part.pm | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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'); -- 2.20.1