mirror of
https://github.com/OCA/stock-logistics-warehouse.git
synced 2025-01-21 14:27:28 +02:00
[MIG] stock_reserve_rule: Migration to 14.0
This commit is contained in:
@@ -3,7 +3,7 @@
|
|||||||
{
|
{
|
||||||
"name": "Stock Reservation Rules",
|
"name": "Stock Reservation Rules",
|
||||||
"summary": "Configure reservation rules by location",
|
"summary": "Configure reservation rules by location",
|
||||||
"version": "13.0.1.4.0",
|
"version": "14.0.1.0.0",
|
||||||
"author": "Camptocamp, Odoo Community Association (OCA)",
|
"author": "Camptocamp, Odoo Community Association (OCA)",
|
||||||
"website": "https://github.com/OCA/stock-logistics-warehouse",
|
"website": "https://github.com/OCA/stock-logistics-warehouse",
|
||||||
"category": "Stock Management",
|
"category": "Stock Management",
|
||||||
|
|||||||
@@ -1,18 +0,0 @@
|
|||||||
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html)
|
|
||||||
|
|
||||||
import logging
|
|
||||||
|
|
||||||
_logger = logging.getLogger(__name__)
|
|
||||||
|
|
||||||
|
|
||||||
def migrate(cr, version):
|
|
||||||
cr.execute(
|
|
||||||
"""
|
|
||||||
INSERT INTO stock_picking_type_stock_reserve_rule_rel
|
|
||||||
(stock_reserve_rule_id, stock_picking_type_id)
|
|
||||||
SELECT id, picking_type_id
|
|
||||||
FROM stock_reserve_rule
|
|
||||||
WHERE picking_type_id IS NOT NULL
|
|
||||||
ON CONFLICT DO NOTHING;
|
|
||||||
"""
|
|
||||||
)
|
|
||||||
@@ -9,5 +9,4 @@ class StockPickingType(models.Model):
|
|||||||
|
|
||||||
reserve_rule_ids = fields.Many2many(
|
reserve_rule_ids = fields.Many2many(
|
||||||
comodel_name="stock.reserve.rule",
|
comodel_name="stock.reserve.rule",
|
||||||
inverse_name="picking_type_ids",
|
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ class TestReserveRule(common.SavepointCase):
|
|||||||
@classmethod
|
@classmethod
|
||||||
def setUpClass(cls):
|
def setUpClass(cls):
|
||||||
super().setUpClass()
|
super().setUpClass()
|
||||||
|
cls.env = cls.env(context=dict(cls.env.context, tracking_disable=True))
|
||||||
cls.partner_delta = cls.env.ref("base.res_partner_4")
|
cls.partner_delta = cls.env.ref("base.res_partner_4")
|
||||||
cls.wh = cls.env["stock.warehouse"].create(
|
cls.wh = cls.env["stock.warehouse"].create(
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user