Widget Factory traces

This commit is contained in:
2026-06-02 12:11:20 +02:00
parent 257339911e
commit 15085fe9e5
4 changed files with 130 additions and 0 deletions

View File

@@ -15037,6 +15037,19 @@ function eval_pyson(value){
var WidgetFactory = Sao.View.FormXMLViewParser.WIDGETS[
attributes.widget];
if (!WidgetFactory) {
console.error('[FORM][UNKNOWN_WIDGET]', {
viewId: this.view.view_id,
model: this.view.screen && this.view.screen.model_name,
field: name,
widget: attributes.widget,
fieldAttributes: this.field_attrs[name],
attributes: attributes,
node: node.outerHTML,
availableWidgets: Object.keys(
Sao.View.FormXMLViewParser.WIDGETS).sort(),
});
}
var widget = new WidgetFactory(this.view, attributes);
if (!this.view.widgets[name]) {
this.view.widgets[name] = [];
@@ -24748,10 +24761,17 @@ function eval_pyson(value){
var is_hidden = invisible || optional ||
(column.attributes.name === this.screen.exclude_field);
var default_width = this._get_default_column_width(column);
var right_aligned = this._is_right_aligned_column(column);
var col_def = {
colId: name,
field: name,
headerName: column.attributes.string || '',
type: right_aligned ? 'rightAligned' : null,
cellClass: right_aligned ?
'ag-grid-right-aligned-cell ag-right-aligned-cell' : null,
cellStyle: right_aligned ? {textAlign: 'right'} : null,
headerClass: right_aligned ?
'ag-grid-right-aligned-header ag-right-aligned-header' : null,
sortable: !grouping_active && Boolean(column.sortable),
filter: grouping_active ? false : this._get_column_filter(column),
filterParams: grouping_active ? null :
@@ -24810,10 +24830,37 @@ function eval_pyson(value){
},
};
console.info('[AGGRID][ALIGN_COLUMN]', {
colId: name,
label: column.attributes.string || '',
widget: column.attributes.widget || '',
className: column.class_ || '',
rightAligned: right_aligned,
cellClass: col_def.cellClass,
headerClass: col_def.headerClass,
});
column_defs.push(col_def);
});
return column_defs;
},
_is_right_aligned_column: function(column) {
if (!column || !column.attributes) {
return false;
}
if (column instanceof Sao.View.Tree.IntegerColumn ||
column instanceof Sao.View.Tree.FloatColumn) {
return true;
}
if (~['integer', 'float', 'numeric'].indexOf(
column.attributes.widget || '')) {
return true;
}
var name = column.attributes.name || '';
var label = column.attributes.string || name;
return /amount|quantity|qty|price|premium|discount|tax|debit|credit|balance|solde|total/i.test(
name + ' ' + label);
},
_get_default_column_width: function(column) {
var name = column && column.attributes && column.attributes.name || '';
var label = column && column.attributes &&