From 5e4b26e941e3fc0f9df8fa2138d1cec015a6cf76 Mon Sep 17 00:00:00 2001 From: "Laurent Mignon (ACSONE)" Date: Fri, 12 Jul 2024 16:23:46 +0200 Subject: [PATCH 1/3] [IMP] shopfloor_full_location_reservation: Code compatibility with PR #917 --- .../services/location_content_transfer.py | 6 ++---- test-requirements.txt | 3 +-- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/shopfloor_full_location_reservation/services/location_content_transfer.py b/shopfloor_full_location_reservation/services/location_content_transfer.py index a646d922557..f9bc13622c1 100644 --- a/shopfloor_full_location_reservation/services/location_content_transfer.py +++ b/shopfloor_full_location_reservation/services/location_content_transfer.py @@ -7,10 +7,8 @@ class LocationContentTransfer(Component): _inherit = "shopfloor.location.content.transfer" - def _find_location_move_lines_from_scan_location(self, *args, **kwargs): - move_lines = super()._find_location_move_lines_from_scan_location( - *args, **kwargs - ) + def _select_move_lines_first_location(self, move_lines): + move_lines = super()._select_move_lines_first_location(move_lines) if not self.work.menu.full_location_reservation: return move_lines diff --git a/test-requirements.txt b/test-requirements.txt index 7fe4bbe4f3a..df20c4fc21d 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -1,5 +1,4 @@ vcrpy-unittest odoo_test_helper odoo-addon-stock-full-location-reservation @ git+https://github.com/OCA/wms.git@refs/pull/794/head#subdirectory=setup/stock_full_location_reservation -odoo-addon-shopfloor-base @ git+https://github.com/OCA/wms.git@refs/pull/899/head#subdirectory=setup/shopfloor_base -odoo-addon-shopfloor @ git+https://github.com/OCA/wms.git@refs/pull/899/head#subdirectory=setup/shopfloor +odoo-addon-shopfloor @ git+https://github.com/OCA/wms.git@refs/pull/917/head#subdirectory=setup/shopfloor From 9c140b8ed078fe2cfeca07bfbc723f0456bb5950 Mon Sep 17 00:00:00 2001 From: Denis Roussel Date: Wed, 21 Aug 2024 14:41:56 +0200 Subject: [PATCH 2/3] [IMP] shopfloor_full_location_reservation: Filter lines with one location As after full reservation, returned lines could concern several source locations, we need to filter them one more time for the first location --- .../services/location_content_transfer.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/shopfloor_full_location_reservation/services/location_content_transfer.py b/shopfloor_full_location_reservation/services/location_content_transfer.py index f9bc13622c1..421e430bf1d 100644 --- a/shopfloor_full_location_reservation/services/location_content_transfer.py +++ b/shopfloor_full_location_reservation/services/location_content_transfer.py @@ -8,14 +8,18 @@ class LocationContentTransfer(Component): _inherit = "shopfloor.location.content.transfer" def _select_move_lines_first_location(self, move_lines): - move_lines = super()._select_move_lines_first_location(move_lines) if not self.work.menu.full_location_reservation: - return move_lines + return super()._select_move_lines_first_location(move_lines) if any(move_lines.move_id.mapped("is_full_location_reservation")): - return move_lines + return super()._select_move_lines_first_location(move_lines) + move_lines = super()._select_move_lines_first_location(move_lines) move_lines |= move_lines._full_location_reservation().move_line_ids + + # As lines should concern only one source location and as lines + # can have been split, we need to retrieve only those with first location + move_lines = super()._select_move_lines_first_location(move_lines.exists()) return move_lines.exists() def _move_lines_cancel_work(self, move_lines): From d477836c5ebd4b4039d6159fae05c941bc6874dc Mon Sep 17 00:00:00 2001 From: Denis Roussel Date: Wed, 4 Sep 2024 19:15:58 +0200 Subject: [PATCH 3/3] [IMP] shopfloor_full_location_reservation: Use strict mode for full reservation --- .../services/location_content_transfer.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shopfloor_full_location_reservation/services/location_content_transfer.py b/shopfloor_full_location_reservation/services/location_content_transfer.py index 421e430bf1d..2a2139d9b14 100644 --- a/shopfloor_full_location_reservation/services/location_content_transfer.py +++ b/shopfloor_full_location_reservation/services/location_content_transfer.py @@ -15,7 +15,7 @@ def _select_move_lines_first_location(self, move_lines): return super()._select_move_lines_first_location(move_lines) move_lines = super()._select_move_lines_first_location(move_lines) - move_lines |= move_lines._full_location_reservation().move_line_ids + move_lines |= move_lines._full_location_reservation(strict=True).move_line_ids # As lines should concern only one source location and as lines # can have been split, we need to retrieve only those with first location