From: G. Richardson Date: Wed, 11 Jan 2017 10:14:17 +0000 (+0100) Subject: Part Controller - Artikelnummer von unbenutzten Artikeln ändern X-Git-Tag: release-3.5.4~1738 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=e2ef75e554021d66214ad31b7c135243cc50765c;p=kivitendo-erp.git Part Controller - Artikelnummer von unbenutzten Artikeln ändern --- diff --git a/SL/Controller/Part.pm b/SL/Controller/Part.pm index 350edec13..5dc37b45a 100644 --- a/SL/Controller/Part.pm +++ b/SL/Controller/Part.pm @@ -669,8 +669,8 @@ sub parse_form { my $params = delete($::form->{part}) || { }; delete $params->{id}; - # never overwrite existing partnumber, should be a read-only field anyway - delete $params->{partnumber} if $self->part->partnumber; + # 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; $self->part->assign_attributes(%{ $params}); $self->part->bin_id(undef) unless $self->part->warehouse_id; diff --git a/templates/webpages/part/_basic_data.html b/templates/webpages/part/_basic_data.html index 6b79e51aa..c9a2d69d4 100644 --- a/templates/webpages/part/_basic_data.html +++ b/templates/webpages/part/_basic_data.html @@ -20,7 +20,7 @@ [% 'Part Number' | $T8 %] [% SET readonly = 1 %] - [% UNLESS SELF.part.id %][% readonly = 0 %][% END %] + [%- IF !SELF.part.id or SELF.part.orphaned %][% readonly = 0 %][% END %] [% L.input_tag("part.partnumber", SELF.part.partnumber, size=40, readonly=readonly class="initial_focus") %]