From cbdb849bc385599ba87a4fa2f2208ef29001abcd Mon Sep 17 00:00:00 2001 From: bosd Date: Tue, 31 Oct 2023 19:35:03 +0100 Subject: [PATCH] [MIG] product_route_profile: Migration to 15.0 --- product_route_profile/__manifest__.py | 2 +- product_route_profile/models/product_template.py | 2 +- product_route_profile/models/route_profile.py | 2 +- product_route_profile/tests/test_product_route_profile.py | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/product_route_profile/__manifest__.py b/product_route_profile/__manifest__.py index bf8879707..7519aed60 100644 --- a/product_route_profile/__manifest__.py +++ b/product_route_profile/__manifest__.py @@ -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)", diff --git a/product_route_profile/models/product_template.py b/product_route_profile/models/product_template.py index 9bcac2830..a6b158975 100644 --- a/product_route_profile/models/product_template.py +++ b/product_route_profile/models/product_template.py @@ -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: diff --git a/product_route_profile/models/route_profile.py b/product_route_profile/models/route_profile.py index a1e401525..12df849b4 100644 --- a/product_route_profile/models/route_profile.py +++ b/product_route_profile/models/route_profile.py @@ -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, diff --git a/product_route_profile/tests/test_product_route_profile.py b/product_route_profile/tests/test_product_route_profile.py index a45ee6c2f..2ff6636e4 100644 --- a/product_route_profile/tests/test_product_route_profile.py +++ b/product_route_profile/tests/test_product_route_profile.py @@ -2,10 +2,10 @@ # @author Kévin Roche # 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()