@@ -, +, @@ $ kshell k$ prove t/db_dependent/Koha/Acquisition/Basket.t --- Koha/Acquisition/Basket.pm | 3 ++- Koha/Schema/Result/Aqbasket.pm | 12 ++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) --- a/Koha/Acquisition/Basket.pm +++ a/Koha/Acquisition/Basket.pm @@ -54,7 +54,8 @@ Returns the basket group associated to this basket sub basket_group { my ($self) = @_; - my $basket_group_rs = $self->_result->basketgroupid; + + my $basket_group_rs = $self->_result->basket_group; return unless $basket_group_rs; return Koha::Acquisition::BasketGroup->_new_from_dbic( $basket_group_rs ); } --- a/Koha/Schema/Result/Aqbasket.pm +++ a/Koha/Schema/Result/Aqbasket.pm @@ -328,6 +328,18 @@ __PACKAGE__->has_many( { cascade_copy => 0, cascade_delete => 0 }, ); +__PACKAGE__->belongs_to( + "basket_group", + "Koha::Schema::Result::Aqbasketgroup", + { 'foreign.id' => "self.basketgroupid" }, + { + is_deferrable => 1, + join_type => "LEFT", + on_delete => "RESTRICT", + on_update => "CASCADE", + }, +); + sub koha_object_class { 'Koha::Acquisition::Basket'; } --