summaryrefslogtreecommitdiff
path: root/addons/web/static/src/js/fields
diff options
context:
space:
mode:
authorMartin Geubelle <mge@odoo.com>2017-04-26 12:26:44 +0200
committerMartin Geubelle <mge@odoo.com>2017-04-27 16:56:47 +0200
commite4ac74450f346f47d397a510d8efe65bd5fa0f1f (patch)
tree98428de899aac88df2c6766c98a3d30264ca270b /addons/web/static/src/js/fields
parent776cd64aa357134c46e9a1376b45147bb1a4886a (diff)
[FIX] web, calendar: reintroduce many2manyattendee fields widget
This widget behaviour hadn't been correctly implemented with the new views. This commit also introduces some tests.
Diffstat (limited to 'addons/web/static/src/js/fields')
-rw-r--r--addons/web/static/src/js/fields/relational_fields.js20
1 files changed, 15 insertions, 5 deletions
diff --git a/addons/web/static/src/js/fields/relational_fields.js b/addons/web/static/src/js/fields/relational_fields.js
index f1eaad118ab..459b529c748 100644
--- a/addons/web/static/src/js/fields/relational_fields.js
+++ b/addons/web/static/src/js/fields/relational_fields.js
@@ -1202,6 +1202,20 @@ var FieldMany2ManyTags = AbstractField.extend({
}
},
/**
+ * Get the QWeb rendering context used by the tag template; this computation
+ * is placed in a separate function for other tags to override it.
+ *
+ * @private
+ * @returns {Object}
+ */
+ _getRenderTagsContext: function () {
+ var elements = this.value ? _.pluck(this.value.data, 'data') : [];
+ return {
+ elements: elements,
+ readonly: this.mode === "readonly",
+ };
+ },
+ /**
* @private
* @param {any} id
*/
@@ -1246,11 +1260,7 @@ var FieldMany2ManyTags = AbstractField.extend({
* @private
*/
_renderTags: function () {
- var elements = this.value ? _.pluck(this.value.data, 'data') : [];
- this.$el.html(qweb.render(this.tag_template, {
- elements: elements,
- readonly: this.mode === "readonly",
- }));
+ this.$el.html(qweb.render(this.tag_template, this._getRenderTagsContext()));
},
//--------------------------------------------------------------------------