]> wagnertech.de Git - kivitendo-erp.git/blobdiff - SL/Controller/RequirementSpecItem.pm
Pflichtenhefte: Standard-Artikel beim Anlegen von Abschnitten speichern
[kivitendo-erp.git] / SL / Controller / RequirementSpecItem.pm
index 98e160ab88d149f9df787efb1334a64fc703e193..2cbf11447ff7c6e528ad943b08e5538ae543b05a 100644 (file)
@@ -172,6 +172,10 @@ sub action_ajax_create {
   my $attributes      = $::form->{$prefix}     || die "Missing parameter group '${prefix}'";
   my $insert_after    = delete $attributes->{insert_after};
 
+  if (!$attributes->{parent_id}) {
+    $attributes->{order_part_id} ||= $::instance_conf->get_requirement_spec_section_order_part_id;
+  }
+
   my @errors = $self->item(SL::DB::RequirementSpecItem->new(%{ $attributes }))->validate;
   return $self->js->error(@errors)->render($self) if @errors;