diff --git a/.docker_files/main/__manifest__.py b/.docker_files/main/__manifest__.py index 2df5041..c09a147 100644 --- a/.docker_files/main/__manifest__.py +++ b/.docker_files/main/__manifest__.py @@ -35,7 +35,7 @@ "stock_picking_groupby_parent_affiliate", "stock_picking_product_supplier", "stock_picking_responsible_editable", - "stock_picking_remove_reservation", + "stock_picking_correct_reservation", "stock_picking_secondary_unit_demand", "stock_picking_show_address", "stock_picking_split_qty", diff --git a/Dockerfile b/Dockerfile index c748f45..31a31f7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -37,7 +37,7 @@ COPY stock_picking_barcode /mnt/extra-addons/stock_picking_barcode COPY stock_picking_delivery_carrier_required /mnt/extra-addons/stock_picking_delivery_carrier_required COPY stock_picking_groupby_parent_affiliate /mnt/extra-addons/stock_picking_groupby_parent_affiliate COPY stock_picking_responsible_editable /mnt/extra-addons/stock_picking_responsible_editable -COPY stock_picking_remove_reservation /mnt/extra-addons/stock_picking_remove_reservation +COPY stock_picking_correct_reservation /mnt/extra-addons/stock_picking_correct_reservation COPY stock_picking_secondary_unit_demand /mnt/extra-addons/stock_picking_secondary_unit_demand COPY stock_picking_show_address /mnt/extra-addons/stock_picking_show_address COPY stock_picking_split_qty /mnt/extra-addons/stock_picking_split_qty diff --git a/stock_picking_correct_reservation/README.rst b/stock_picking_correct_reservation/README.rst new file mode 100644 index 0000000..db3f393 --- /dev/null +++ b/stock_picking_correct_reservation/README.rst @@ -0,0 +1,37 @@ +Stock Picking Correct Reservation +================================= + +Context: +~~~~~~~~ +Odoo provides a server action called 'Correct inconsistencies for reservation' to correct problematics products. +This action could unreserve stock. + +This action is executed only by users with group ``Administration``. + +We want to give access to users with group ``Inventory / Administrator``, to be able to execute this action. +And limit the correction to only selected stock picking. + +Description: +~~~~~~~~~~~~ + +This module allows to execute the same code of 'Correct inconsistencies for reservation' action from a selected transfers. + +Usage +----- +As a user with access group ``Inventory / Administrator``, I receive the warning bellow while validating a transfer: + +.. image:: static/description/stock_picking_error_message.png + +I need to go to ``Action`` button and click on ``Correct Reservation`` + +.. image:: static/description/correct_reservation_action.png + +The action will show a popup to correst reservation. +The correction may unreserve the quantities of the selected transfer lines. + +.. image:: static/description/correct_reservation_window.png + + +Contributors +------------ +* Numigi (tm) and all its contributors (https://bit.ly/numigiens) diff --git a/stock_picking_remove_reservation/__init__.py b/stock_picking_correct_reservation/__init__.py similarity index 100% rename from stock_picking_remove_reservation/__init__.py rename to stock_picking_correct_reservation/__init__.py diff --git a/stock_picking_remove_reservation/__manifest__.py b/stock_picking_correct_reservation/__manifest__.py similarity index 72% rename from stock_picking_remove_reservation/__manifest__.py rename to stock_picking_correct_reservation/__manifest__.py index 474344a..ee43db6 100644 --- a/stock_picking_remove_reservation/__manifest__.py +++ b/stock_picking_correct_reservation/__manifest__.py @@ -2,7 +2,7 @@ # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). { - "name": "Stock Picking Remove Reservation", + "name": "Stock Picking Correct Reservation", "version": "14.0.1.0.0", "author": "Numigi", "maintainer": "Numigi", @@ -10,10 +10,10 @@ "license": "AGPL-3", "category": "Stock", "depends": ["stock"], - "summary": "Allow to force stock picking unreservation.", + "summary": "Correct inconsistencies for reservation.", "data": [ "security/ir.model.access.csv", - "wizard/stock_picking_unreserve_view.xml", + "wizard/stock_picking_reservation_view.xml", ], "installable": True, } diff --git a/stock_picking_correct_reservation/i18n/fr.po b/stock_picking_correct_reservation/i18n/fr.po new file mode 100644 index 0000000..0cbb9ba --- /dev/null +++ b/stock_picking_correct_reservation/i18n/fr.po @@ -0,0 +1,74 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * stock_picking_correct_reservation +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 14.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2024-11-11 20:18+0000\n" +"PO-Revision-Date: 2024-11-11 20:18+0000\n" +"Last-Translator: \n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: \n" + +#. module: stock_picking_correct_reservation +#: model_terms:ir.ui.view,arch_db:stock_picking_correct_reservation.stock_picking_correct_reservation_view +msgid "Cancel" +msgstr "" + +#. module: stock_picking_correct_reservation +#: model:ir.actions.act_window,name:stock_picking_correct_reservation.action_stock_picking_correct_reservation +#: model_terms:ir.ui.view,arch_db:stock_picking_correct_reservation.stock_picking_correct_reservation_view +msgid "Correct Reservation" +msgstr "Corriger la reservation" + +#. module: stock_picking_correct_reservation +#: model:ir.model.fields,field_description:stock_picking_correct_reservation.field_stock_picking_reservation__create_uid +msgid "Created by" +msgstr "" + +#. module: stock_picking_correct_reservation +#: model:ir.model.fields,field_description:stock_picking_correct_reservation.field_stock_picking_reservation__create_date +msgid "Created on" +msgstr "" + +#. module: stock_picking_correct_reservation +#: model:ir.model.fields,field_description:stock_picking_correct_reservation.field_stock_picking_reservation__display_name +msgid "Display Name" +msgstr "" + +#. module: stock_picking_correct_reservation +#: model:ir.model.fields,field_description:stock_picking_correct_reservation.field_stock_picking_reservation__id +msgid "ID" +msgstr "" + +#. module: stock_picking_correct_reservation +#: model:ir.model.fields,field_description:stock_picking_correct_reservation.field_stock_picking_reservation____last_update +msgid "Last Modified on" +msgstr "" + +#. module: stock_picking_correct_reservation +#: model:ir.model.fields,field_description:stock_picking_correct_reservation.field_stock_picking_reservation__write_uid +msgid "Last Updated by" +msgstr "" + +#. module: stock_picking_correct_reservation +#: model:ir.model.fields,field_description:stock_picking_correct_reservation.field_stock_picking_reservation__write_date +msgid "Last Updated on" +msgstr "" + +#. module: stock_picking_correct_reservation +#: model_terms:ir.ui.view,arch_db:stock_picking_correct_reservation.stock_picking_correct_reservation_view +msgid "" +"You should run this action only if you encounter a picking validation issue " +"related to reservations." +msgstr "Vous devriez exécuter cette action uniquement si vous rencontrez un problème de validation de transfert lié aux réservations." + +#. module: stock_picking_correct_reservation +#: model:ir.model,name:stock_picking_correct_reservation.model_stock_picking_reservation +msgid "stock.picking.reservation" +msgstr "" \ No newline at end of file diff --git a/stock_picking_correct_reservation/security/ir.model.access.csv b/stock_picking_correct_reservation/security/ir.model.access.csv new file mode 100644 index 0000000..012d2b2 --- /dev/null +++ b/stock_picking_correct_reservation/security/ir.model.access.csv @@ -0,0 +1,2 @@ +id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink +access_stock_picking_reservation,access_stock_picking_reservation,model_stock_picking_reservation,stock.group_stock_manager,1,1,1,1 \ No newline at end of file diff --git a/stock_picking_correct_reservation/static/description/correct_reservation_action.png b/stock_picking_correct_reservation/static/description/correct_reservation_action.png new file mode 100644 index 0000000..51764e8 Binary files /dev/null and b/stock_picking_correct_reservation/static/description/correct_reservation_action.png differ diff --git a/stock_picking_correct_reservation/static/description/correct_reservation_window.png b/stock_picking_correct_reservation/static/description/correct_reservation_window.png new file mode 100644 index 0000000..0efe910 Binary files /dev/null and b/stock_picking_correct_reservation/static/description/correct_reservation_window.png differ diff --git a/stock_picking_remove_reservation/static/description/icon.png b/stock_picking_correct_reservation/static/description/icon.png similarity index 100% rename from stock_picking_remove_reservation/static/description/icon.png rename to stock_picking_correct_reservation/static/description/icon.png diff --git a/stock_picking_remove_reservation/static/description/stock_picking_error_message.png b/stock_picking_correct_reservation/static/description/stock_picking_error_message.png similarity index 100% rename from stock_picking_remove_reservation/static/description/stock_picking_error_message.png rename to stock_picking_correct_reservation/static/description/stock_picking_error_message.png diff --git a/stock_picking_remove_reservation/wizard/__init__.py b/stock_picking_correct_reservation/wizard/__init__.py similarity index 77% rename from stock_picking_remove_reservation/wizard/__init__.py rename to stock_picking_correct_reservation/wizard/__init__.py index a3395fa..f0a84a2 100644 --- a/stock_picking_remove_reservation/wizard/__init__.py +++ b/stock_picking_correct_reservation/wizard/__init__.py @@ -1,4 +1,4 @@ # © 2024 Numigi (tm) and all its contributors (https://bit.ly/numigiens) # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -from . import stock_picking_unreserve +from . import stock_picking_reservation diff --git a/stock_picking_correct_reservation/wizard/stock_picking_reservation.py b/stock_picking_correct_reservation/wizard/stock_picking_reservation.py new file mode 100644 index 0000000..d6b3733 --- /dev/null +++ b/stock_picking_correct_reservation/wizard/stock_picking_reservation.py @@ -0,0 +1,192 @@ +# © 2024 Numigi (tm) and all its contributors (https://bit.ly/numigiens) +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from odoo import models + + +class StockPickingReservation(models.TransientModel): + _name = "stock.picking.reservation" + _description = "Stock Picking Reservation" + + def action_correct_reservation(self): + """" + This function was inspired by the server action Correct inconsistencies for + reservation + """ + context = dict(self._context or {}) + pickings = context.get('active_ids', False) + if not pickings: + return {"type": "ir.actions.act_window_close"} + picking_ids = self.env["stock.picking"].browse(pickings) + move_line_ids = [] + move_line_to_recompute_ids = [] + logging = '' + for picking in picking_ids: + quants = self.env['stock.quant'].sudo().search( + [('product_id', 'in', picking.move_line_ids.mapped('product_id.id'))] + ) + for quant in quants: + + move_lines = self._get_matching_move_lines(quant) + + move_line_ids += move_lines.ids + reserved_on_move_lines = sum(move_lines.mapped('product_qty')) + move_line_str = ", ".join(map(str, move_lines.ids)) + + if quant.location_id.should_bypass_reservation(): + # If a quant is in a location that should bypass the reservation, + # its `reserved_quantity` field should be 0. + logging += self._handle_bypass_reservation( + quant, move_lines, reserved_on_move_lines, move_line_str + ) + else: + # If a quant is in a reservable location, its `reserved_quantity` + # should be exactly the sum of the `product_qty` of all the + # partially_available / assigned move lines with the same + # characteristics. + logging += self._handle_reservable_location( + quant, move_lines, reserved_on_move_lines, + move_line_str, move_line_to_recompute_ids + ) + + move_lines_to_unreserve, unreserve_logging = self._find_unlinked_move_lines( + move_line_ids + ) + logging += unreserve_logging + self._unreserve_move_lines(move_lines_to_unreserve) + + if logging: + self._create_logging(logging) + + if move_line_to_recompute_ids: + self.env['stock.move.line'].browse( + move_line_to_recompute_ids + ).move_id._recompute_state() + + return {'type': 'ir.actions.act_window_close'} + + def _get_matching_move_lines(self, quant): + return self.env["stock.move.line"].search( + [ + ("product_id", "=", quant.product_id.id), + ("location_id", "=", quant.location_id.id), + ("lot_id", "=", quant.lot_id.id), + ("package_id", "=", quant.package_id.id), + ("owner_id", "=", quant.owner_id.id), + ("product_qty", "!=", 0), + ] + ) + + def _handle_bypass_reservation(self, quant, move_lines, reserved_on_move_lines, + move_line_str): + logging = '' + if quant.reserved_quantity != 0: + logging += (f"""Problematic quant found: {quant.id} (quantity: {quant.quantity}, + reserved_quantity: {quant.reserved_quantity})\n""" + f"""its `reserved_quantity` field is not 0 while its location + should bypass the reservation\n""") + if move_lines: + logging += ( + f"""These move lines are reserved on it:\n""" + f"""{move_line_str} (sum of the reservation: + {reserved_on_move_lines})\n""" + "******************\n" + ) + else: + logging += ( + f"""no move lines are reserved on it, you can safely reset its + `reserved_quantity` to 0\n""" + f"""{move_line_str} (sum of the reservation: + {reserved_on_move_lines})\n""" + "******************\n" + ) + quant.write({'reserved_quantity': 0}) + return logging + + def _handle_reservable_location( + self, + quant, + move_lines, + reserved_on_move_lines, + move_line_str, + move_line_to_recompute_ids, + ): + logging = "" + if ( + quant.reserved_quantity in [0, -1] + or quant.reserved_quantity != reserved_on_move_lines + ): + logging += ( + f"""Problematic quant found: {quant.id} (quantity: {quant.quantity}, + reserved_quantity: {quant.reserved_quantity})\n""" + f"""{'its `reserved_quantity` field is 0' if + quant.reserved_quantity == 0 else + 'its `reserved_quantity` field is negative' if + quant.reserved_quantity < 0 else + 'its `reserved_quantity` does not reflect the move lines reservation' + }\n""" + f"""These move lines are reserved on it: {move_line_str} + (sum of the reservation: {reserved_on_move_lines})\n""" + "******************\n" + ) + quant.write({"reserved_quantity": 0}) + move_lines.with_context(bypass_reservation_update=True).sudo().write( + {"product_uom_qty": 0} + ) + move_line_to_recompute_ids += move_lines.ids + elif any(move_line.product_qty < 0 for move_line in move_lines): + logging += ( + f"""Problematic quant found: {quant.id} (quantity: {quant.quantity}, + reserved_quantity: {quant.reserved_quantity})\n""" + f"""its `reserved_quantity` correctly reflects the move lines + reservation but some are negative\n""" + f"""These move lines are reserved on it: {move_line_str} + (sum of the reservation: {reserved_on_move_lines})\n""" + "******************\n" + ) + quant.write({"reserved_quantity": 0}) + move_lines.with_context(bypass_reservation_update=True).sudo().write( + {"product_uom_qty": 0} + ) + move_line_to_recompute_ids += move_lines.ids + return logging + + def _find_unlinked_move_lines(self, move_line_ids): + move_lines = self.env["stock.move.line"].search( + [ + ("product_id.type", "=", "product"), + ("product_qty", "!=", 0), + ("id", "not in", move_line_ids), + ] + ) + move_lines_to_unreserve = [] + logging = "" + for move_line in move_lines: + if not move_line.location_id.should_bypass_reservation(): + logging += ( + f"""Problematic move line found: + {move_line.id} (reserved_quantity: + {move_line.product_qty})\n""" + "There is no existing quant despite its `reserved_quantity`\n" + "******************\n" + ) + move_lines_to_unreserve.append(move_line.id) + return move_lines_to_unreserve, logging + + def _unreserve_move_lines(self, move_lines_to_unreserve): + if move_lines_to_unreserve: + query = """ UPDATE stock_move_line SET product_uom_qty = 0, + product_qty = 0 WHERE id IN %s """ + self.env.cr.execute(query, (tuple(move_lines_to_unreserve),)) + + def _create_logging(self, logging): + self.env['ir.logging'].sudo().create({ + 'name': 'Unreserve stock.quant and stock.move.line', + 'type': 'server', + 'level': 'DEBUG', + 'dbname': self.env.cr.dbname, + 'message': logging, + 'func': '_update_reserved_quantity', + 'path': 'addons/stock/models/stock_quant.py', + 'line': '0', + }) diff --git a/stock_picking_correct_reservation/wizard/stock_picking_reservation_view.xml b/stock_picking_correct_reservation/wizard/stock_picking_reservation_view.xml new file mode 100644 index 0000000..35d6cab --- /dev/null +++ b/stock_picking_correct_reservation/wizard/stock_picking_reservation_view.xml @@ -0,0 +1,32 @@ + + + + + + Correct Reservation + stock.picking.reservation + +
+ + You should run this action only if you encounter a picking validation issue related to reservations. +
+
+ +
+
+ + + Correct Reservation + + stock.picking.reservation + form + + new + + list,form + + +
+
\ No newline at end of file diff --git a/stock_picking_remove_reservation/README.rst b/stock_picking_remove_reservation/README.rst deleted file mode 100644 index 63552c4..0000000 --- a/stock_picking_remove_reservation/README.rst +++ /dev/null @@ -1,29 +0,0 @@ -Stock Picking Remove Reservation -================================ -Odoo provides a server action called 'Correct inconsistencies for reservation' to fix any -desynchronization between quants and their move lines. - -This action is only accessible via the server actions menu in the technical panel. - -This module allows the same feature to be integrated directly into the stock picking -form and unreserve move lines for the active picking. - -Usage ------ -As a user with access stock manager , when I receive the error message: - -.. image:: static/description/stock_picking_error_message.png - -I need to click on "Remove reservation" - -.. image:: static/description/stock_picking_select_items.png - -.. image:: static/description/stock_picking_remove_reservation.png - - - - - -Contributors ------------- -* Numigi (tm) and all its contributors (https://bit.ly/numigiens) diff --git a/stock_picking_remove_reservation/i18n/fr.po b/stock_picking_remove_reservation/i18n/fr.po deleted file mode 100644 index 0b79206..0000000 --- a/stock_picking_remove_reservation/i18n/fr.po +++ /dev/null @@ -1,85 +0,0 @@ -# Translation of Odoo Server. -# This file contains the translation of the following modules: -# * stock_picking_remove_reservation -# -msgid "" -msgstr "" -"Project-Id-Version: Odoo Server 14.0\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-11-04 21:14+0000\n" -"PO-Revision-Date: 2024-11-04 21:14+0000\n" -"Last-Translator: \n" -"Language-Team: \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: \n" -"Plural-Forms: \n" - -#. module: stock_picking_remove_reservation -#: model_terms:ir.ui.view,arch_db:stock_picking_remove_reservation.stock_picking_unreserve_view -msgid "Cancel" -msgstr "Annuler" - -#. module: stock_picking_remove_reservation -#: model:ir.model.fields,field_description:stock_picking_remove_reservation.field_stock_picking_unreserve__create_uid -msgid "Created by" -msgstr "Créé par" - -#. module: stock_picking_remove_reservation -#: model:ir.model.fields,field_description:stock_picking_remove_reservation.field_stock_picking_unreserve__create_date -msgid "Created on" -msgstr "Créé le" - -#. module: stock_picking_remove_reservation -#: model:ir.model.fields,field_description:stock_picking_remove_reservation.field_stock_picking_unreserve__display_name -msgid "Display Name" -msgstr "Nom d'affichage" - -#. module: stock_picking_remove_reservation -#: model:ir.model.fields,field_description:stock_picking_remove_reservation.field_stock_picking_unreserve__id -msgid "ID" -msgstr "ID" - -#. module: stock_picking_remove_reservation -#: model:ir.model.fields,field_description:stock_picking_remove_reservation.field_stock_picking_unreserve____last_update -msgid "Last Modified on" -msgstr "Dernière mise-à-jour le" - -#. module: stock_picking_remove_reservation -#: model:ir.model.fields,field_description:stock_picking_remove_reservation.field_stock_picking_unreserve__write_uid -msgid "Last Updated by" -msgstr "Dernière mise à jour par" - -#. module: stock_picking_remove_reservation -#: model:ir.model.fields,field_description:stock_picking_remove_reservation.field_stock_picking_unreserve__write_date -msgid "Last Updated on" -msgstr "Dernière mise à jour le" - -#. module: stock_picking_remove_reservation -#: model:ir.actions.act_window,name:stock_picking_remove_reservation.action_stock_picking_unreserve -msgid "Remove reservation" -msgstr "Supprimer la réservation" - -#. module: stock_picking_remove_reservation -#: model_terms:ir.ui.view,arch_db:stock_picking_remove_reservation.stock_picking_unreserve_view -msgid "Unreserve" -msgstr "Annuler la réservation" - -#. module: stock_picking_remove_reservation -#: model_terms:ir.ui.view,arch_db:stock_picking_remove_reservation.stock_picking_unreserve_view -msgid "Unreserve Stock Move Lines" -msgstr "Annuler la réservation des lignes de mouvement de stock" - -#. module: stock_picking_remove_reservation -#: model_terms:ir.ui.view,arch_db:stock_picking_remove_reservation.stock_picking_unreserve_view -msgid "" -"You should run this action only when you encounter a picking validation " -"issue related to the reservation" -msgstr "" -"Vous ne devez exécuter cette action que lorsque vous rencontrez un problème de " -"validation de picking lié à la réservation." - -#. module: stock_picking_remove_reservation -#: model:ir.model,name:stock_picking_remove_reservation.model_stock_picking_unreserve -msgid "stock.picking.unreserve" -msgstr "" diff --git a/stock_picking_remove_reservation/security/ir.model.access.csv b/stock_picking_remove_reservation/security/ir.model.access.csv deleted file mode 100644 index 3c4b09a..0000000 --- a/stock_picking_remove_reservation/security/ir.model.access.csv +++ /dev/null @@ -1,2 +0,0 @@ -id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink -access_stock_picking_unreserve,access_stock_picking_unreserve,model_stock_picking_unreserve,stock.group_stock_manager,1,1,1,1 \ No newline at end of file diff --git a/stock_picking_remove_reservation/static/description/stock_picking_remove_reservation.png b/stock_picking_remove_reservation/static/description/stock_picking_remove_reservation.png deleted file mode 100644 index 575ef67..0000000 Binary files a/stock_picking_remove_reservation/static/description/stock_picking_remove_reservation.png and /dev/null differ diff --git a/stock_picking_remove_reservation/static/description/stock_picking_select_items.png b/stock_picking_remove_reservation/static/description/stock_picking_select_items.png deleted file mode 100644 index 51b1c69..0000000 Binary files a/stock_picking_remove_reservation/static/description/stock_picking_select_items.png and /dev/null differ diff --git a/stock_picking_remove_reservation/wizard/stock_picking_unreserve.py b/stock_picking_remove_reservation/wizard/stock_picking_unreserve.py deleted file mode 100644 index 0a3c5c7..0000000 --- a/stock_picking_remove_reservation/wizard/stock_picking_unreserve.py +++ /dev/null @@ -1,37 +0,0 @@ -# © 2024 Numigi (tm) and all its contributors (https://bit.ly/numigiens) -# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). - -from odoo import models - - -class StockPickingUnreserve(models.TransientModel): - _name = "stock.picking.unreserve" - - def action_remove_reservation(self): - """" - This function was inspired by the server action Correct inconsistencies for - reservation and allows for the desynchronization of the active pickings - """ - context = dict(self._context or {}) - if context.get('active_ids', False): - picking_ids = self.env['stock.picking'].browse(context.get('active_ids')) - for picking in picking_ids: - move_line_to_recompute_ids = [] - picking.move_line_ids.with_context(bypass_reservation_update=True).sudo().write( - {'product_uom_qty': 0}) - move_line_to_recompute_ids += picking.move_line_ids.ids - for line in picking.move_line_ids: - quants = self.env['stock.quant'].search([ - ('product_id', '=', line.product_id.id), - ('location_id', '=', line.location_id.id), - ('lot_id', '=', line.lot_id.id), - ('package_id', '=', line.package_id.id), - ('owner_id', '=', line.owner_id.id), - ('quantity', '!=', 0)]) - for quant in quants: - quant.sudo().write({'reserved_quantity': 0}) - if move_line_to_recompute_ids: - self.env['stock.move.line'].browse( - move_line_to_recompute_ids).move_id._recompute_state() - - return {'type': 'ir.actions.act_window_close'} diff --git a/stock_picking_remove_reservation/wizard/stock_picking_unreserve_view.xml b/stock_picking_remove_reservation/wizard/stock_picking_unreserve_view.xml deleted file mode 100644 index 7c015ab..0000000 --- a/stock_picking_remove_reservation/wizard/stock_picking_unreserve_view.xml +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - Unreserve Stock Move Lines - stock.picking.unreserve - -
- - You should run this action only when you encounter a picking validation issue related to the reservation -
-
- -
-
- - - Remove reservation - - stock.picking.unreserve - form - - new - - list,form - - -
-
\ No newline at end of file