From 118a8b622238dd7ca8b93e0c120d382d106c1b46 Mon Sep 17 00:00:00 2001 From: "G. Richardson" Date: Mon, 25 Feb 2019 16:58:55 +0100 Subject: [PATCH] Inventory stock_in - select_default_bin Modus MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit wird in der Form / URL ein select_default_bin=1 übergeben, wird der Standardlagerplatz des Artikels vorausgewählt (sofern vorhanden). Ansonsten passiert das Aktualisieren von Lager/Lagerplatz nur, wenn sich der Artikel nach Laden der Seite ändert. --- SL/Controller/Inventory.pm | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/SL/Controller/Inventory.pm b/SL/Controller/Inventory.pm index 479c9ad22..04631a64b 100644 --- a/SL/Controller/Inventory.pm +++ b/SL/Controller/Inventory.pm @@ -45,6 +45,12 @@ sub action_stock_in { $::form->{title} = t8('Stock'); + # Sometimes we want to open stock_in with a part already selected, but only + # the parts_id is passed in the url (and not also warehouse, bin and unit). + # Setting select_default_bin in the form will make sure the default warehouse + # and bin of that part will already be preselected, as normally + # set_target_from_part is only called when a part is changed. + $self->set_target_from_part if $::form->{select_default_bin}; $::request->layout->focus('#part_id_name'); my $transfer_types = WH->retrieve_transfer_types('in'); map { $_->{description} = $main::locale->text($_->{description}) } @{ $transfer_types }; -- 2.20.1