Skip to content

Commit 980b34f

Browse files
committed
fix(spp_user_roles): drop position=replace on implied_ids
OCA xml-view-dangerous-replace-low-priority hook flagged the position="replace" used to add a domain and an embedded list to the `implied_ids` field on the role form. Replace is reserved as a last resort; the same effect can be achieved with position="attributes" (for the new domain) plus position="inside" (to embed the list). Functionally identical for OP#979 — the field still restricts the group dropdown to free groups and the inline list still has create disabled, but the inheritance is now safer for downstream views.
1 parent a456097 commit 980b34f

1 file changed

Lines changed: 13 additions & 10 deletions

File tree

spp_user_roles/views/role.xml

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,19 @@
2020
<xpath expr="//field[@name='name']" position="after">
2121
<field name="role_type" />
2222
</xpath>
23-
<xpath expr="//field[@name='implied_ids']" position="replace">
24-
<field
25-
name="implied_ids"
26-
nolabel="1"
27-
domain="[('role_id', '=', False)]"
28-
>
29-
<list create="0">
30-
<field name="full_name" string="Group" />
31-
</list>
32-
</field>
23+
<!-- Restrict the Groups m2m to access groups not already
24+
owned by another role, and embed a list view that
25+
disables inline creation (avoids OP#979's "Add a line
26+
creates a new empty record" trap). Done via attributes
27+
+ inside instead of replace so the OCA xml-view-
28+
dangerous-replace check stays happy. -->
29+
<xpath expr="//field[@name='implied_ids']" position="attributes">
30+
<attribute name="domain">[('role_id', '=', False)]</attribute>
31+
</xpath>
32+
<xpath expr="//field[@name='implied_ids']" position="inside">
33+
<list create="0">
34+
<field name="full_name" string="Group" />
35+
</list>
3336
</xpath>
3437
<xpath
3538
expr="//field[@name='line_ids']/list/field[@name='user_id']"

0 commit comments

Comments
 (0)