-for my $field (qw(qty)) {
- __PACKAGE__->attr_number($field, places => -2);
-}
+__PACKAGE__->meta->add_relationship(
+ inventory => {
+ type => 'one to one',
+ class => 'SL::DB::Inventory',
+ column_map => { id => 'delivery_order_items_stock_id' },
+ },
+ unit_obj => {
+ type => 'many to one',
+ class => 'SL::DB::Unit',
+ column_map => { unit => 'name' },
+ },
+);
+
+__PACKAGE__->meta->initialize;