diff options
| author | fwi-odoo <fwi@odoo.com> | 2017-04-05 14:32:45 +0200 |
|---|---|---|
| committer | Aaron Bohy <aab@odoo.com> | 2017-04-11 19:44:38 +0200 |
| commit | ab44cabc78ae256636b951018d7967b2bd830fcc (patch) | |
| tree | 51f0b0c76f2e3c6c6faac5727ca4f7a89c60ac39 /addons/web/static/test | |
| parent | 4872c8da31bc10738c0f195c8665b59ec61f0e42 (diff) | |
[FIX] web: render the statinfo buttons that are not in a buttonbox
Without this commit, the statinfo field in a button but
not in a buttonbox are not rendered.
With this commit, when the button is rendered, the children are
processed and then the statinfo field is rendered (e.g. bank account(s) statinfo
in the Sales & Purchases tab in the res.partner form view).
Diffstat (limited to 'addons/web/static/test')
| -rw-r--r-- | addons/web/static/test/views/form_tests.js | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/addons/web/static/test/views/form_tests.js b/addons/web/static/test/views/form_tests.js index 2662313de8b..06616a407d6 100644 --- a/addons/web/static/test/views/form_tests.js +++ b/addons/web/static/test/views/form_tests.js @@ -2340,5 +2340,32 @@ QUnit.module('Views', { form.destroy(); }); + + QUnit.test('diplay a stat button outside a buttonbox', function (assert) { + assert.expect(3); + + var form = createView({ + View: FormView, + model: 'partner', + data: this.data, + arch: + '<form string="Partners">' + + '<sheet>' + + '<button class="oe_stat_button" type="action" name="1">' + + '<field name="int_field" widget="statinfo"/>' + + '</button>' + + '</sheet>' + + '</form>', + res_id: 2, + }); + + assert.strictEqual(form.$('button .o_field_widget').length, 1, + "a field widget should be display inside the button"); + assert.strictEqual(form.$('button .o_field_widget').children().length, 2, + "the field widget should have 2 children, the text and the value"); + assert.strictEqual(parseInt(form.$('button .o_field_widget .o_stat_value').text()), 9, + "the value rendered should be the same than the field value"); + form.destroy(); + }); }); }); |
