diff --git a/stock_picking_putaway_recompute/README.rst b/stock_picking_putaway_recompute/README.rst index 4db7acea2e1..919088fe563 100644 --- a/stock_picking_putaway_recompute/README.rst +++ b/stock_picking_putaway_recompute/README.rst @@ -51,23 +51,23 @@ unlock products for being reserved for another picking). Configuration ============= -- Enable Stock locations in Inventory > Configuration > Settings -- In order to be able to recompute the putaways, you need to enable it - on the picking type level. +- Enable Stock locations in Inventory > Configuration > Settings +- In order to be able to recompute the putaways, you need to enable it + on the picking type level. Usage ===== -- In a picking where the recompute operation is enabled (see - Configuration), the recompute is available on picking level and on - the detailed operations if enabled. -- If a putaway rule has been changed after product reservation, click - on the button 'Recompute putaways'. This will recompute the - destination locations on all detailed operations that have no done - quantity yet and no result package (as all operations for the same - package should go to the same destination). -- Moreover, the action is available on picking level and on detailed - operation one too. +- In a picking where the recompute operation is enabled (see + Configuration), the recompute is available on picking level and on the + detailed operations if enabled. +- If a putaway rule has been changed after product reservation, click on + the button 'Recompute putaways'. This will recompute the destination + locations on all detailed operations that have no done quantity yet + and no result package (as all operations for the same package should + go to the same destination). +- Moreover, the action is available on picking level and on detailed + operation one too. Bug Tracker =========== @@ -90,7 +90,7 @@ Authors Contributors ------------ -- Denis Roussel denis.roussel@acsone.eu +- Denis Roussel denis.roussel@acsone.eu Maintainers ----------- diff --git a/stock_picking_putaway_recompute/models/stock_move_line.py b/stock_picking_putaway_recompute/models/stock_move_line.py index 6237802fcaf..a81cfdbd274 100644 --- a/stock_picking_putaway_recompute/models/stock_move_line.py +++ b/stock_picking_putaway_recompute/models/stock_move_line.py @@ -43,7 +43,16 @@ def _recompute_putaways(self) -> None: Launches the computation of putaways on operations that are allowed to. """ - self._filtered_for_putaway_recompute()._apply_putaway_strategy() + to_recompute_lines = self._filtered_for_putaway_recompute() + # Reset location destinations to their move destination + # First, protect the field from recomputations as + # value will be reaffected afterwards. + with to_recompute_lines.env.protecting( + ["location_dest_id"], to_recompute_lines + ): + for line in to_recompute_lines: + line.location_dest_id = line.move_id.location_dest_id + to_recompute_lines._apply_putaway_strategy() def action_recompute_putaways(self): self._recompute_putaways() diff --git a/stock_picking_putaway_recompute/static/description/index.html b/stock_picking_putaway_recompute/static/description/index.html index 09ddb887e0b..bf0d68fc78a 100644 --- a/stock_picking_putaway_recompute/static/description/index.html +++ b/stock_picking_putaway_recompute/static/description/index.html @@ -8,10 +8,11 @@ /* :Author: David Goodger (goodger@python.org) -:Id: $Id: html4css1.css 8954 2022-01-20 10:10:25Z milde $ +:Id: $Id: html4css1.css 9511 2024-01-13 09:50:07Z milde $ :Copyright: This stylesheet has been placed in the public domain. Default cascading style sheet for the HTML output of Docutils. +Despite the name, some widely supported CSS2 features are used. See https://docutils.sourceforge.io/docs/howto/html-stylesheets.html for how to customize this style sheet. @@ -274,7 +275,7 @@ margin-left: 2em ; margin-right: 2em } -pre.code .ln { color: grey; } /* line numbers */ +pre.code .ln { color: gray; } /* line numbers */ pre.code, code { background-color: #eeeeee } pre.code .comment, code .comment { color: #5C6576 } pre.code .keyword, code .keyword { color: #3B0D06; font-weight: bold } @@ -300,7 +301,7 @@ span.pre { white-space: pre } -span.problematic { +span.problematic, pre.problematic { color: red } span.section-subtitle { @@ -408,13 +409,13 @@

Configuration

Usage

@@ -444,7 +445,9 @@

Contributors

Maintainers

This module is maintained by the OCA.

-Odoo Community Association + +Odoo Community Association +

OCA, or the Odoo Community Association, is a nonprofit organization whose mission is to support the collaborative development of Odoo features and promote its widespread use.