+ } elsif ( $self->settings->{article_number_policy} eq 'update_parts' || $self->settings->{article_number_policy} eq 'update_parts_sn') {
+
+ # Update parts table
+ # copy only the data which is not explicit copied by "methods"
+
+ map { $entry->{part}->$_( $object->$_ ) if defined $object->$_ } qw(description notes weight ean rop image
+ drawing ve gv
+ unit
+ has_sernumber not_discountable obsolete
+ payment_id
+ sellprice listprice lastcost);
+
+ if (defined $raw->{"sellprice"} || defined $raw->{"listprice"} || defined $raw->{"lastcost"}) {
+ # merge prices
+ my %prices_by_pricegroup_id = map { $_->pricegroup->id => $_ } $entry->{part}->prices, $object->prices;
+ $entry->{part}->prices(grep { $_ } map { $prices_by_pricegroup_id{$_->id} } @{ $self->all_pricegroups });
+ }
+
+ # Update translation
+ my @translations;
+ push @translations, $entry->{part}->translations;
+ foreach my $language (@{ $self->all_languages }) {
+ my $desc;
+ $desc = $raw->{"description_". $language->article_code} if defined $raw->{"description_". $language->article_code};
+ my $notes;
+ $notes = $raw->{"notes_". $language->article_code} if defined $raw->{"notes_". $language->article_code};
+ next unless $desc || $notes;
+
+ push @translations, SL::DB::Translation->new(language_id => $language->id,
+ translation => $desc,
+ longdescription => $notes);
+ }
+ $entry->{part}->translations(\@translations) if @translations;
+
+ # Update cvars
+ my %type_to_column = ( text => 'text_value',
+ textfield => 'text_value',
+ select => 'text_value',
+ date => 'timestamp_value_as_date',
+ timestamp => 'timestamp_value_as_date',
+ number => 'number_value_as_number',
+ bool => 'bool_value' );
+ my @cvars;
+ push @cvars, $entry->{part}->custom_variables;
+ foreach my $config (@{ $self->all_cvar_configs }) {
+ next unless exists $raw->{ "cvar_" . $config->name };
+ my $value = $raw->{ "cvar_" . $config->name };
+ my $column = $type_to_column{ $config->type } || die "Program logic error: unknown custom variable storage type";
+ push @cvars, SL::DB::CustomVariable->new(config_id => $config->id, $column => $value, sub_module => '');
+ }
+ $entry->{part}->custom_variables(\@cvars) if @cvars;
+
+ # save Part Update
+ push @{ $entry->{information} }, $::locale->text('Updating data of existing entry in database');
+
+ $entry->{object_to_save} = $entry->{part};
+ # copy all other data via "methods"
+ my $methods = $self->controller->headers->{methods};
+ $entry->{object_to_save}->$_( $entry->{object}->$_ ) for @{ $methods }, keys %{ $self->clone_methods };