diff options
| author | Dharmraj Jhala <dja@openerp.com> | 2017-04-18 14:33:57 +0530 |
|---|---|---|
| committer | Aaron Bohy <aab@odoo.com> | 2018-08-17 18:18:53 +0200 |
| commit | a105e5f2082eac0535d57005febbc1b1bb61e0a4 (patch) | |
| tree | a06426a98d4e8941d3ea5fa10f8292d0fe6f4dc6 /addons/web/static/src/js/core/dialog.js | |
| parent | 858893494f756351d1a4061e384e5eb081c8e405 (diff) | |
[IMP] web,various: Add 'Remove' button to view dialogs opened from x2m fields
Currently, to remove link of x2m field from any record, sometimes there's no way.
For example, if we are on mobile and open any Quotation, it's linked quotation lines
are automatically converted in kanban, and there is no way to delete a line from
that quotation. However, in some of the manually designed kanban, there is special 'x'
for removing / unlinking x2m record, for example, Contacts of Partner.
This commit makes the behavior more consistent. During edition (mobile and desktop), if
a view dialog is opened on click of x2m field, it will have one 'Remove' button (based
on user rights) on right side of dialog footer, allowing users to delete / unlink the
record. Moreover, in mobile, the modal is opened fullscreen, with sticky header and
footer.
Related Task# : 31641
Closes PR #15857
Co-authored-by: Mohammed Shekha <msh@openerp.com>
Diffstat (limited to 'addons/web/static/src/js/core/dialog.js')
| -rw-r--r-- | addons/web/static/src/js/core/dialog.js | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/addons/web/static/src/js/core/dialog.js b/addons/web/static/src/js/core/dialog.js index 9cca9c1127a..811fd9fd0de 100644 --- a/addons/web/static/src/js/core/dialog.js +++ b/addons/web/static/src/js/core/dialog.js @@ -31,6 +31,8 @@ var Dialog = Widget.extend({ * @param {string} [options.title=Odoo] * @param {string} [options.subtitle] * @param {string} [options.size=large] - 'large', 'medium' or 'small' + * @param {boolean} [options.fullscreen=false] - whether or not the dialog + * should be open in fullscreen mode (the main usecase is mobile) * @param {string} [options.dialogClass] - class to add to the modal-body * @param {jQuery} [options.$content] * Element which will be the $el, replace the .modal-body and get the @@ -56,6 +58,7 @@ var Dialog = Widget.extend({ options = _.defaults(options || {}, { title: _t('Odoo'), subtitle: '', size: 'large', + fullscreen: true, dialogClass: '', $content: false, buttons: [{text: _t("Ok"), close: true}], @@ -65,6 +68,7 @@ var Dialog = Widget.extend({ this.$content = options.$content; this.title = options.title; this.subtitle = options.subtitle; + this.fullscreen = options.fullscreen; this.dialogClass = options.dialogClass; this.size = options.size; this.buttons = options.buttons; @@ -81,6 +85,7 @@ var Dialog = Widget.extend({ return this._super.apply(this, arguments).then(function () { // Render modal once xml dependencies are loaded self.$modal = $(QWeb.render('Dialog', { + fullscreen: self.fullscreen, title: self.title, subtitle: self.subtitle, technical: self.technical, |
