Part Controller - Artikelnummern immer änderbar
authorBernd Bleßmann <bernd@kivitendo-premium.de>
Fri, 2 Jun 2017 09:24:49 +0000 (11:24 +0200)
committerBernd Bleßmann <bernd@kivitendo-premium.de>
Fri, 2 Jun 2017 09:24:49 +0000 (11:24 +0200)
behebt #264 (redmine)

SL/Controller/Part.pm
templates/webpages/part/_basic_data.html

index 267c5d5..10c6c10 100644 (file)
@@ -681,8 +681,6 @@ sub parse_form {
   my $params = delete($::form->{part}) || { };
 
   delete $params->{id};
-  # never overwrite existing partnumber for parts in use, should be a read-only field in that case anyway
-  delete $params->{partnumber} if $self->part->partnumber and $self->part->used_in_record;
   $self->part->assign_attributes(%{ $params});
   $self->part->bin_id(undef) unless $self->part->warehouse_id;
 
index a923d91..38b15d2 100644 (file)
@@ -19,9 +19,7 @@
             <table id="ic3">
              <tr>
               <th align="right">[% 'Part Number' | $T8 %]</th>
-              [% SET readonly = 1 %]
-              [%- IF !SELF.part.id or !SELF.part.used_in_record %][% readonly = 0 %][% END %]
-              <td>[% L.input_tag("part.partnumber", SELF.part.partnumber, size=40, readonly=readonly class="initial_focus") %]</td>
+              <td>[% L.input_tag("part.partnumber", SELF.part.partnumber, size=40, class="initial_focus") %]</td>
              </tr>
              <tr>
               <th align="right">[% 'Part Classification' | $T8 %]</th>
     <td><hr size="3" noshade></td>
   </tr>
  </table>
-