[MIG] product_route_profile: Migration to 15.0

This commit is contained in:
bosd
2023-10-31 19:35:03 +01:00
committed by Stefan Rijnhart
parent 2221c5843c
commit cbdb849bc3
4 changed files with 5 additions and 5 deletions

View File

@@ -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)",

View File

@@ -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:

View File

@@ -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,

View File

@@ -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()