diff options
| author | Mohammed Shekha <msh@openerp.com> | 2019-02-01 04:46:48 +0000 |
|---|---|---|
| committer | Adrien Dieudonne <adr@odoo.com> | 2019-08-09 09:01:19 +0000 |
| commit | 80a8b66246762598c901b380cb113a988d579ff9 (patch) | |
| tree | 457ccf411b4864a08dff25a6091b5fcc74ff4f64 /addons/web/static/src/js/fields | |
| parent | d5d2f5014a9bcf7014901b7099839e1f63ae4d57 (diff) | |
[IMP] web: m2o/m2m SelectCreateDialog will now open kanban view
- many2one widget in mobile will open kanban view instead of listview when
records needs to be selected
- Add support of "kanban_view_ref" on many2x fields:
For many2one fields, this specific kanban view will be opened when you click
on this field. Note that in desktop, the behavior stay unchanged:
'Search More' will open the tree view.
For many2many fields, this specific kanban view will be opened when you add
a record in mobile.
- Add support "selection_mode" in kanban views.
This boolean is set to true when you want to use a kaban view to
select a record instead of open a record.
"selection_mode" is now passed in qweb_context to allow developers
to use t-if='selection_mode' in kanban views to show or hide elements;
buttons, dropdowns, anchor tags are not necessary when selection_mode
is enabled. So those elements can be hidden based on this condition.
Useful when kanban view is opened from m2o in mobile environment.
Task ID : 1924779
Diffstat (limited to 'addons/web/static/src/js/fields')
| -rw-r--r-- | addons/web/static/src/js/fields/relational_fields.js | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/addons/web/static/src/js/fields/relational_fields.js b/addons/web/static/src/js/fields/relational_fields.js index d486838d3f5..58dada8703e 100644 --- a/addons/web/static/src/js/fields/relational_fields.js +++ b/addons/web/static/src/js/fields/relational_fields.js @@ -393,6 +393,7 @@ var FieldMany2One = AbstractField.extend({ initial_view: view, disable_multiple_selection: true, no_create: !self.can_create, + kanban_view_ref: this.attrs.kanban_view_ref, on_selected: function (records) { self.reinitialize(records[0]); self.activate(); @@ -1750,6 +1751,7 @@ var FieldMany2Many = FieldX2Many.extend({ title: _t("Add: ") + this.string, no_create: this.nodeOptions.no_create || !this.activeActions.create, fields_view: this.attrs.views.form, + kanban_view_ref: this.attrs.kanban_view_ref, on_selected: function (records) { var resIDs = _.pluck(records, 'id'); var newIDs = _.difference(resIDs, self.value.res_ids); |
