From d25bf6092ee3c8fe0f38488e57c98cf86457048c Mon Sep 17 00:00:00 2001 From: Josep-s73 Date: Mon, 24 Jun 2024 15:34:26 +0200 Subject: [PATCH] [MIG] delivery_package_number: Migration to 17.0 --- delivery_package_number/README.rst | 15 ++++++----- delivery_package_number/__manifest__.py | 2 +- .../readme/CONTRIBUTORS.rst | 11 -------- .../static/description/index.html | 2 +- .../tests/test_delivery_package_number.py | 8 +++--- .../views/stock_picking_views.xml | 10 +++---- delivery_package_number/wizard/__init__.py | 1 - .../wizard/stock_backorder_confirmation.py | 3 ++- .../wizard/stock_immediate_transfer_views.xml | 26 ------------------- .../wizard/stock_inmediate_transfer.py | 13 ---------- .../stock_number_package_validate_wiz.py | 3 ++- ...stock_number_package_validate_wiz_view.xml | 4 +-- 12 files changed, 26 insertions(+), 72 deletions(-) delete mode 100644 delivery_package_number/readme/CONTRIBUTORS.rst delete mode 100644 delivery_package_number/wizard/stock_immediate_transfer_views.xml delete mode 100644 delivery_package_number/wizard/stock_inmediate_transfer.py diff --git a/delivery_package_number/README.rst b/delivery_package_number/README.rst index b2e4889c12..e577de8651 100644 --- a/delivery_package_number/README.rst +++ b/delivery_package_number/README.rst @@ -81,15 +81,18 @@ Contributors - `Tecnativa `__: - * Pedro M. Baeza - * David Vidal - * Carlos Roca - * Sergio Teruel + - Pedro M. Baeza + - David Vidal + - Marçal Isern + - Carlos Roca +.. + + - `Sygel `__: - * `Sygel `__: + .. - * Ángel García de la Chica Herrera + - Ángel García de la Chica Herrera Maintainers ----------- diff --git a/delivery_package_number/__manifest__.py b/delivery_package_number/__manifest__.py index 28e1b21afc..6679a860a3 100644 --- a/delivery_package_number/__manifest__.py +++ b/delivery_package_number/__manifest__.py @@ -10,7 +10,7 @@ "license": "AGPL-3", "installable": True, "application": False, - "depends": ["delivery"], + "depends": ["stock_delivery"], "data": [ "security/ir.model.access.csv", "data/paperformat_data.xml", diff --git a/delivery_package_number/readme/CONTRIBUTORS.rst b/delivery_package_number/readme/CONTRIBUTORS.rst deleted file mode 100644 index d4b0d2f0f9..0000000000 --- a/delivery_package_number/readme/CONTRIBUTORS.rst +++ /dev/null @@ -1,11 +0,0 @@ -* `Tecnativa `_: - - * Pedro M. Baeza - * David Vidal - * Carlos Roca - * Sergio Teruel - - - * `Sygel `_: - - * Ángel García de la Chica Herrera diff --git a/delivery_package_number/static/description/index.html b/delivery_package_number/static/description/index.html index 32deb80161..0e895f5fa1 100644 --- a/delivery_package_number/static/description/index.html +++ b/delivery_package_number/static/description/index.html @@ -427,8 +427,8 @@

Contributors

  • Tecnativa:
    • Pedro M. Baeza
    • David Vidal
    • +
    • Marçal Isern
    • Carlos Roca
    • -
    • Sergio Teruel
  • diff --git a/delivery_package_number/tests/test_delivery_package_number.py b/delivery_package_number/tests/test_delivery_package_number.py index e2de1a07b7..aa1f891323 100644 --- a/delivery_package_number/tests/test_delivery_package_number.py +++ b/delivery_package_number/tests/test_delivery_package_number.py @@ -28,13 +28,13 @@ def setUpClass(cls): { "product_id": cls.product.id, "product_uom_id": cls.product.uom_id.id, - "qty_done": 5, + "quantity": 5, "location_id": cls.wh1.lot_stock_id.id, "location_dest_id": cls.wh1.wh_output_stock_loc_id.id, "picking_id": cls.picking.id, } ) - cls.ml2 = cls.ml1.copy({"qty_done": 0}) + cls.ml2 = cls.ml1.copy({"quantity": 0}) def test_number_of_packages(self): # By default it's computed to 0 @@ -47,7 +47,7 @@ def test_number_of_packages(self): # We add a package and it recalculates self.picking.action_put_in_pack() self.assertEqual(self.picking.number_of_packages, 1) - self.ml2.qty_done = 5 + self.ml2.quantity = 5 self.picking.action_put_in_pack() self.assertEqual(self.picking.number_of_packages, 2) # We can later set it manually if we want to @@ -64,7 +64,7 @@ def test_backorder(self): order = order_form.save() order.action_confirm() picking = order.picking_ids - picking.move_ids.quantity_done = 2 + picking.move_ids.quantity = 2 picking.number_of_packages = 2 action = picking.with_context( test_delivery_package_number=True diff --git a/delivery_package_number/views/stock_picking_views.xml b/delivery_package_number/views/stock_picking_views.xml index 6a717b4106..36d2c8e2fb 100644 --- a/delivery_package_number/views/stock_picking_views.xml +++ b/delivery_package_number/views/stock_picking_views.xml @@ -2,14 +2,14 @@ stock.picking - + - + diff --git a/delivery_package_number/wizard/__init__.py b/delivery_package_number/wizard/__init__.py index 0c0e9106ee..42886abb47 100644 --- a/delivery_package_number/wizard/__init__.py +++ b/delivery_package_number/wizard/__init__.py @@ -1,3 +1,2 @@ -from . import stock_inmediate_transfer from . import stock_backorder_confirmation from . import stock_number_package_validate_wiz diff --git a/delivery_package_number/wizard/stock_backorder_confirmation.py b/delivery_package_number/wizard/stock_backorder_confirmation.py index 07c10eaba3..ea868b3f77 100644 --- a/delivery_package_number/wizard/stock_backorder_confirmation.py +++ b/delivery_package_number/wizard/stock_backorder_confirmation.py @@ -8,7 +8,8 @@ class StockBackorderConfirmation(models.TransientModel): _inherit = "stock.backorder.confirmation" def process(self): - # put context key for avoiding `base_delivery_carrier_label` auto-packaging feature + # put context key for avoiding `base_delivery_carrier_label` + # auto-packaging feature return super( StockBackorderConfirmation, self.with_context(set_default_package=False) ).process() diff --git a/delivery_package_number/wizard/stock_immediate_transfer_views.xml b/delivery_package_number/wizard/stock_immediate_transfer_views.xml deleted file mode 100644 index 936bf5af0d..0000000000 --- a/delivery_package_number/wizard/stock_immediate_transfer_views.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - - stock.immediate.transfer - - - - - - - - - - - - - - diff --git a/delivery_package_number/wizard/stock_inmediate_transfer.py b/delivery_package_number/wizard/stock_inmediate_transfer.py deleted file mode 100644 index 13e3b7196e..0000000000 --- a/delivery_package_number/wizard/stock_inmediate_transfer.py +++ /dev/null @@ -1,13 +0,0 @@ -# Copyright 2020 Tecnativa - David Vidal -# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). -from odoo import models - - -class StockImmediateTransfer(models.TransientModel): - _inherit = "stock.immediate.transfer" - - def process(self): - # put context key for avoiding `base_delivery_carrier_label` auto-packaging feature - return super( - StockImmediateTransfer, self.with_context(set_default_package=False) - ).process() diff --git a/delivery_package_number/wizard/stock_number_package_validate_wiz.py b/delivery_package_number/wizard/stock_number_package_validate_wiz.py index 64f1f24d45..c97dbbbd76 100644 --- a/delivery_package_number/wizard/stock_number_package_validate_wiz.py +++ b/delivery_package_number/wizard/stock_number_package_validate_wiz.py @@ -41,7 +41,8 @@ def _compute_stock_number_package_validation_line_ids(self): def process(self): if self.number_of_packages: self.pick_ids.write({"number_of_packages": self.number_of_packages}) - # put context key for avoiding `base_delivery_carrier_label` auto-packaging feature + # put context key for avoiding `base_delivery_carrier_label` + # auto-packaging feature self.pick_ids.with_context( set_default_package=False, bypass_set_number_of_packages=True ).button_validate() diff --git a/delivery_package_number/wizard/stock_number_package_validate_wiz_view.xml b/delivery_package_number/wizard/stock_number_package_validate_wiz_view.xml index 2ac077efc9..c0fe9307e2 100644 --- a/delivery_package_number/wizard/stock_number_package_validate_wiz_view.xml +++ b/delivery_package_number/wizard/stock_number_package_validate_wiz_view.xml @@ -9,13 +9,13 @@