use Rose::Object::MakeMethods::Generic
(
scalar => [ qw(controller file csv test_run save_with_cascade) ],
- 'scalar --get_set_init' => [ qw(profile displayable_columns existing_objects class manager_class cvar_columns all_cvar_configs all_languages payment_terms_by delivery_terms_by all_vc vc_by) ],
+ 'scalar --get_set_init' => [ qw(profile displayable_columns existing_objects class manager_class cvar_columns all_cvar_configs all_languages payment_terms_by delivery_terms_by all_vc vc_by clone_methods) ],
);
sub run {
vendors => SL::DB::Manager::Vendor->get_all };
}
+sub init_clone_methods {
+ {}
+}
+
sub force_allow_columns {
return ();
}
}
$object->payment_id($terms->id);
+
+ # register payment_id for method copying later
+ $self->clone_methods->{payment_id} = 1;
}
return 1;
}
$object->delivery_term_id($terms->id);
+
+ # register delivery_term_id for method copying later
+ $self->clone_methods->{delivery_term_id} = 1;
}
return 1;
# Update existing customer/vendor records.
$entry->{object_to_save} = $existing_vc;
- $existing_vc->$_( $entry->{object}->$_ ) for @{ $methods };
+ $existing_vc->$_( $entry->{object}->$_ ) for @{ $methods }, keys %{ $self->clone_methods };
push @{ $entry->{information} }, $::locale->text('Updating existing entry in database');
}
$object->language_id($language->id);
+
+ # register language_id for method copying later
+ $self->clone_methods->{language_id} = 1;
}
return 1;
}
$object->business_id($business->id);
+
+ # register business_id for method copying later
+ $self->clone_methods->{business_id} = 1;
}
return 1;
}
$object->currency_id($currency->id);
+
+ # register currency_id for method copying later
+ $self->clone_methods->{currency_id} = 1;
}
# Set default currency if none was given and take_default is true.