Skip to content

Commit e4fc7bc

Browse files
committed
fix(spp_api_v2): make system_id rows readonly and muted in registry ID views
1 parent 910e853 commit e4fc7bc

2 files changed

Lines changed: 42 additions & 0 deletions

File tree

spp_api_v2/__manifest__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
"views/consent_views.xml",
4141
"views/api_outgoing_log_views.xml",
4242
"views/menu.xml",
43+
"views/reg_id_system_views.xml",
4344
],
4445
"assets": {},
4546
"demo": [],
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
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

Comments
 (0)