Relationship delivery_order_stock_entries für DeliveryOrderItem
authorG. Richardson <information@kivitendo-premium.de>
Mon, 17 Oct 2016 15:18:30 +0000 (17:18 +0200)
committerG. Richardson <information@kivitendo-premium.de>
Mon, 17 Oct 2016 15:47:03 +0000 (17:47 +0200)
SL/DB/DeliveryOrderItem.pm

index ba2c2e0..bac4660 100644 (file)
@@ -19,6 +19,17 @@ use SL::DB::Helper::CustomVariables (
 
 __PACKAGE__->meta->make_manager_class;
 
+__PACKAGE__->meta->add_relationship(
+  delivery_order_stock_entries => {
+    type         => 'one to many',
+    class        => 'SL::DB::DeliveryOrderItemsStock',
+    column_map   => { id => 'delivery_order_item_id' },
+    manager_args => {
+      with_objects => [ 'inventory' ]
+    },
+  },
+);
+
 __PACKAGE__->meta->initialize;
 
 __PACKAGE__->configure_acts_as_list(group_by => [qw(delivery_order_id)]);