Auftrags-Controller: Workflow Angebot->Auftrag nur, wenn gespeichert
authorBernd Bleßmann <bernd@kivitendo-premium.de>
Fri, 23 Feb 2018 14:28:47 +0000 (15:28 +0100)
committerBernd Bleßmann <bernd@kivitendo-premium.de>
Fri, 23 Feb 2018 14:28:47 +0000 (15:28 +0100)
SL/Controller/Order.pm

index 8ee73f9..b87049a 100644 (file)
@@ -1423,13 +1423,15 @@ sub _setup_edit_action_bar {
         ],
         action => [
           t8('Sales Order'),
-          submit  => [ '#order_form', { action => "Order/sales_order" } ],
-          only_if => (any { $self->type eq $_ } (_sales_quotation_type())),
+          submit   => [ '#order_form', { action => "Order/sales_order" } ],
+          only_if  => (any { $self->type eq $_ } (_sales_quotation_type())),
+          disabled => !$self->order->id ? t8('This object has not been saved yet.') : undef,
         ],
         action => [
           t8('Purchase Order'),
-          submit  => [ '#order_form', { action => "Order/purchase_order" } ],
-          only_if   => (any { $self->type eq $_ } (_request_quotation_type())),
+          submit   => [ '#order_form', { action => "Order/purchase_order" } ],
+          only_if  => (any { $self->type eq $_ } (_request_quotation_type())),
+          disabled => !$self->order->id ? t8('This object has not been saved yet.') : undef,
         ],
       ], # end of combobox "Workflow"