mirror of
https://github.com/OCA/stock-logistics-warehouse.git
synced 2025-01-21 14:27:28 +02:00
[MIG] product_route_profile: Migration to 15.0
This commit is contained in:
@@ -5,7 +5,7 @@
|
||||
{
|
||||
"name": "Product Route Profile",
|
||||
"summary": "Add Route profile concept on product",
|
||||
"version": "14.0.1.0.3",
|
||||
"version": "15.0.1.0.0",
|
||||
"category": "Warehouse",
|
||||
"website": "https://github.com/OCA/stock-logistics-warehouse",
|
||||
"author": "Akretion, Odoo Community Association (OCA)",
|
||||
|
||||
@@ -28,7 +28,7 @@ class ProductTemplate(models.Model):
|
||||
@api.depends("route_profile_id", "force_route_profile_id")
|
||||
@api.depends_context("company")
|
||||
def _compute_route_ids(self):
|
||||
for rec in self:
|
||||
for rec in self.sudo():
|
||||
if rec.force_route_profile_id:
|
||||
rec.route_ids = [(6, 0, rec.force_route_profile_id.route_ids.ids)]
|
||||
elif rec.route_profile_id:
|
||||
|
||||
@@ -9,7 +9,7 @@ class RouteProfile(models.Model):
|
||||
_name = "route.profile"
|
||||
_description = "Route Profile"
|
||||
|
||||
name = fields.Char("Name")
|
||||
name = fields.Char()
|
||||
company_id = fields.Many2one(
|
||||
comodel_name="res.company",
|
||||
default=lambda self: self.env.company.id,
|
||||
|
||||
@@ -2,10 +2,10 @@
|
||||
# @author Kévin Roche <kevin.roche@akretion.com>
|
||||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
|
||||
|
||||
from odoo.tests.common import SavepointCase
|
||||
from odoo.tests.common import TransactionCase
|
||||
|
||||
|
||||
class TestProductRouteProfile(SavepointCase):
|
||||
class TestProductRouteProfile(TransactionCase):
|
||||
@classmethod
|
||||
def setUpClass(cls):
|
||||
super(TestProductRouteProfile, cls).setUpClass()
|
||||
|
||||
Reference in New Issue
Block a user