Part Controller - Artikelnummern ändern prüft auf used_in_record
authorG. Richardson <information@kivitendo-premium.de>
Tue, 30 May 2017 13:34:43 +0000 (15:34 +0200)
committerG. Richardson <information@kivitendo-premium.de>
Tue, 30 May 2017 13:36:46 +0000 (15:36 +0200)
nicht auf mehr orphaned.

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

index 6477a90..267c5d5 100644 (file)
@@ -682,7 +682,7 @@ sub parse_form {
 
   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 not $self->orphaned;
+  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 c9a2d69..a923d91 100644 (file)
@@ -20,7 +20,7 @@
              <tr>
               <th align="right">[% 'Part Number' | $T8 %]</th>
               [% SET readonly = 1 %]
-              [%- IF !SELF.part.id or SELF.part.orphaned %][% readonly = 0 %][% END %]
+              [%- 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>
              </tr>
              <tr>