Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MIG] stock_removal_by_location_priority: Migration to 18.0 #571

Open
wants to merge 1 commit into
base: 18.0
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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)