mirror of
https://github.com/OCA/stock-logistics-warehouse.git
synced 2025-01-21 14:27:28 +02:00
[MIG] stock_mts_mto_rule: Migration to 14.0
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
{
|
||||
"name": "Stock MTS+MTO Rule",
|
||||
"summary": "Add a MTS+MTO route",
|
||||
"version": "13.0.1.0.1",
|
||||
"version": "14.0.1.0.0",
|
||||
"development_status": "Mature",
|
||||
"category": "Warehouse",
|
||||
"website": "https://github.com/OCA/stock-logistics-warehouse",
|
||||
|
||||
@@ -10,7 +10,8 @@ class StockRule(models.Model):
|
||||
_inherit = "stock.rule"
|
||||
|
||||
action = fields.Selection(
|
||||
selection_add=[("split_procurement", "Choose between MTS and MTO")]
|
||||
selection_add=[("split_procurement", "Choose between MTS and MTO")],
|
||||
ondelete={"split_procurement": "cascade"},
|
||||
)
|
||||
mts_rule_id = fields.Many2one("stock.rule", string="MTS Rule", check_company=True)
|
||||
mto_rule_id = fields.Many2one("stock.rule", string="MTO Rule", check_company=True)
|
||||
@@ -95,7 +96,7 @@ class StockRule(models.Model):
|
||||
[domain, [("group_id", "=", group_id.id)]]
|
||||
)
|
||||
moves_to_assign = self.env["stock.move"].search(
|
||||
group_domain, order="priority desc, date_expected asc"
|
||||
group_domain, order="priority desc, date asc"
|
||||
)
|
||||
moves_to_assign._action_assign()
|
||||
|
||||
|
||||
@@ -17,6 +17,7 @@ class TestMtoMtsRoute(TransactionCase):
|
||||
|
||||
def test_standard_mto_route(self):
|
||||
mto_route = self.env.ref("stock.route_warehouse0_mto")
|
||||
mto_route.active = True
|
||||
self.product.route_ids = [(6, 0, [mto_route.id])]
|
||||
self.env["procurement.group"].run(
|
||||
[
|
||||
|
||||
Reference in New Issue
Block a user