[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
This commit is contained in:
Benoit
2024-02-08 22:18:47 +01:00
committed by Benoît
parent 9e43f38081
commit 042d19040b
2 changed files with 7 additions and 0 deletions

View File

@@ -55,6 +55,7 @@ class TestProductRouteProfile(SavepointCase):
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,

View File

@@ -11,6 +11,12 @@
<xpath expr="//field[@name='route_ids']/parent::div" position="attributes">
<attribute name="attrs">{'invisible': True}</attribute>
</xpath>
<xpath expr="//field[@name='route_ids']" position="attributes">
<attribute name="readonly">1</attribute>
</xpath>
<xpath expr="//label[@for='route_ids']" position="attributes">
<attribute name="invisible">1</attribute>
</xpath>
<xpath expr="//group[@name='operations']" position="inside">
<field
name="route_profile_id"