Skip to content

Commit

Permalink
[MIG] stock_removal_by_location_priority: Migration to 18.0
Browse files Browse the repository at this point in the history
  • Loading branch information
docker-odoo authored and jcadhoc committed Nov 5, 2024
1 parent f325ae2 commit 3080a5f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 10 deletions.
4 changes: 2 additions & 2 deletions stock_removal_by_location_priority/__manifest__.py
Original file line number Diff line number Diff line change
@@ -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': '',
Expand All @@ -18,7 +18,7 @@
],
'demo': [
],
'installable': False,
'installable': True,
'auto_install': False,
'application': False,
'pre_init_hook': 'pre_init_hook',
Expand Down
11 changes: 3 additions & 8 deletions stock_removal_by_location_priority/models/stock_quant.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

0 comments on commit 3080a5f

Please sign in to comment.