projects
/
kivitendo-erp.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
ar.pl: Kosmetik: Ausrichtung
[kivitendo-erp.git]
/
SL
/
DB
/
PartClassification.pm
diff --git
a/SL/DB/PartClassification.pm
b/SL/DB/PartClassification.pm
index
e7abe62
..
c02c8b3
100644
(file)
--- a/
SL/DB/PartClassification.pm
+++ b/
SL/DB/PartClassification.pm
@@
-7,6
+7,7
@@
use SL::DB::MetaSetup::PartClassification;
use SL::DB::Manager::PartClassification;
__PACKAGE__->meta->initialize;
use SL::DB::Manager::PartClassification;
__PACKAGE__->meta->initialize;
+__PACKAGE__->before_delete('can_be_deleted');
# check if the description and abbreviation is present
#
# check if the description and abbreviation is present
#
@@
-20,7
+21,12
@@
sub validate {
return @errors;
}
return @errors;
}
+sub can_be_deleted {
+ my ($self) = @_;
+ # The first five part classifications must not be deleted.
+ return defined($self->id) && ($self->id >= 5);
+}
1;
1;