diff options
| author | Christophe Simonis <chs@odoo.com> | 2019-06-17 13:20:35 +0200 |
|---|---|---|
| committer | Christophe Simonis <chs@odoo.com> | 2019-06-17 13:20:35 +0200 |
| commit | 25e3f270625b1a7f239d34fab94444d0b676d52e (patch) | |
| tree | a83ee8f72c2aedbe6c28fc89b6de4a655d5d97e6 /addons/web/static | |
| parent | 382989c341935582f6ae47510796ecd8d9f6b710 (diff) | |
| parent | 48a9f5a6335cfe8b3d465584f0d2f98be2530966 (diff) | |
[MERGE] forward port branch saas-12.3 up to 48a9f5a6335
Diffstat (limited to 'addons/web/static')
5 files changed, 36 insertions, 4 deletions
diff --git a/addons/web/static/src/js/chrome/action_manager_act_window.js b/addons/web/static/src/js/chrome/action_manager_act_window.js index ee3ce15bdd2..c19364fa7a9 100644 --- a/addons/web/static/src/js/chrome/action_manager_act_window.js +++ b/addons/web/static/src/js/chrome/action_manager_act_window.js @@ -372,7 +372,7 @@ ActionManager.include({ Widget: View, }); } else if (config.isDebug('assets')) { - console.error("View type '" + viewType + "' is not present in the view registry."); + console.log("View type '" + viewType + "' is not present in the view registry."); } }); return views; diff --git a/addons/web/static/src/js/fields/basic_fields.js b/addons/web/static/src/js/fields/basic_fields.js index beb7116169a..14f03a83222 100644 --- a/addons/web/static/src/js/fields/basic_fields.js +++ b/addons/web/static/src/js/fields/basic_fields.js @@ -1526,6 +1526,7 @@ var AbstractFieldBinary = AbstractField.extend({ */ _clearFile: function (){ var self = this; + this.$('.o_input_file').val(''); this.set_filename(''); if (!this.isDestroyed()) { this._setValue(false).then(function() { diff --git a/addons/web/static/src/js/views/qweb/qweb_view.js b/addons/web/static/src/js/views/qweb/qweb_view.js index 9e79ecf19d2..45c7340d5c1 100644 --- a/addons/web/static/src/js/views/qweb/qweb_view.js +++ b/addons/web/static/src/js/views/qweb/qweb_view.js @@ -65,8 +65,9 @@ var Model = AbstractModel.extend({ /** * reload */ - reload: function (_id, _params) { - // FIXME: update this._state or something? + reload: function (_id, params) { + _.extend(this._state, _.pick(params, ['domain', 'context'])); + return this._fetch(); } }); diff --git a/addons/web/static/src/scss/layout_boxed.scss b/addons/web/static/src/scss/layout_boxed.scss index 1916725f812..8b2d555365e 100644 --- a/addons/web/static/src/scss/layout_boxed.scss +++ b/addons/web/static/src/scss/layout_boxed.scss @@ -1,5 +1,5 @@ .o_boxed_footer, .o_boxed_header, .o_report_layout_boxed { - font-family: 'Lato' 'Noto'; + font-family: 'Lato', 'Noto'; color: gray('700'); font-size: 15px; } diff --git a/addons/web/static/tests/fields/basic_fields_tests.js b/addons/web/static/tests/fields/basic_fields_tests.js index 5c399547458..4e5deb56780 100644 --- a/addons/web/static/tests/fields/basic_fields_tests.js +++ b/addons/web/static/tests/fields/basic_fields_tests.js @@ -1998,6 +1998,36 @@ QUnit.module('basic_fields', { list.destroy(); }); + QUnit.test("binary fields input value is empty whean clearing after uploading", async function (assert) { + assert.expect(2); + + var form = await createView({ + View: FormView, + model: 'partner', + data: this.data, + arch: '<form string="Partners">' + + '<field name="document" filename="foo"/>' + + '<field name="foo"/>' + + '</form>', + res_id: 1, + }); + + await testUtils.form.clickEdit(form); + + // // We need to convert the input type since we can't programmatically set the value of a file input + form.$('.o_input_file').attr('type', 'text').val('coucou.txt'); + + assert.strictEqual(form.$('.o_input_file').val(), 'coucou.txt', + "input value should be changed to \"coucou.txt\""); + + await testUtils.dom.click(form.$('.o_field_binary_file > .o_clear_file_button')); + + assert.strictEqual(form.$('.o_input_file').val(), '', + "input value should be empty"); + + form.destroy(); + }); + QUnit.test('field text in editable list view', async function (assert) { assert.expect(1); |
