|
| 1 | +<?xml version="1.0" encoding="UTF-8" ?> |
| 2 | +<!-- |
| 3 | + Part of OpenSPP. See LICENSE file for full copyright and licensing details. |
| 4 | + Make system_id registry entries readonly in the UI. |
| 5 | +--> |
| 6 | +<odoo> |
| 7 | + <!-- Make system_id rows readonly in the list view --> |
| 8 | + <record id="view_reg_id_tree_system_readonly" model="ir.ui.view"> |
| 9 | + <field name="name">spp.registry.id.tree.system.readonly</field> |
| 10 | + <field name="model">spp.registry.id</field> |
| 11 | + <field name="inherit_id" ref="spp_registry.view_reg_id_tree" /> |
| 12 | + <field name="arch" type="xml"> |
| 13 | + <xpath expr="//list" position="attributes"> |
| 14 | + <attribute |
| 15 | + name="decoration-muted" |
| 16 | + >id_type_id.code == 'system_id'</attribute> |
| 17 | + </xpath> |
| 18 | + <xpath expr="//field[@name='value']" position="attributes"> |
| 19 | + <attribute name="readonly">id_type_id.code == 'system_id'</attribute> |
| 20 | + </xpath> |
| 21 | + <xpath expr="//field[@name='id_type_id']" position="attributes"> |
| 22 | + <attribute name="readonly">id_type_id.code == 'system_id'</attribute> |
| 23 | + </xpath> |
| 24 | + </field> |
| 25 | + </record> |
| 26 | + |
| 27 | + <!-- Make system_id readonly in the form view --> |
| 28 | + <record id="view_reg_id_form_system_readonly" model="ir.ui.view"> |
| 29 | + <field name="name">spp.registry.id.form.system.readonly</field> |
| 30 | + <field name="model">spp.registry.id</field> |
| 31 | + <field name="inherit_id" ref="spp_registry.view_reg_id_form" /> |
| 32 | + <field name="arch" type="xml"> |
| 33 | + <xpath expr="//field[@name='value']" position="attributes"> |
| 34 | + <attribute name="readonly">id_type_id.code == 'system_id'</attribute> |
| 35 | + </xpath> |
| 36 | + <xpath expr="//field[@name='id_type_id']" position="attributes"> |
| 37 | + <attribute name="readonly">id_type_id.code == 'system_id'</attribute> |
| 38 | + </xpath> |
| 39 | + </field> |
| 40 | + </record> |
| 41 | +</odoo> |
0 commit comments