[FIX] base: invisible groups default on selection group

In 9deb1e6aa902a09c4f invisible duplicate were added for boolean groups.

But the added test could fail on master when installing only base
module: in this case, there is only the group "base.group_allow_export"
that is shown as a selection group because it is the only field of its
category. When we install other module, the field become a boolean group
that is handled by the aboved mentionned commit.

The previous fix and test didn't take this case into account, with
customization this could be a real issue.

With this commit, hidden selection field are also handled and the test
test_reified_groups pass in master when installing only base.

related to #120310

closes odoo/odoo#128944

X-original-commit: b22fc41d63bded2435cd330517d407abab5035ee
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
This commit is contained in:
Nicolas Lempereur
2023-07-18 21:48:30 +02:00
parent 55bcdfd7d8
commit e0ef9806a6
+3
View File
@@ -1458,6 +1458,9 @@ class GroupsView(models.Model):
xml_by_category[category_name].append(E.newline())
xml_by_category[category_name].append(E.field(name=field_name, **attrs))
xml_by_category[category_name].append(E.newline())
# add duplicate invisible field so default values are saved on create
if attrs.get('groups') == 'base.group_no_one':
xml0.append(E.field(name=field_name, **dict(attrs, invisible="1", groups='!base.group_no_one')))
else:
# application separator with boolean fields