X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/kivitendo-erp.git/blobdiff_plain/2e97532c88dacf9523576df4028b6f7df5967ea8..90a1b6fad6aeeab84fc96d6511fdf42fff315df5:/SL/Controller/Part.pm diff --git a/SL/Controller/Part.pm b/SL/Controller/Part.pm index 357a3dd07..e427cab4a 100644 --- a/SL/Controller/Part.pm +++ b/SL/Controller/Part.pm @@ -42,8 +42,6 @@ __PACKAGE__->run_before(sub { $::auth->assert('part_service_assembly_edit') }, __PACKAGE__->run_before('check_part_id', only => [ qw(edit delete) ]); -__PACKAGE__->run_before('normalize_text_blocks'); - # actions for editing parts # sub action_add_part { @@ -646,6 +644,8 @@ sub prepare_assortment_render_vars { sub prepare_assembly_render_vars { my ($self) = @_; + croak("Need assembly item(s) to create a 'save as new' assembly.") unless $self->part->items; + my %vars = ( items_sellprice_sum => $self->part->items_sellprice_sum, items_lastcost_sum => $self->part->items_lastcost_sum, assembly_html => $self->render_assembly_items_to_html( \@{ $self->part->items } ), @@ -733,6 +733,8 @@ sub parse_form { $self->part->assign_attributes(%{ $params}); $self->part->bin_id(undef) unless $self->part->warehouse_id; + $self->normalize_text_blocks; + # Only reset items ([]) and rewrite from form if $::form->{assortment_items} isn't empty. This # will be the case for used assortments when saving, or when a used assortment # is "used as new"