From 6952ee18bce6fa2274e1e960cec5f5f4df67ef23 Mon Sep 17 00:00:00 2001 From: Mohammed Shekha Date: Mon, 19 Aug 2019 07:06:39 +0000 Subject: [FIX] web: crashmanager wrong syntax of arrow function arrow function used for error handler and error function is defined inside inner function so this will get changed, need to use self, also arrow function doesn't have its own arguments object, https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/Arrow_functions Issue raised from following commit: https://github.com/odoo/odoo/commit/2d6dc75a2cb5fa81189920d0f7fdc7b7f12132ab task-2052484 closes odoo/odoo#35788 Signed-off-by: pimodoo --- addons/web/static/src/js/fields/basic_fields.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'addons/web/static/src/js/fields/basic_fields.js') diff --git a/addons/web/static/src/js/fields/basic_fields.js b/addons/web/static/src/js/fields/basic_fields.js index a782e128bc7..664ce51b570 100644 --- a/addons/web/static/src/js/fields/basic_fields.js +++ b/addons/web/static/src/js/fields/basic_fields.js @@ -1941,7 +1941,7 @@ var FieldBinaryFile = AbstractFieldBinary.extend({ 'download': true, 'data': utils.is_bin_size(this.value) ? null : this.value, }, - error: () => this.call('crash_manager', 'rpc_error', ...arguments), + error: (error) => this.call('crash_manager', 'rpc_error', error), url: '/web/content', }); ev.stopPropagation(); -- cgit v1.2.3 From 71805ff41d7ae0e8a7266f98da92b6411b6cff46 Mon Sep 17 00:00:00 2001 From: Julien Mougenot Date: Tue, 3 Sep 2019 13:47:06 +0000 Subject: [FIX] web: add a single pixel to handle in lists Before this commit, handle was cropped in some views, showing an ellipsis instead of the actual handle. Now, handle has enough space to display properly. closes odoo/odoo#36387 Signed-off-by: VincentSchippefilt --- addons/web/static/src/js/fields/basic_fields.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'addons/web/static/src/js/fields/basic_fields.js') diff --git a/addons/web/static/src/js/fields/basic_fields.js b/addons/web/static/src/js/fields/basic_fields.js index 664ce51b570..8ec2ad142a6 100644 --- a/addons/web/static/src/js/fields/basic_fields.js +++ b/addons/web/static/src/js/fields/basic_fields.js @@ -1380,7 +1380,7 @@ var HandleWidget = AbstractField.extend({ description: _lt("Handle"), noLabel: true, className: 'o_row_handle fa fa-arrows ui-sortable-handle', - widthInList: '32px', + widthInList: '33px', tagName: 'span', supportedFieldTypes: ['integer'], -- cgit v1.2.3 From f60db9b93a64bff51bdf961ecd8366c8c1e169df Mon Sep 17 00:00:00 2001 From: Aaron Bohy Date: Mon, 2 Sep 2019 13:24:51 +0000 Subject: [FIX] web: kanban: global click and 'image' widget Let's assume a kanban view with oe_kanban_global_click className (i.e. clicks on the card open the record in a form view), and an image with the 'image' widget. This is for instance the case of the hr.employee kanban view. Before this rev., clicking on the image didn't open the record in form view. --- addons/web/static/src/js/fields/basic_fields.js | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'addons/web/static/src/js/fields/basic_fields.js') diff --git a/addons/web/static/src/js/fields/basic_fields.js b/addons/web/static/src/js/fields/basic_fields.js index 8ec2ad142a6..350ce9fa767 100644 --- a/addons/web/static/src/js/fields/basic_fields.js +++ b/addons/web/static/src/js/fields/basic_fields.js @@ -1867,6 +1867,17 @@ var FieldBinaryImage = AbstractFieldBinary.extend({ }, }); +var KanbanFieldBinaryImage = FieldBinaryImage.extend({ + // In kanban views, there is a weird logic to determine whether or not a + // click on a card should open the record in a form view. This logic checks + // if the clicked element has click handlers bound on it, and if so, does + // not open the record (assuming that the click will be handle by someone + // else). In the case of this widget, there are clicks handler but they + // only apply in edit mode, which is never the case in kanban views, so we + // simply remove them. + events: {}, +}); + var FieldBinaryFile = AbstractFieldBinary.extend({ description: _lt("File"), template: 'FieldBinaryFile', @@ -3266,6 +3277,7 @@ return { FieldPdfViewer: FieldPdfViewer, AbstractFieldBinary: AbstractFieldBinary, FieldBinaryImage: FieldBinaryImage, + KanbanFieldBinaryImage: KanbanFieldBinaryImage, FieldBoolean: FieldBoolean, BooleanToggle: BooleanToggle, FieldChar: FieldChar, @@ -3278,7 +3290,7 @@ return { FieldFloatTime: FieldFloatTime, FieldFloatFactor: FieldFloatFactor, FieldFloatToggle: FieldFloatToggle, - FieldPercentage : FieldPercentage, + FieldPercentage: FieldPercentage, FieldInteger: FieldInteger, FieldMonetary: FieldMonetary, FieldPercentPie: FieldPercentPie, -- cgit v1.2.3 From 2df9d021e133612d849b9beea19caa8e3e4f3ade Mon Sep 17 00:00:00 2001 From: Kevin Baptiste Date: Thu, 8 Aug 2019 10:25:40 +0000 Subject: [FIX] base: Fix zoom on image fields The goal of this commit is to adapt the zoom on image to the new names of the fields made by PR #4865. TaskID: 2049581 --- addons/web/static/src/js/fields/basic_fields.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'addons/web/static/src/js/fields/basic_fields.js') diff --git a/addons/web/static/src/js/fields/basic_fields.js b/addons/web/static/src/js/fields/basic_fields.js index 350ce9fa767..bc4b4e6b7d3 100644 --- a/addons/web/static/src/js/fields/basic_fields.js +++ b/addons/web/static/src/js/fields/basic_fields.js @@ -1822,8 +1822,11 @@ var FieldBinaryImage = AbstractFieldBinary.extend({ if(this.nodeOptions.zoom) { var unique = this.recordData.__last_update; - var url = this._getImageUrl(this.model, this.res_id, 'image', unique); + var url = this._getImageUrl(this.model, this.res_id, 'image_1920', unique); var $img; + var imageField = _.find(Object.keys(this.recordData), function(o) { + return o.startsWith('image_'); + }); if(this.nodeOptions.background) { @@ -1844,7 +1847,7 @@ var FieldBinaryImage = AbstractFieldBinary.extend({ $img = this.$('img'); } - if(this.recordData.image) { + if(this.recordData[imageField]) { $img.attr('data-zoom', 1); $img.attr('data-zoom-image', url); -- cgit v1.2.3 From 029dd1a214f727e25b479610df96b7ee94dd8127 Mon Sep 17 00:00:00 2001 From: Vincent Schippefilt Date: Tue, 20 Aug 2019 07:46:52 +0000 Subject: [IMP] web: edit translations in new dialog Before this commit, translations were edited in a list view with a filter on the field that needed to be translated. After this commit, the translations for each fields are translated in a dedicated dialog. The changes done to the current language are taken into account immediately, both ways, from the dialog to the form and from the form to the dialog. Translating terms is also available in create mode, the user will be prompted to save before editing a translation Task ID: 2028152 closes odoo/odoo#36185 Signed-off-by: VincentSchippefilt --- addons/web/static/src/js/fields/basic_fields.js | 33 ++++++++++++++++--------- 1 file changed, 21 insertions(+), 12 deletions(-) (limited to 'addons/web/static/src/js/fields/basic_fields.js') diff --git a/addons/web/static/src/js/fields/basic_fields.js b/addons/web/static/src/js/fields/basic_fields.js index bc4b4e6b7d3..da46488cffa 100644 --- a/addons/web/static/src/js/fields/basic_fields.js +++ b/addons/web/static/src/js/fields/basic_fields.js @@ -40,13 +40,9 @@ var TranslatableFieldMixin = { * @returns {jQuery} */ _renderTranslateButton: function () { - if (_t.database.multi_lang && this.field.translate && this.res_id) { + if (_t.database.multi_lang && this.field.translate) { var lang = _t.database.parameters.code.split('_')[0].toUpperCase(); - return $('