diff --git a/delivery_package_number/__manifest__.py b/delivery_package_number/__manifest__.py index 11b7acf9c1..ca67071f2b 100644 --- a/delivery_package_number/__manifest__.py +++ b/delivery_package_number/__manifest__.py @@ -10,14 +10,13 @@ "license": "AGPL-3", "installable": True, "application": False, - "depends": ["delivery"], + "depends": ["delivery","stock_delivery"], "data": [ "security/ir.model.access.csv", "data/paperformat_data.xml", "reports/report_package_number.xml", "views/stock_picking_type_views.xml", "views/stock_picking_views.xml", - "wizard/stock_immediate_transfer_views.xml", "wizard/stock_backorder_confirmation_views.xml", "wizard/stock_number_package_validate_wiz_view.xml", ], diff --git a/delivery_package_number/tests/test_delivery_package_number.py b/delivery_package_number/tests/test_delivery_package_number.py index a7f84557e4..f1e5e24a02 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.button_validate() backorder_wizard = Form( diff --git a/delivery_package_number/views/stock_picking_views.xml b/delivery_package_number/views/stock_picking_views.xml index 6a717b4106..d2ebeb7f51 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 0387cc1654..adb752bf71 100644 --- a/delivery_package_number/wizard/__init__.py +++ b/delivery_package_number/wizard/__init__.py @@ -1,4 +1,3 @@ from . import stock_number_package_mixin -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_views.xml b/delivery_package_number/wizard/stock_backorder_confirmation_views.xml index c91240fd2b..b3e47ac45b 100644 --- a/delivery_package_number/wizard/stock_backorder_confirmation_views.xml +++ b/delivery_package_number/wizard/stock_backorder_confirmation_views.xml @@ -7,7 +7,7 @@ - + @@ -15,11 +15,11 @@ 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 14b9310bf8..0000000000 --- a/delivery_package_number/wizard/stock_inmediate_transfer.py +++ /dev/null @@ -1,28 +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", "stock.number.package.mixin"] - _name = "stock.immediate.transfer" - - 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 - res = super( - StockImmediateTransfer, self.with_context(set_default_package=False) - ).process() - if self.print_package_label: - report = ( - self.pick_ids.picking_type_id.report_number_of_packages - or self.env.ref( - "delivery_package_number.action_delivery_package_number_report" - ) - ) - report_action = report.report_action(self.pick_ids) - report_action.update({"close_on_report_download": True}) - return report_action - return res