From: Sven Schöling Date: Fri, 10 Dec 2021 12:54:41 +0000 (+0100) Subject: DeliveryPlan: Bei Umwandlung Typ an new_from geben X-Git-Tag: kivitendo-mebil_0.1-0~10^2~2^2~216^2~35 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=f15ebd7da4e55d14e1f436034ac4723ba543b765;p=kivitendo-erp.git DeliveryPlan: Bei Umwandlung Typ an new_from geben --- diff --git a/SL/Controller/DeliveryOrder.pm b/SL/Controller/DeliveryOrder.pm index d7a0c90b3..a0d9c19d6 100644 --- a/SL/Controller/DeliveryOrder.pm +++ b/SL/Controller/DeliveryOrder.pm @@ -18,6 +18,7 @@ use SL::DB::History; use SL::DB::Order; use SL::DB::Default; use SL::DB::Unit; +use SL::DB::Order; use SL::DB::Part; use SL::DB::PartClassification; use SL::DB::PartsGroup; @@ -85,7 +86,11 @@ sub action_add_from_order { # this interfers with init_order $self->{converted_from_oe_id} = delete $::form->{id}; - # TODO copy data and remember to link them on save + $self->type_data->validate($::form->{type}); + + my $order = SL::DB::Order->new(id => $self->{converted_from_oe_id})->load; + + $self->order(SL::DB::DeliveryOrder->new_from($order, type => $::form->{type})); $self->action_add; }