[IMP] web: change the default name of a column in kanban view

This changes the name of the column in kanban view when the records
are grouped by date. The column name of the records with no date
went from false to Undefined.

Task-2188831

Co-authored-by: jdoutreloux <jud@odoo.com>
This commit is contained in:
Prakash Prajapati
2020-02-28 10:15:32 +01:00
committed by Yannick Tivisse
co-authored by jdoutreloux
parent 392f8d30f0
commit 901f5bbd82
2 changed files with 5 additions and 2 deletions
@@ -74,8 +74,8 @@ var KanbanColumn = Widget.extend({
this.record_options = _.clone(recordOptions);
if (options.grouped_by_m2o) {
// For many2one, a false value means that the field is not set.
if (options.grouped_by_m2o || options.grouped_by_date ) {
// For many2one and datetime, a false value means that the field is not set.
this.title = value ? value : _t('Undefined');
} else {
// False and 0 might be valid values for these fields.
@@ -503,9 +503,11 @@ var KanbanRenderer = BasicRenderer.extend({
// - is a date or datetime since we group by month or
// - is readonly (on the field attrs or in the view)
var draggable = true;
var grouped_by_date = false;
if (groupByFieldAttrs) {
if (groupByFieldAttrs.type === "date" || groupByFieldAttrs.type === "datetime") {
draggable = false;
grouped_by_date = true;
} else if (groupByFieldAttrs.readonly !== undefined) {
draggable = !(groupByFieldAttrs.readonly);
}
@@ -523,6 +525,7 @@ var KanbanRenderer = BasicRenderer.extend({
group_by_tooltip: groupByTooltip,
groupedBy: groupByField,
grouped_by_m2o: this.groupedByM2O,
grouped_by_date: grouped_by_date,
relation: relation,
quick_create: this.quickCreateEnabled && viewUtils.isQuickCreateEnabled(state),
});