diff --git a/stock_removal_by_location_priority/__manifest__.py b/stock_removal_by_location_priority/__manifest__.py index 58b19cb5..5b42fa95 100644 --- a/stock_removal_by_location_priority/__manifest__.py +++ b/stock_removal_by_location_priority/__manifest__.py @@ -1,6 +1,6 @@ { 'name': 'Stock Removal by Location priority', - 'version': "17.0.1.0.0", + 'version': "18.0.1.0.0", 'category': 'Warehouse Management', 'sequence': 14, 'summary': '', @@ -18,7 +18,7 @@ ], 'demo': [ ], - 'installable': False, + 'installable': True, 'auto_install': False, 'application': False, 'pre_init_hook': 'pre_init_hook', diff --git a/stock_removal_by_location_priority/models/stock_quant.py b/stock_removal_by_location_priority/models/stock_quant.py index e7bdc333..498114f8 100644 --- a/stock_removal_by_location_priority/models/stock_quant.py +++ b/stock_removal_by_location_priority/models/stock_quant.py @@ -10,12 +10,7 @@ class StockQuant(models.Model): ) @api.model - def _get_removal_strategy_domain_order(self, domain, removal_strategy, qty): + def _get_removal_strategy_order(self, removal_strategy): if removal_strategy == 'priority': - return domain, 'removal_priority ASC, id' - return super()._get_removal_strategy_domain_order(domain, removal_strategy, qty) - - def _get_removal_strategy_sort_key(self, removal_strategy): - if removal_strategy == 'priority': - return lambda q: (q.removal_priority, q.id), False - return super()._get_removal_strategy_sort_key(removal_strategy) + return 'removal_priority ASC, id' + return super()._get_removal_strategy_order(removal_strategy)