summaryrefslogtreecommitdiff
path: root/addons/web/static/src/js/fields/basic_fields.js
diff options
context:
space:
mode:
authorRobot Odoo <xmo+roboto@odoo.com>2019-04-02 15:46:39 +0200
committerGitHub <noreply@github.com>2019-04-02 15:46:39 +0200
commit9aea7ae1627e7af10fb03677142ccfc5333f654e (patch)
tree1233647e18260747f3fd315f79f4cae8b06bc0f6 /addons/web/static/src/js/fields/basic_fields.js
parenta82dbe4d680149b9bf15b7a122c6f8bd1b3582fa (diff)
parent8ea5a40417c2da2e82db66ad36fbf1e8e78bbe11 (diff)
[MERGE] web,*: list view improvements
This branch brings several improvements related to the list view: - grouped list views are now editable - 'expand' attribute can be used to open by default the first level groups - if there are a lot of groups, a pager is displayed (instead of having all groups in the same page) - when grouped on a many2one field, custom buttons (on the many2one comodel) can be inserted in each group's header - we can edit several records in a row in editable list views - editable lists do not flicker anymore when switching a row to edit mode - we can navigate through the cells in list views with the arrows (in readonly) Co-authored-by: Aaron Bohy aab@odoo.com Co-authored-by: David Monjoie dmo@odoo.com Co-authored-by: Martin Geubelle mge@odoo.com Co-authored-by: Ravi Gadhia rga@odoo.com Task 1915702 closes odoo/odoo#31756 Signed-off-by: VincentSchippefilt <VincentSchippefilt@users.noreply.github.com>
Diffstat (limited to 'addons/web/static/src/js/fields/basic_fields.js')
-rw-r--r--addons/web/static/src/js/fields/basic_fields.js17
1 files changed, 14 insertions, 3 deletions
diff --git a/addons/web/static/src/js/fields/basic_fields.js b/addons/web/static/src/js/fields/basic_fields.js
index 4940839e612..5919f100bcc 100644
--- a/addons/web/static/src/js/fields/basic_fields.js
+++ b/addons/web/static/src/js/fields/basic_fields.js
@@ -444,7 +444,6 @@ var FieldChar = InputField.extend(TranslatableFieldMixin, {
},
});
-
var LinkButton = AbstractField.extend({
events: _.extend({}, AbstractField.prototype.events, {
'click': '_onClick'
@@ -483,7 +482,6 @@ var LinkButton = AbstractField.extend({
event.stopPropagation();
window.open(this.value, '_blank');
},
-
});
var FieldDate = InputField.extend({
@@ -1114,6 +1112,7 @@ var FieldText = InputField.extend(TranslatableFieldMixin, {
if (this.mode === 'edit') {
this.tagName = 'textarea';
}
+ this.autoResizeOptions = {parent: this};
},
/**
* As it it done in the start function, the autoresize is done only once.
@@ -1122,7 +1121,7 @@ var FieldText = InputField.extend(TranslatableFieldMixin, {
*/
start: function () {
if (this.mode === 'edit') {
- dom.autoresize(this.$el, {parent: this});
+ dom.autoresize(this.$el, this.autoResizeOptions);
this.$el = this.$el.add(this._renderTranslateButton());
}
@@ -1159,11 +1158,22 @@ var FieldText = InputField.extend(TranslatableFieldMixin, {
},
});
+var ListFieldText = FieldText.extend({
+ /**
+ * @override
+ */
+ init: function () {
+ this._super.apply(this, arguments);
+ this.autoResizeOptions.min_height = 0;
+ },
+});
+
/**
* Displays a handle to modify the sequence.
*/
var HandleWidget = AbstractField.extend({
className: 'o_row_handle fa fa-arrows ui-sortable-handle',
+ widthFactor: 0,
tagName: 'span',
description: "",
supportedFieldTypes: ['integer'],
@@ -2996,6 +3006,7 @@ return {
FieldPhone: FieldPhone,
FieldProgressBar: FieldProgressBar,
FieldText: FieldText,
+ ListFieldText: ListFieldText,
FieldToggleBoolean: FieldToggleBoolean,
HandleWidget: HandleWidget,
InputField: InputField,