summaryrefslogtreecommitdiff
path: root/addons/web/static/tests
diff options
context:
space:
mode:
authorMartin Geubelle <mge@odoo.com>2017-05-19 11:32:39 +0200
committerMartin Geubelle <mge@odoo.com>2017-05-19 15:02:21 +0200
commitea7ff8f6fa3c60855481b2ba1ce84d0b2ec5380d (patch)
treed0d1de960df65123f58aae12c8a92c713eda55c4 /addons/web/static/tests
parent92409cdfe5812c72f03ac96fab955db865f390c3 (diff)
[FIX] web: Form: handle attributes and modifiers on notebook
Before this commit, the renderer interpreted the special tag, but ignored modifiers and attributes. Most nodes are rendered by the `_renderGenericElement` method, so this behaviour is automatic. However, special tags need to do it explicitely.
Diffstat (limited to 'addons/web/static/tests')
-rw-r--r--addons/web/static/tests/views/form_tests.js27
1 files changed, 27 insertions, 0 deletions
diff --git a/addons/web/static/tests/views/form_tests.js b/addons/web/static/tests/views/form_tests.js
index e5efb3f9b7a..fecac794979 100644
--- a/addons/web/static/tests/views/form_tests.js
+++ b/addons/web/static/tests/views/form_tests.js
@@ -298,6 +298,33 @@ QUnit.module('Views', {
form.destroy();
});
+ QUnit.test('properly handle modifiers and attributes on notebook tags', function (assert) {
+ assert.expect(2);
+
+ var form = createView({
+ View: FormView,
+ model: 'partner',
+ data: this.data,
+ arch: '<form string="Partners">' +
+ '<sheet>' +
+ '<field name="product_id"/>' +
+ '<notebook class="new_class" attrs=\'{"invisible": [["product_id", "=", false]]}\'>' +
+ '<page string="Foo">' +
+ '<field name="foo"/>' +
+ '</page>' +
+ '</notebook>' +
+ '</sheet>' +
+ '</form>',
+ res_id: 1,
+ });
+
+ assert.ok(form.$('.o_notebook').hasClass('o_invisible_modifier'),
+ 'the notebook should handle modifiers (invisible)');
+ assert.ok(form.$('.o_notebook').hasClass('new_class'),
+ 'the notebook should handle attributes');
+ form.destroy();
+ });
+
QUnit.test('invisible attrs on first notebook page', function (assert) {
assert.expect(6);