diff --git a/addons/web/static/src/js/views/kanban/kanban_record.js b/addons/web/static/src/js/views/kanban/kanban_record.js index 2794d871e67..70afa09c066 100644 --- a/addons/web/static/src/js/views/kanban/kanban_record.js +++ b/addons/web/static/src/js/views/kanban/kanban_record.js @@ -177,21 +177,19 @@ var KanbanRecord = Widget.extend({ * @param {string} model the name of the model * @param {string} field the name of the field * @param {integer} id the id of the resource - * @param {integer} cache the cache duration, in seconds - * @param {Object} options + * @param {string} placeholder * @returns {string} the url of the image */ - _getImageURL: function (model, field, id, cache, options) { - options = options || {}; + _getImageURL: function (model, field, id, placeholder) { id = (_.isArray(id) ? id[0] : id) || false; - field = options.preview_image || field; + placeholder = placeholder || "/web/static/src/img/placeholder.png"; var isCurrentRecord = this.modelName === model && this.recordData.id === id; var url; if (isCurrentRecord && this.record[field] && this.record[field].raw_value && !utils.is_bin_size(this.record[field].raw_value)) { // Use magic-word technique for detecting image type url = 'data:image/' + this.file_type_magic_word[this.record[field].raw_value[0]] + ';base64,' + this.record[field].raw_value; } else if (!model || !field || !id || (isCurrentRecord && this.record[field] && !this.record[field].raw_value)) { - url = "/web/static/src/img/placeholder.png"; + url = placeholder; } else { var session = this.getSession(); var params = { @@ -202,10 +200,6 @@ var KanbanRecord = Widget.extend({ if (isCurrentRecord) { params.unique = this.record.__last_update && this.record.__last_update.value.replace(/[^0-9]/g, ''); } - if (cache !== undefined) { - // Set the cache duration in seconds. - params.cache = parseInt(cache, 10); - } url = session.url('/web/image', params); } return url; diff --git a/addons/web/static/src/scss/kanban_view.scss b/addons/web/static/src/scss/kanban_view.scss index e2c550f0a42..7ab56e2bbb3 100644 --- a/addons/web/static/src/scss/kanban_view.scss +++ b/addons/web/static/src/scss/kanban_view.scss @@ -146,7 +146,15 @@ margin-right: $o-kanban-inside-hgutter*2; flex: 1 0 $o-kanban-image-fill-width; min-height: 95px; - background: {size: cover; position: center }; + background: { + size: cover; + position: center; + repeat: no-repeat; + }; + + &.o_kanban_image_full { + background-size: contain; + } } // Adapt default 'o_kanban_image' element if present. @@ -158,6 +166,10 @@ flex: 0 0 $o-kanban-image-width; min-height: $o-kanban-image-width; align-self: baseline; + background: { + repeat: no-repeat; + position: center; + } // On medium screen size, align 'o_kanban_image' to 'o_kanban_image_fill_left' elements. @include media-breakpoint-up(md) { diff --git a/odoo/addons/base/static/img/avatar_grey.png b/odoo/addons/base/static/img/avatar_grey.png new file mode 100644 index 00000000000..db05e744f7c Binary files /dev/null and b/odoo/addons/base/static/img/avatar_grey.png differ diff --git a/odoo/addons/base/views/res_partner_views.xml b/odoo/addons/base/views/res_partner_views.xml index d11fa33b479..ffb6395a949 100644 --- a/odoo/addons/base/views/res_partner_views.xml +++ b/odoo/addons/base/views/res_partner_views.xml @@ -502,37 +502,25 @@ - +
- -
+ + + + +
-
+
- - - - - Delivery - - - Invoice - - - - Logo - - - Avatar - - + +