mirror of
https://github.com/OCA/stock-logistics-warehouse.git
synced 2025-01-21 14:27:28 +02:00
[MIG] stock_removal_location_by_priority: Migration to 13.0
This commit is contained in:
committed by
SergiCForgeFlow
parent
013a412495
commit
de59326005
@@ -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.",
|
||||
)
|
||||
|
||||
@@ -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.",
|
||||
)
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user