From c6bdeb99569c8d9e27bb5fe2387c15c8949c4c71 Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Thu, 6 Feb 2014 14:24:16 +0100 Subject: [PATCH] SL::DB::DeliveryOrder: angepasste Lieferadressen richtig behandeln --- SL/DB/DeliveryOrder.pm | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/SL/DB/DeliveryOrder.pm b/SL/DB/DeliveryOrder.pm index 8409c2b91..cc4d930ee 100644 --- a/SL/DB/DeliveryOrder.pm +++ b/SL/DB/DeliveryOrder.pm @@ -106,9 +106,7 @@ sub new_from { # save it, too. my $custom_shipto; if (!$source->shipto_id && $source->id) { - require SL::DB::Shipto; - - my $old = SL::DB::Manager::Shipto->find_by(trans_id => $source->id); + my $old = $source->custom_shipto; if ($old) { $custom_shipto = SL::DB::Shipto->new( map { +($_ => $old->$_) } @@ -116,6 +114,7 @@ sub new_from { map { $_->name } @{ $old->meta->columns } ); + $custom_shipto->module('DO'); } } else { -- 2.20.1