diff options
| author | Christophe Simonis <chs@odoo.com> | 2017-09-19 13:05:04 +0200 |
|---|---|---|
| committer | Christophe Simonis <chs@odoo.com> | 2017-09-19 13:05:04 +0200 |
| commit | 08db385d02dd67f82937e4325179dda1a82519b7 (patch) | |
| tree | 9d1be20b01650218fefa38ec3ecae9a708fa0cf3 /addons/web/static/src/js/fields | |
| parent | 071b46c22786d9b0b7d1ef46387907cbfeb8980b (diff) | |
| parent | d15a31ae6d944cf04f9da8752b069b221cac0d9a (diff) | |
[MERGE] forward port branch saas-18 up to d15a31ae6d9
Diffstat (limited to 'addons/web/static/src/js/fields')
| -rw-r--r-- | addons/web/static/src/js/fields/abstract_field.js | 4 | ||||
| -rw-r--r-- | addons/web/static/src/js/fields/basic_fields.js | 21 | ||||
| -rw-r--r-- | addons/web/static/src/js/fields/field_utils.js | 8 | ||||
| -rw-r--r-- | addons/web/static/src/js/fields/special_fields.js | 8 | ||||
| -rw-r--r-- | addons/web/static/src/js/fields/upgrade_fields.js | 2 |
5 files changed, 27 insertions, 16 deletions
diff --git a/addons/web/static/src/js/fields/abstract_field.js b/addons/web/static/src/js/fields/abstract_field.js index bdb745298b2..894ee57c813 100644 --- a/addons/web/static/src/js/fields/abstract_field.js +++ b/addons/web/static/src/js/fields/abstract_field.js @@ -59,6 +59,8 @@ var AbstractField = Widget.extend({ specialData: false, /** * to override to indicate which field types are supported by the widget + * + * @type Array<String> */ supportedFieldTypes: [], @@ -196,7 +198,7 @@ var AbstractField = Widget.extend({ * will have the cursor at the very end. * * @param {Object} [options] - * @param {boolean} [noselect=false] if false and the input + * @param {boolean} [options.noselect=false] if false and the input * is of type text or textarea, the content will also be selected * @param {Event} [options.event] the event which fired this activation * @returns {boolean} true if the widget was activated, false if the diff --git a/addons/web/static/src/js/fields/basic_fields.js b/addons/web/static/src/js/fields/basic_fields.js index da7def82dd2..7e6a330120e 100644 --- a/addons/web/static/src/js/fields/basic_fields.js +++ b/addons/web/static/src/js/fields/basic_fields.js @@ -1741,10 +1741,9 @@ var FieldPercentPie = AbstractField.extend({ }); /** - * FieldProgressBar - * parameters - * - title: title of the bar, displayed on top of the bar - * options + * Node options: + * + * - title: title of the bar, displayed on top of the bar options * - editable: boolean if value is editable * - current_value: get the current_value from the field that must be present in the view * - max_value: get the max_value from the field that must be present in the view @@ -2099,8 +2098,9 @@ var FieldDomain = AbstractField.extend({ "click .o_field_domain_dialog_button": "_onDialogEditButtonClick", }), custom_events: _.extend({}, AbstractField.prototype.custom_events, { - "domain_changed": "_onDomainSelectorValueChange", - "domain_selected": "_onDomainSelectorDialogValueChange", + domain_changed: "_onDomainSelectorValueChange", + domain_selected: "_onDomainSelectorDialogValueChange", + open_record: "_onOpenRecord", }), /** * @constructor @@ -2281,6 +2281,15 @@ var FieldDomain = AbstractField.extend({ _onDomainSelectorDialogValueChange: function (e) { this._setValue(Domain.prototype.arrayToString(e.data.domain)); }, + /** + * Stops the propagation of the 'open_record' event, as we don't want the + * user to be able to open records from the list opened in a dialog. + * + * @param {OdooEvent} event + */ + _onOpenRecord: function (event) { + event.stopPropagation(); + }, }); /** diff --git a/addons/web/static/src/js/fields/field_utils.js b/addons/web/static/src/js/fields/field_utils.js index cbb2a856337..369dda9f037 100644 --- a/addons/web/static/src/js/fields/field_utils.js +++ b/addons/web/static/src/js/fields/field_utils.js @@ -80,7 +80,7 @@ function formatChar(value, field, options) { * Returns a string representing a date. If the value is false, then we return * an empty string. Note that this is dependant on the localization settings * - * @param {Moment|false} + * @param {Moment|false} value * @param {Object} [field] * a description of the field (note: this parameter is ignored) * @param {Object} [options] additional options @@ -258,7 +258,7 @@ function formatX2Many(value) { * @param {Object} [options] * additional options to override the values in the python description of * the field. - * @param {Object} [options.currency] - the description of the currency to use + * @param {Object} [options.currency] the description of the currency to use * @param {integer} [options.currency_id] * the id of the 'res.currency' to use (ignored if options.currency) * @param {string} [options.currency_field] @@ -336,7 +336,7 @@ function formatSelection(value, field, options) { * Create an Date object * The method toJSON return the formated value to send value server side * - * @param {string} + * @param {string} value * @param {Object} [field] * a description of the field (note: this parameter is ignored) * @param {Object} [options] additional options @@ -375,7 +375,7 @@ function parseDate(value, field, options) { * Create an Date object * The method toJSON return the formated value to send value server side * - * @param {string} + * @param {string} value * @param {Object} [field] * a description of the field (note: this parameter is ignored) * @param {Object} [options] additional options diff --git a/addons/web/static/src/js/fields/special_fields.js b/addons/web/static/src/js/fields/special_fields.js index 7a0bb9ed092..19db97fe985 100644 --- a/addons/web/static/src/js/fields/special_fields.js +++ b/addons/web/static/src/js/fields/special_fields.js @@ -10,10 +10,10 @@ var _t = core._t; /** - * This widget is intended to display a warning near a label of a 'timezone' field - * indicating if the browser timezone is identical (or not) to the selected timezone. - * This widget depends on a field given with the param 'tz_offset_field', which contains - * the time difference between UTC time and local time, in minutes. + * This widget is intended to display a warning near a label of a 'timezone' field + * indicating if the browser timezone is identical (or not) to the selected timezone. + * This widget depends on a field given with the param 'tz_offset_field', which contains + * the time difference between UTC time and local time, in minutes. */ var FieldTimezoneMismatch = FieldSelection.extend({ /** diff --git a/addons/web/static/src/js/fields/upgrade_fields.js b/addons/web/static/src/js/fields/upgrade_fields.js index 9d61036ab8b..119a64881e3 100644 --- a/addons/web/static/src/js/fields/upgrade_fields.js +++ b/addons/web/static/src/js/fields/upgrade_fields.js @@ -112,7 +112,7 @@ var AbstractFieldUpgrade = { /** * @private - * @param {MouseEvent} + * @param {MouseEvent} event */ _onInputClicked: function (event) { if ($(event.currentTarget).prop("checked")) { |
