Files
Benoit 042d19040b [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
2024-10-09 14:46:34 +02:00

33 lines
1.5 KiB
XML

<?xml version="1.0" encoding="UTF-8" ?>
<!-- Copyright (C) 2022 Akretion (<http://www.akretion.com>).
@author Kévin Roche <kevin.roche@akretion.com>
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -->
<odoo>
<record id="view_template_route_profile_form" model="ir.ui.view">
<field name="name">product.template.route.profile.form</field>
<field name="model">product.template</field>
<field name="inherit_id" ref="product.product_template_form_view" />
<field name="arch" type="xml">
<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"
attrs="{'invisible': [('type', 'in', ['service', 'digital'])]}"
/>
<field
name="force_route_profile_id"
attrs="{'invisible': [('type', 'in', ['service', 'digital'])]}"
/>
</xpath>
</field>
</record>
</odoo>