Skip to content

Commit

Permalink
[FIX] product_route_profile: prevent triggering inverse method
Browse files Browse the repository at this point in the history
Set route_ids as readonly to avoid triggering inverse method and changing
the route_profile_id when adding force_route_profile_id
  • Loading branch information
bguillot authored and StefanRijnhart committed Jul 4, 2024
1 parent 83446d5 commit 4331dcd
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions product_route_profile/tests/test_product_route_profile.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ def test_2_force_route_profile(self):
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,
Expand Down
6 changes: 6 additions & 0 deletions product_route_profile/views/product_template.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@
<xpath expr="//field[@name='route_ids']/parent::div" position="attributes">
<attribute name="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"
Expand Down

0 comments on commit 4331dcd

Please sign in to comment.