From c654b66b95e0b4f5ad76c6a011ead4dfdcd0ca2a Mon Sep 17 00:00:00 2001 From: ps-tubtim Date: Mon, 6 Jan 2020 15:25:19 +0700 Subject: [PATCH] [MIG] stock_removal_location_by_priority: Migration to 13.0 --- .isort.cfg | 2 +- .../models/res_config_settings.py | 2 +- .../models/stock_location.py | 3 +-- stock_removal_location_by_priority/models/stock_quant.py | 7 ++----- .../tests/test_stock_removal_location_by_priority.py | 2 ++ 5 files changed, 7 insertions(+), 9 deletions(-) diff --git a/.isort.cfg b/.isort.cfg index 5751c40dd..98b216f74 100644 --- a/.isort.cfg +++ b/.isort.cfg @@ -9,4 +9,4 @@ line_length=88 known_odoo=odoo known_odoo_addons=odoo.addons sections=FUTURE,STDLIB,THIRDPARTY,ODOO,ODOO_ADDONS,FIRSTPARTY,LOCALFOLDER -known_third_party= +known_third_party=setuptools diff --git a/stock_removal_location_by_priority/models/res_config_settings.py b/stock_removal_location_by_priority/models/res_config_settings.py index fd19c6d00..08839c08f 100644 --- a/stock_removal_location_by_priority/models/res_config_settings.py +++ b/stock_removal_location_by_priority/models/res_config_settings.py @@ -10,7 +10,7 @@ class ResConfigSettings(models.TransientModel): group_removal_priority = fields.Boolean( string="Removal Priority", - implied_group="stock_removal_location_by_priority." "group_removal_priority", + implied_group="stock_removal_location_by_priority.group_removal_priority", help="Removal priority that applies when the incoming dates " "are equal in both locations.", ) diff --git a/stock_removal_location_by_priority/models/stock_location.py b/stock_removal_location_by_priority/models/stock_location.py index bd6dfd1a3..ec9f4c8bd 100644 --- a/stock_removal_location_by_priority/models/stock_location.py +++ b/stock_removal_location_by_priority/models/stock_location.py @@ -11,6 +11,5 @@ class StockLocation(models.Model): removal_priority = fields.Integer( string="Removal Priority", default=10, - help="This priority applies when removing stock and incoming dates " - "are equal.", + help="This priority applies when removing stock and incoming dates are equal.", ) diff --git a/stock_removal_location_by_priority/models/stock_quant.py b/stock_removal_location_by_priority/models/stock_quant.py index 885f8559f..5879581aa 100644 --- a/stock_removal_location_by_priority/models/stock_quant.py +++ b/stock_removal_location_by_priority/models/stock_quant.py @@ -14,7 +14,7 @@ class StockQuant(models.Model): ) @api.model - def _get_removal_strategy_order(self, removal_strategy=None): + def _get_removal_strategy_order(self, removal_strategy): if self.user_has_groups( "stock_removal_location_by_priority.group_removal_priority" ): @@ -25,7 +25,4 @@ class StockQuant(models.Model): raise UserError( _("Removal strategy %s not implemented.") % (removal_strategy,) ) - else: - return super()._get_removal_strategy_order( - removal_strategy=removal_strategy - ) + return super(StockQuant, self)._get_removal_strategy_order(removal_strategy) diff --git a/stock_removal_location_by_priority/tests/test_stock_removal_location_by_priority.py b/stock_removal_location_by_priority/tests/test_stock_removal_location_by_priority.py index 80a16036e..6c41ba155 100644 --- a/stock_removal_location_by_priority/tests/test_stock_removal_location_by_priority.py +++ b/stock_removal_location_by_priority/tests/test_stock_removal_location_by_priority.py @@ -126,6 +126,7 @@ class TestStockRemovalLocationByPriority(TransactionCase): picking_1 = self._create_picking( self.picking_internal, self.stock, self.stock_2, 5 ) + picking_1.flush() picking_1.action_confirm() picking_1.action_assign() @@ -150,6 +151,7 @@ class TestStockRemovalLocationByPriority(TransactionCase): picking_1 = self._create_picking( self.picking_internal, self.stock, self.stock_2, 5 ) + picking_1.flush() picking_1.action_confirm() picking_1.action_assign()