From 00a172b40d0fd7edbf7cd7190b2e9db6345e51b5 Mon Sep 17 00:00:00 2001 From: Aaron Bohy Date: Fri, 3 Mar 2017 14:01:13 +0100 Subject: [FIX] web: adapt 1a9a082d to new fields --- .../web/static/src/js/fields/relational_fields.js | 22 +--------------------- 1 file changed, 1 insertion(+), 21 deletions(-) (limited to 'addons/web/static/src/js/fields') diff --git a/addons/web/static/src/js/fields/relational_fields.js b/addons/web/static/src/js/fields/relational_fields.js index 3f20d802209..b3b3a26c437 100644 --- a/addons/web/static/src/js/fields/relational_fields.js +++ b/addons/web/static/src/js/fields/relational_fields.js @@ -566,16 +566,6 @@ var FieldX2Many = AbstractRelationalField.extend({ // Private //-------------------------------------------------------------------------- - /** - * This function is meant to be overriden by the One2ManyField. - * - * @private - * @returns {Boolean} true if the 'Add an item' row should be available in - * the list renderer, false otherwise - */ - _hasCreateLine: function () { - return !this.isReadonly; - }, /** * Instanciates or updates the adequate renderer. * @@ -597,7 +587,7 @@ var FieldX2Many = AbstractRelationalField.extend({ this.renderer = new ListRenderer(this, this.value, { arch: arch, mode: this.mode, - addCreateLine: this._hasCreateLine(), + addCreateLine: !this.isReadonly && this.activeActions.create, addTrashIcon: !this.isReadonly, }); } @@ -784,16 +774,6 @@ var FieldOne2Many = FieldX2Many.extend({ // Private //-------------------------------------------------------------------------- - /** - * Overrides enable the 'Add an item' feature if the 'create' action is - * available. - * - * @override - * @private - */ - _hasCreateLine: function () { - return this._super.apply(this, arguments) && this.activeActions.create; - }, /** * Overrides to only render the buttons if the 'create' action is available. * -- cgit v1.2.3