diff --git a/CHANGELOG b/CHANGELOG index f3b542ffe6..12e54c2907 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,4 @@ +* Support grouping attribute * Add expander on tree to fold or unfold selected rows * Support monetary and symbol field attributes * Support digits from relation field diff --git a/src/model.js b/src/model.js index 5f517e10f7..66f20d6db9 100644 --- a/src/model.js +++ b/src/model.js @@ -1974,13 +1974,18 @@ Sao.field.Float._super.set_client.call(this, record, value, force_change); }, - get_client: function(record, factor) { + get_client: function(record, factor, grouping) { if (factor === undefined) { factor = 1; } + if (grouping === undefined) { + grouping = true; + } var value = this.get(record); if (value !== null) { - var options = {}; + var options = { + useGrouping: grouping, + }; var digits = this.digits(record, factor); if (digits) { options.minimumFractionDigits = digits[1]; diff --git a/src/view/form.js b/src/view/form.js index 6b0974a42b..d7a9cb4fc6 100644 --- a/src/view/form.js +++ b/src/view/form.js @@ -1877,6 +1877,7 @@ function eval_pyson(value){ } this.group.css('width', ''); this.factor = Number(attributes.factor || 1); + this.grouping = Boolean(Number(attributes.grouping || 1)); }, get modified() { if (this.record && this.field) { @@ -1933,7 +1934,7 @@ function eval_pyson(value){ this.el.css('width', this.width + 'ch'); } if (field) { - value = field.get_client(record, this.factor); + value = field.get_client(record, this.factor, this.grouping); } if (field && this.attributes.symbol) { var result = field.get_symbol(record, this.attributes.symbol); diff --git a/src/view/tree.js b/src/view/tree.js index 3165f51dbf..45bd607c84 100644 --- a/src/view/tree.js +++ b/src/view/tree.js @@ -2267,12 +2267,14 @@ init: function(model, attributes) { Sao.View.Tree.IntegerColumn._super.init.call(this, model, attributes); this.factor = Number(attributes.factor || 1); + this.grouping = Boolean(Number(attributes.grouping || 1)); }, get_cell: function() { return Sao.View.Tree.IntegerColumn._super.get_cell.call(this); }, update_text: function(cell, record) { - var value = this.field.get_client(record, this.factor); + var value = this.field.get_client( + record, this.factor, this.grouping); cell.text(value).attr('title', value); } });