From ba9f53142bc2df10c1e5e13bc40d41ad2b24a942 Mon Sep 17 00:00:00 2001 From: Benoit Date: Thu, 8 Feb 2024 22:18:47 +0100 Subject: [PATCH] [FIX] product_route_profile: prevent triggering inverse method Set route_ids as readonly to avoid triggering inverse method and changing the route_profile_id when adding force_route_profile_id --- product_route_profile/tests/test_product_route_profile.py | 1 + product_route_profile/views/product_template.xml | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/product_route_profile/tests/test_product_route_profile.py b/product_route_profile/tests/test_product_route_profile.py index 9e41e07a8..a60906be3 100644 --- a/product_route_profile/tests/test_product_route_profile.py +++ b/product_route_profile/tests/test_product_route_profile.py @@ -55,6 +55,7 @@ class TestProductRouteProfile(TransactionCase): self.product.with_company( self.env.company ).force_route_profile_id = self.route_profile_2.id + self.assertEqual(self.product.route_profile_id, self.route_profile_1) self.assertEqual( self.product.with_company(self.env.company).route_ids, self.route_profile_2.route_ids, diff --git a/product_route_profile/views/product_template.xml b/product_route_profile/views/product_template.xml index 93f073c3c..a79d736a7 100644 --- a/product_route_profile/views/product_template.xml +++ b/product_route_profile/views/product_template.xml @@ -11,6 +11,12 @@ True + + 1 + + + 1 +