summaryrefslogtreecommitdiff
path: root/addons/web/static/src/js/fields/basic_fields.js
diff options
context:
space:
mode:
authorChristophe Matthieu <chm@odoo.com>2018-07-26 09:55:01 +0200
committerChristophe Matthieu <chm@odoo.com>2018-08-13 17:09:28 +0200
commit61eef73b52c078daaae37f8d57e93830a2e53410 (patch)
tree8b144174691de487a584bf8ac449fb55d3ad12ab /addons/web/static/src/js/fields/basic_fields.js
parent149eb38b07cace0ec2118d214c56995402008efc (diff)
[IMP] base, *: use a many2one for the company report layout
Before this rev. one could set the report layout on the company using a hardcoded list (background, clean, standard, etc.). Other modules (typically accounting modules) could add options in this list. The used template was built on the layout key. Now, the layout is a many2one field to a newly created model `report.layout`, which is linked to a view with the layout architecture. This gives more control to customize reports and create a new layout (without creating a python module that extend the layout selection).
Diffstat (limited to 'addons/web/static/src/js/fields/basic_fields.js')
-rw-r--r--addons/web/static/src/js/fields/basic_fields.js51
1 files changed, 0 insertions, 51 deletions
diff --git a/addons/web/static/src/js/fields/basic_fields.js b/addons/web/static/src/js/fields/basic_fields.js
index 399647d1dbe..dfcbbc71a80 100644
--- a/addons/web/static/src/js/fields/basic_fields.js
+++ b/addons/web/static/src/js/fields/basic_fields.js
@@ -2826,56 +2826,6 @@ var AceEditor = DebouncedField.extend({
},
});
-var ImageSelection = AbstractField.extend({
- supportedFieldTypes: ['selection'],
- events: _.extend({}, AbstractField.prototype.events, {
- 'click img': '_onImgClicked',
- }),
-
- //--------------------------------------------------------------------------
- // Private
- //--------------------------------------------------------------------------
-
- /**
- * @override
- * @private
- */
- _render: function () {
- var self = this;
- this.$el.empty();
- _.each(this.nodeOptions, function (val, key) {
- var $container = $('<div>').addClass('col-3 text-center');
- var $img = $('<img>')
- .addClass('img img-fluid img-thumbnail ml16')
- .toggleClass('btn-info', key === self.value)
- .attr('src', val.image_link)
- .data('key', key);
- $container.append($img);
- if (val.preview_link) {
- var $previewLink = $('<a>')
- .text('Preview')
- .attr('href', val.preview_link)
- .attr('target', '_blank');
- $container.append($previewLink);
- }
- self.$el.append($container);
- });
- },
-
- //--------------------------------------------------------------------------
- // Handlers
- //--------------------------------------------------------------------------
-
- /**
- * @override
- * @private
- * @param {MouseEvent} event
- */
- _onImgClicked: function (event) {
- this._setValue($(event.currentTarget).data('key'));
- },
-});
-
return {
TranslatableFieldMixin: TranslatableFieldMixin,
DebouncedField: DebouncedField,
@@ -2906,7 +2856,6 @@ return {
HandleWidget: HandleWidget,
InputField: InputField,
AttachmentImage: AttachmentImage,
- ImageSelection: ImageSelection,
LabelSelection: LabelSelection,
StateSelectionWidget: StateSelectionWidget,
FavoriteWidget: FavoriteWidget,