Test if views attribute is empty using jQuery.isEmptyObject

The views attribute can be just an empty object when the xxx2Many field is
using a different widget like a multiselection.

Closes #13917
This commit is contained in:
Cédric Krier
2025-03-31 20:01:42 +02:00
parent a6c548b400
commit 6daed3eb95
+1 -1
View File
@@ -4,7 +4,7 @@
'use strict';
function get_x2m_sub_fields(f_attrs, prefix) {
if (f_attrs.visible && f_attrs.views) {
if (f_attrs.visible && !jQuery.isEmptyObject(f_attrs.views)) {
// There's only one key but we don't know its value
const [[, view],] = Object.entries(f_attrs.views);