From 90bca25c7fdb004c6f285eb3e723217bf07353dd Mon Sep 17 00:00:00 2001 From: Anthony Muschang Date: Fri, 27 Feb 2015 00:29:22 +0100 Subject: [PATCH 001/454] [ADD] module web_dialog_size New module that let the user expand a dialog box to the full screen width. --- web_dialog_size/README.rst | 38 ++++++++++++++ web_dialog_size/__init__.py | 0 web_dialog_size/__openerp__.py | 47 ++++++++++++++++++ web_dialog_size/static/description/icon.png | Bin 0 -> 9455 bytes .../static/src/css/web_dialog_size.css | 17 +++++++ .../static/src/js/web_dialog_size.js | 37 ++++++++++++++ .../static/src/xml/web_dialog_size.xml | 9 ++++ web_dialog_size/view/qweb.xml | 10 ++++ 8 files changed, 158 insertions(+) create mode 100644 web_dialog_size/README.rst create mode 100644 web_dialog_size/__init__.py create mode 100644 web_dialog_size/__openerp__.py create mode 100644 web_dialog_size/static/description/icon.png create mode 100644 web_dialog_size/static/src/css/web_dialog_size.css create mode 100644 web_dialog_size/static/src/js/web_dialog_size.js create mode 100644 web_dialog_size/static/src/xml/web_dialog_size.xml create mode 100644 web_dialog_size/view/qweb.xml diff --git a/web_dialog_size/README.rst b/web_dialog_size/README.rst new file mode 100644 index 000000000000..f508aa0a6563 --- /dev/null +++ b/web_dialog_size/README.rst @@ -0,0 +1,38 @@ +Expand Dialog +============= + +A module that lets the user expand a dialog box to the full screen width. + +It is named web_dialog_size as it could be extended to propose other dialog size management feature. + + +Bug Tracker +=========== + +Bugs are tracked on `GitHub Issues `_. +In case of trouble, please check there if your issue has already been reported. +If you spotted it first, help us smashing it by providing a detailed and welcomed feedback +`here `_. + + +Credits +======= + +Contributors +------------ + +* Anthony Muschang +* Stéphane Bidoul + +Maintainer +---------- + +.. image:: http://odoo-community.org/logo.png + :alt: Odoo Community Association + :target: http://odoo-community.org + +This module is maintained by the OCA. + +OCA, or the Odoo Community Association, is a nonprofit organization whose mission is to support the collaborative development of Odoo features and promote its widespread use. + +To contribute to this module, please visit http://odoo-community.org. \ No newline at end of file diff --git a/web_dialog_size/__init__.py b/web_dialog_size/__init__.py new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/web_dialog_size/__openerp__.py b/web_dialog_size/__openerp__.py new file mode 100644 index 000000000000..f0429370aee8 --- /dev/null +++ b/web_dialog_size/__openerp__.py @@ -0,0 +1,47 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# This file is part of web_dialog_sizes, an Odoo module. +# +# Copyright (c) 2015 ACSONE SA/NV () +# +# web_expand_dialog is free software: you can redistribute it and/or +# modify it under the terms of the GNU Affero General Public License +# as published by the Free Software Foundation, either version 3 of +# the License, or (at your option) any later version. +# +# web_expand_dialog is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the +# GNU Affero General Public License +# along with web_expand_dialog. +# If not, see . +# +############################################################################## +{ + 'name': "Web Dialog Size", + + 'summary': """ + A module that lets the user expand a + dialog box to the full screen width.""", + + 'author': "ACSONE SA/NV,Odoo Community Association (OCA)", + 'website': "http://acsone.eu", + + 'category': 'web', + 'version': '8.0.0.1.0', + 'license': 'AGPL-3', + + 'depends': [ + 'web', + ], + 'qweb': [ + 'static/src/xml/web_dialog_size.xml', + ], + 'data': [ + 'view/qweb.xml', + ], +} diff --git a/web_dialog_size/static/description/icon.png b/web_dialog_size/static/description/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..3a0328b516c4980e8e44cdb63fd945757ddd132d GIT binary patch literal 9455 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 z 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 Xviia!U7SGha1wx#SCgwmn*{w2TRX*I literal 0 HcmV?d00001 diff --git a/web_dialog_size/static/src/css/web_dialog_size.css b/web_dialog_size/static/src/css/web_dialog_size.css new file mode 100644 index 000000000000..10fba0f01009 --- /dev/null +++ b/web_dialog_size/static/src/css/web_dialog_size.css @@ -0,0 +1,17 @@ +.modal .modal-header button.dialog_button_extend { + padding-top: 0px; + padding-right: 3px; +} + +.modal .modal-header button.dialog_button_restore { + padding-top: 1px; + padding-right: 5px; +} + +.modal .modal-header .dialog_button_hide { + display: none; +} + +.dialog_full_screen { + width: calc(100% - 50px); +} \ No newline at end of file diff --git a/web_dialog_size/static/src/js/web_dialog_size.js b/web_dialog_size/static/src/js/web_dialog_size.js new file mode 100644 index 000000000000..d1d0299c8975 --- /dev/null +++ b/web_dialog_size/static/src/js/web_dialog_size.js @@ -0,0 +1,37 @@ +openerp.web_dialog_size= function (instance) { + + instance.web.Dialog = instance.web.Dialog.extend({ + + init_dialog: function () { + var self = this; + this._super(); + self.$dialog_box.find('.dialog_button_restore').addClass('dialog_button_hide'); + if (this.dialog_options.size !== 'large'){ + self.$dialog_box.find('.dialog_button_extend').addClass('dialog_button_hide'); + } + else{ + self.$dialog_box.find('.dialog_button_extend').on('click', self._extending); + self.$dialog_box.find('.dialog_button_restore').on('click', self._restore); + } + }, + + _extending: function() { + var self = this; + $(this).parents('.modal-dialog').addClass('dialog_full_screen'); + $(this).addClass('dialog_button_hide'); + + $(this).parents('.modal-dialog').find('.dialog_button_restore').removeClass('dialog_button_hide') + }, + + _restore: function() { + var self = this; + $(this).parents('.modal-dialog').removeClass('dialog_full_screen'); + $(this).addClass('dialog_button_hide'); + + $(this).parents('.modal-dialog').find('.dialog_button_extend').removeClass('dialog_button_hide') + }, + + }); + +}; + diff --git a/web_dialog_size/static/src/xml/web_dialog_size.xml b/web_dialog_size/static/src/xml/web_dialog_size.xml new file mode 100644 index 000000000000..1808dd2a67f9 --- /dev/null +++ b/web_dialog_size/static/src/xml/web_dialog_size.xml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/web_dialog_size/view/qweb.xml b/web_dialog_size/view/qweb.xml new file mode 100644 index 000000000000..31dcd70fe1e8 --- /dev/null +++ b/web_dialog_size/view/qweb.xml @@ -0,0 +1,10 @@ + + + + + \ No newline at end of file From f3df488538a79714aa8cc74997676033703cdddd Mon Sep 17 00:00:00 2001 From: "Pedro M. Baeza" Date: Wed, 6 Apr 2016 20:33:56 +0200 Subject: [PATCH 002/454] [IMP] web_dialog_size: Select default dialog size by config * [IMP] web_dialog_size: Put dialog size expanded by default * [REM] web_popup_large: By duplication of the functionality * [IMP] web_dialog_size: README and contributors * [ADD] configuration parameter for default behavior [FIX] return super's promise [IMP] use fontawesome icons for buttons --- web_dialog_size/README.rst | 27 ++++---- web_dialog_size/__openerp__.py | 5 +- .../static/src/css/web_dialog_size.css | 14 ++-- .../static/src/js/web_dialog_size.js | 68 +++++++++++++------ .../static/src/xml/web_dialog_size.xml | 11 +-- 5 files changed, 77 insertions(+), 48 deletions(-) diff --git a/web_dialog_size/README.rst b/web_dialog_size/README.rst index f508aa0a6563..c7e30bf04f15 100644 --- a/web_dialog_size/README.rst +++ b/web_dialog_size/README.rst @@ -1,19 +1,16 @@ Expand Dialog ============= -A module that lets the user expand a dialog box to the full screen width. +A module that lets the user expand/restore the dialog box size through a button +in the upper right corner (mimicking most windows managers). By default, +all dialog boxes are expanded. -It is named web_dialog_size as it could be extended to propose other dialog size management feature. - - -Bug Tracker -=========== - -Bugs are tracked on `GitHub Issues `_. -In case of trouble, please check there if your issue has already been reported. -If you spotted it first, help us smashing it by providing a detailed and welcomed feedback -`here `_. +Configuration +============= +By default, the module respects the caller's `dialog_size` option. If you want +to override this and have all dialogs maximized by default, set the configuration +parameter `web_dialog_size.default_maximize` to `1`. Credits ======= @@ -23,6 +20,8 @@ Contributors * Anthony Muschang * Stéphane Bidoul +* Pedro M. Baeza +* Holger Brunn Maintainer ---------- @@ -33,6 +32,8 @@ Maintainer This module is maintained by the OCA. -OCA, or the Odoo Community Association, is a nonprofit organization whose mission is to support the collaborative development of Odoo features and promote its widespread use. +OCA, or the Odoo Community Association, is a nonprofit organization whose +mission is to support the collaborative development of Odoo features and +promote its widespread use. -To contribute to this module, please visit http://odoo-community.org. \ No newline at end of file +To contribute to this module, please visit http://odoo-community.org. diff --git a/web_dialog_size/__openerp__.py b/web_dialog_size/__openerp__.py index f0429370aee8..cd7b6a4014e8 100644 --- a/web_dialog_size/__openerp__.py +++ b/web_dialog_size/__openerp__.py @@ -28,7 +28,10 @@ A module that lets the user expand a dialog box to the full screen width.""", - 'author': "ACSONE SA/NV,Odoo Community Association (OCA)", + 'author': "ACSONE SA/NV," + "Serv. Tecnol. Avanzados - Pedro M. Baeza," + "Therp BV," + "Odoo Community Association (OCA)", 'website': "http://acsone.eu", 'category': 'web', diff --git a/web_dialog_size/static/src/css/web_dialog_size.css b/web_dialog_size/static/src/css/web_dialog_size.css index 10fba0f01009..74f829ec3790 100644 --- a/web_dialog_size/static/src/css/web_dialog_size.css +++ b/web_dialog_size/static/src/css/web_dialog_size.css @@ -1,17 +1,15 @@ .modal .modal-header button.dialog_button_extend { - padding-top: 0px; padding-right: 3px; } .modal .modal-header button.dialog_button_restore { - padding-top: 1px; - padding-right: 5px; -} - -.modal .modal-header .dialog_button_hide { - display: none; + padding-right: 3px; } .dialog_full_screen { width: calc(100% - 50px); -} \ No newline at end of file +} + +.modal .modal-header button.close { + font-size: 14px; +} diff --git a/web_dialog_size/static/src/js/web_dialog_size.js b/web_dialog_size/static/src/js/web_dialog_size.js index d1d0299c8975..c2d1910c3e98 100644 --- a/web_dialog_size/static/src/js/web_dialog_size.js +++ b/web_dialog_size/static/src/js/web_dialog_size.js @@ -1,34 +1,58 @@ openerp.web_dialog_size= function (instance) { instance.web.Dialog = instance.web.Dialog.extend({ - init_dialog: function () { - var self = this; - this._super(); - self.$dialog_box.find('.dialog_button_restore').addClass('dialog_button_hide'); - if (this.dialog_options.size !== 'large'){ - self.$dialog_box.find('.dialog_button_extend').addClass('dialog_button_hide'); - } - else{ - self.$dialog_box.find('.dialog_button_extend').on('click', self._extending); - self.$dialog_box.find('.dialog_button_restore').on('click', self._restore); + var self = this, + result = this._super(); + self.$dialog_box.find('.dialog_button_extend') + .on('click', self.proxy('_extending')); + self.$dialog_box.find('.dialog_button_restore') + .on('click', self.proxy('_restore')); + if(this.dialog_options.size == 'large') + { + self._extending(); + return result; } + return jQuery.when(result).then(function() + { + var deferred = null; + if(openerp.web_dialog_size.default_maximize === undefined) + { + deferred = (new openerp.web.Model('ir.config_parameter')) + .call('get_param', + ['web_dialog_size.default_maximize']) + .then(function(default_maximize) + { + openerp.web_dialog_size.default_maximize = + default_maximize; + }); + } + return jQuery.when(deferred).then(function() + { + if(openerp.web_dialog_size.default_maximize) + { + self._extending(); + } + else + { + self._restore(); + } + }); + }); }, - _extending: function() { - var self = this; - $(this).parents('.modal-dialog').addClass('dialog_full_screen'); - $(this).addClass('dialog_button_hide'); - - $(this).parents('.modal-dialog').find('.dialog_button_restore').removeClass('dialog_button_hide') + _extending: function(e) { + var dialog = this.$el.parents('.modal-dialog'); + dialog.addClass('dialog_full_screen'); + dialog.find('.dialog_button_extend').hide(); + dialog.find('.dialog_button_restore').show(); }, - _restore: function() { - var self = this; - $(this).parents('.modal-dialog').removeClass('dialog_full_screen'); - $(this).addClass('dialog_button_hide'); - - $(this).parents('.modal-dialog').find('.dialog_button_extend').removeClass('dialog_button_hide') + _restore: function(e) { + var dialog = this.$el.parents('.modal-dialog'); + dialog.removeClass('dialog_full_screen'); + dialog.find('.dialog_button_restore').hide(); + dialog.find('.dialog_button_extend').show(); }, }); diff --git a/web_dialog_size/static/src/xml/web_dialog_size.xml b/web_dialog_size/static/src/xml/web_dialog_size.xml index 1808dd2a67f9..51e6fd6ae581 100644 --- a/web_dialog_size/static/src/xml/web_dialog_size.xml +++ b/web_dialog_size/static/src/xml/web_dialog_size.xml @@ -1,9 +1,12 @@ - - - + + + + + + - \ No newline at end of file + From 0c3167dd57e5eb282505f52bba07bae3dcf05b1a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Bidoul?= Date: Fri, 27 May 2016 21:53:29 +0200 Subject: [PATCH 003/454] [FIX] web_dialog_size: do not expand by default and correctly honor default_maximize parameter --- web_dialog_size/README.rst | 3 +-- web_dialog_size/static/src/js/web_dialog_size.js | 5 ----- 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/web_dialog_size/README.rst b/web_dialog_size/README.rst index c7e30bf04f15..3d409a60344f 100644 --- a/web_dialog_size/README.rst +++ b/web_dialog_size/README.rst @@ -2,8 +2,7 @@ Expand Dialog ============= A module that lets the user expand/restore the dialog box size through a button -in the upper right corner (mimicking most windows managers). By default, -all dialog boxes are expanded. +in the upper right corner (mimicking most windows managers). Configuration ============= diff --git a/web_dialog_size/static/src/js/web_dialog_size.js b/web_dialog_size/static/src/js/web_dialog_size.js index c2d1910c3e98..ff3708e582f5 100644 --- a/web_dialog_size/static/src/js/web_dialog_size.js +++ b/web_dialog_size/static/src/js/web_dialog_size.js @@ -8,11 +8,6 @@ openerp.web_dialog_size= function (instance) { .on('click', self.proxy('_extending')); self.$dialog_box.find('.dialog_button_restore') .on('click', self.proxy('_restore')); - if(this.dialog_options.size == 'large') - { - self._extending(); - return result; - } return jQuery.when(result).then(function() { var deferred = null; From 06294991a85c143df3fd78509b8450a4e5b5b731 Mon Sep 17 00:00:00 2001 From: Siddharth Bhalgami Date: Sun, 12 Jun 2016 16:32:31 +0530 Subject: [PATCH 004/454] [MIG] web_dialog_siza: Migrate to v9.0 --- web_dialog_size/README.rst | 1 + web_dialog_size/__openerp__.py | 14 +-- .../static/src/css/web_dialog_size.css | 6 +- .../static/src/js/web_dialog_size.js | 95 ++++++++----------- web_dialog_size/view/qweb.xml | 19 ++-- 5 files changed, 61 insertions(+), 74 deletions(-) diff --git a/web_dialog_size/README.rst b/web_dialog_size/README.rst index 3d409a60344f..d30b2f019177 100644 --- a/web_dialog_size/README.rst +++ b/web_dialog_size/README.rst @@ -21,6 +21,7 @@ Contributors * Stéphane Bidoul * Pedro M. Baeza * Holger Brunn +* Siddharth Bhalgami Maintainer ---------- diff --git a/web_dialog_size/__openerp__.py b/web_dialog_size/__openerp__.py index cd7b6a4014e8..7c5696f00308 100644 --- a/web_dialog_size/__openerp__.py +++ b/web_dialog_size/__openerp__.py @@ -28,14 +28,15 @@ A module that lets the user expand a dialog box to the full screen width.""", - 'author': "ACSONE SA/NV," - "Serv. Tecnol. Avanzados - Pedro M. Baeza," - "Therp BV," - "Odoo Community Association (OCA)", - 'website': "http://acsone.eu", + 'author': "ACSONE SA/NV, " + "Serv. Tecnol. Avanzados - Pedro M. Baeza, " + "Therp BV, " + "Odoo Community Association (OCA), " + "Siddharth Bhalgami", + 'website': "http://acsone.eu", 'category': 'web', - 'version': '8.0.0.1.0', + 'version': '9.0.1.0.0', 'license': 'AGPL-3', 'depends': [ @@ -47,4 +48,5 @@ 'data': [ 'view/qweb.xml', ], + 'installable': True, } diff --git a/web_dialog_size/static/src/css/web_dialog_size.css b/web_dialog_size/static/src/css/web_dialog_size.css index 74f829ec3790..bd7fdb2ee45c 100644 --- a/web_dialog_size/static/src/css/web_dialog_size.css +++ b/web_dialog_size/static/src/css/web_dialog_size.css @@ -1,9 +1,9 @@ .modal .modal-header button.dialog_button_extend { - padding-right: 3px; + padding-right: 5px; } .modal .modal-header button.dialog_button_restore { - padding-right: 3px; + padding-right: 5px; } .dialog_full_screen { @@ -11,5 +11,5 @@ } .modal .modal-header button.close { - font-size: 14px; + font-size: 18px; } diff --git a/web_dialog_size/static/src/js/web_dialog_size.js b/web_dialog_size/static/src/js/web_dialog_size.js index ff3708e582f5..56e070f29403 100644 --- a/web_dialog_size/static/src/js/web_dialog_size.js +++ b/web_dialog_size/static/src/js/web_dialog_size.js @@ -1,56 +1,41 @@ -openerp.web_dialog_size= function (instance) { - - instance.web.Dialog = instance.web.Dialog.extend({ - init_dialog: function () { - var self = this, - result = this._super(); - self.$dialog_box.find('.dialog_button_extend') - .on('click', self.proxy('_extending')); - self.$dialog_box.find('.dialog_button_restore') - .on('click', self.proxy('_restore')); - return jQuery.when(result).then(function() - { - var deferred = null; - if(openerp.web_dialog_size.default_maximize === undefined) - { - deferred = (new openerp.web.Model('ir.config_parameter')) - .call('get_param', - ['web_dialog_size.default_maximize']) - .then(function(default_maximize) - { - openerp.web_dialog_size.default_maximize = - default_maximize; - }); - } - return jQuery.when(deferred).then(function() - { - if(openerp.web_dialog_size.default_maximize) - { - self._extending(); - } - else - { - self._restore(); - } - }); - }); - }, - - _extending: function(e) { - var dialog = this.$el.parents('.modal-dialog'); - dialog.addClass('dialog_full_screen'); - dialog.find('.dialog_button_extend').hide(); - dialog.find('.dialog_button_restore').show(); - }, - - _restore: function(e) { - var dialog = this.$el.parents('.modal-dialog'); - dialog.removeClass('dialog_full_screen'); - dialog.find('.dialog_button_restore').hide(); - dialog.find('.dialog_button_extend').show(); - }, - - }); - -}; +odoo.define('web_dialog_size.web_dialog_size', function (require) { +'use strict'; +var Model = require('web.DataModel'); +var Dialog = require('web.Dialog'); + +Dialog.include({ + + init: function (parent, options) { + var self = this; + this._super.apply(this, arguments); + self.$modal.find('.dialog_button_extend').on('click', self.proxy('_extending')); + self.$modal.find('.dialog_button_restore').on('click', self.proxy('_restore')); + + new Model('ir.config_parameter').query(['key', 'value']). + filter([['key', '=', 'web_dialog_size.default_maximize']]).all().then(function(default_maximize) { + if (default_maximize.length && default_maximize[0]['value'] == 1) { + self._extending(); + } else { + self._restore(); + } + }); + }, + + _extending: function() { + var dialog = this.$el.parents('.modal-dialog'); + dialog.addClass('dialog_full_screen'); + dialog.find('.dialog_button_extend').hide(); + dialog.find('.dialog_button_restore').show(); + }, + + _restore: function() { + var dialog = this.$el.parents('.modal-dialog'); + dialog.removeClass('dialog_full_screen'); + dialog.find('.dialog_button_restore').hide(); + dialog.find('.dialog_button_extend').show(); + }, + +}); + +}); diff --git a/web_dialog_size/view/qweb.xml b/web_dialog_size/view/qweb.xml index 31dcd70fe1e8..103b3d970335 100644 --- a/web_dialog_size/view/qweb.xml +++ b/web_dialog_size/view/qweb.xml @@ -1,10 +1,9 @@ - - - - - \ No newline at end of file + + + + From 5b3313333baa358cd3442ba046d37661bd08c916 Mon Sep 17 00:00:00 2001 From: Siddharth Bhalgami Date: Sun, 5 Feb 2017 00:15:22 +0530 Subject: [PATCH 005/454] [10.0-MIG] web_dialog_size for v10.0 --- web_dialog_size/__manifest__.py | 33 ++++++++++++ web_dialog_size/__openerp__.py | 52 ------------------- .../static/src/js/web_dialog_size.js | 4 +- .../{view/qweb.xml => templates/assets.xml} | 0 4 files changed, 35 insertions(+), 54 deletions(-) create mode 100644 web_dialog_size/__manifest__.py delete mode 100644 web_dialog_size/__openerp__.py rename web_dialog_size/{view/qweb.xml => templates/assets.xml} (100%) diff --git a/web_dialog_size/__manifest__.py b/web_dialog_size/__manifest__.py new file mode 100644 index 000000000000..10b14d75a6ec --- /dev/null +++ b/web_dialog_size/__manifest__.py @@ -0,0 +1,33 @@ +# -*- coding: utf-8 -*- +# Copyright 2015 ACSONE SA/NV +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +{ + 'name': "Web Dialog Size", + + 'summary': """ + A module that lets the user expand a + dialog box to the full screen width.""", + + 'author': "ACSONE SA/NV, " + "Serv. Tecnol. Avanzados - Pedro M. Baeza, " + "Therp BV, " + "Odoo Community Association (OCA), " + "Siddharth Bhalgami", + + 'website': "http://acsone.eu", + 'category': 'web', + 'version': '10.0.1.0.0', + 'license': 'AGPL-3', + + 'depends': [ + 'web', + ], + 'qweb': [ + 'static/src/xml/web_dialog_size.xml', + ], + 'data': [ + 'templates/assets.xml', + ], + 'installable': True, +} diff --git a/web_dialog_size/__openerp__.py b/web_dialog_size/__openerp__.py deleted file mode 100644 index 7c5696f00308..000000000000 --- a/web_dialog_size/__openerp__.py +++ /dev/null @@ -1,52 +0,0 @@ -# -*- coding: utf-8 -*- -############################################################################## -# -# This file is part of web_dialog_sizes, an Odoo module. -# -# Copyright (c) 2015 ACSONE SA/NV () -# -# web_expand_dialog is free software: you can redistribute it and/or -# modify it under the terms of the GNU Affero General Public License -# as published by the Free Software Foundation, either version 3 of -# the License, or (at your option) any later version. -# -# web_expand_dialog is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the -# GNU Affero General Public License -# along with web_expand_dialog. -# If not, see . -# -############################################################################## -{ - 'name': "Web Dialog Size", - - 'summary': """ - A module that lets the user expand a - dialog box to the full screen width.""", - - 'author': "ACSONE SA/NV, " - "Serv. Tecnol. Avanzados - Pedro M. Baeza, " - "Therp BV, " - "Odoo Community Association (OCA), " - "Siddharth Bhalgami", - - 'website': "http://acsone.eu", - 'category': 'web', - 'version': '9.0.1.0.0', - 'license': 'AGPL-3', - - 'depends': [ - 'web', - ], - 'qweb': [ - 'static/src/xml/web_dialog_size.xml', - ], - 'data': [ - 'view/qweb.xml', - ], - 'installable': True, -} diff --git a/web_dialog_size/static/src/js/web_dialog_size.js b/web_dialog_size/static/src/js/web_dialog_size.js index 56e070f29403..df56b8fee07c 100644 --- a/web_dialog_size/static/src/js/web_dialog_size.js +++ b/web_dialog_size/static/src/js/web_dialog_size.js @@ -23,14 +23,14 @@ Dialog.include({ }, _extending: function() { - var dialog = this.$el.parents('.modal-dialog'); + var dialog = this.$modal.find('.modal-dialog'); dialog.addClass('dialog_full_screen'); dialog.find('.dialog_button_extend').hide(); dialog.find('.dialog_button_restore').show(); }, _restore: function() { - var dialog = this.$el.parents('.modal-dialog'); + var dialog = this.$modal.find('.modal-dialog'); dialog.removeClass('dialog_full_screen'); dialog.find('.dialog_button_restore').hide(); dialog.find('.dialog_button_extend').show(); diff --git a/web_dialog_size/view/qweb.xml b/web_dialog_size/templates/assets.xml similarity index 100% rename from web_dialog_size/view/qweb.xml rename to web_dialog_size/templates/assets.xml From 6ed14a651ea84cedf05784ce6f5ff27fcaee3b07 Mon Sep 17 00:00:00 2001 From: Wolfgang Pichler Date: Mon, 18 Sep 2017 09:58:06 +0200 Subject: [PATCH 006/454] [FIX+IMP] web_dialog_size * IMP: Added draggable support to dialogs * FIX: web_dialog_size: export modal - PR #733 introduced draggable dialogs which broke some of them --- web_dialog_size/README.rst | 35 ++++++++++++++++--- web_dialog_size/__manifest__.py | 12 +++---- .../static/src/js/web_dialog_size.js | 20 ++++++++++- 3 files changed, 54 insertions(+), 13 deletions(-) diff --git a/web_dialog_size/README.rst b/web_dialog_size/README.rst index d30b2f019177..c936a028daba 100644 --- a/web_dialog_size/README.rst +++ b/web_dialog_size/README.rst @@ -1,8 +1,14 @@ +.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg + :target: https://www.gnu.org/licenses/agpl + :alt: License: AGPL-3 + +============= Expand Dialog ============= A module that lets the user expand/restore the dialog box size through a button in the upper right corner (mimicking most windows managers). +It does also add draggable support to the dialogs. Configuration ============= @@ -11,24 +17,45 @@ By default, the module respects the caller's `dialog_size` option. If you want to override this and have all dialogs maximized by default, set the configuration parameter `web_dialog_size.default_maximize` to `1`. +.. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas + :alt: Try me on Runbot + :target: https://runbot.odoo-community.org/runbot/162/10.0 + +Bug Tracker +=========== + +Bugs are tracked on `GitHub Issues +`_. In case of trouble, please +check there if your issue has already been reported. If you spotted it first, +help us smash it by providing detailed and welcomed feedback. + Credits ======= +Images +------ + +* Odoo Community Association: `Icon `_. + Contributors ------------ * Anthony Muschang * Stéphane Bidoul -* Pedro M. Baeza +* Pedro M. Baeza * Holger Brunn * Siddharth Bhalgami +* Wolfgang Pichler +* David Vidal + +Do not contact contributors directly about support or help with technical issues. Maintainer ---------- -.. image:: http://odoo-community.org/logo.png +.. image:: https://odoo-community.org/logo.png :alt: Odoo Community Association - :target: http://odoo-community.org + :target: https://odoo-community.org This module is maintained by the OCA. @@ -36,4 +63,4 @@ OCA, or the Odoo Community Association, is a nonprofit organization whose mission is to support the collaborative development of Odoo features and promote its widespread use. -To contribute to this module, please visit http://odoo-community.org. +To contribute to this module, please visit https://odoo-community.org. diff --git a/web_dialog_size/__manifest__.py b/web_dialog_size/__manifest__.py index 10b14d75a6ec..6b8df22f57a5 100644 --- a/web_dialog_size/__manifest__.py +++ b/web_dialog_size/__manifest__.py @@ -4,22 +4,18 @@ { 'name': "Web Dialog Size", - 'summary': """ A module that lets the user expand a dialog box to the full screen width.""", - 'author': "ACSONE SA/NV, " - "Serv. Tecnol. Avanzados - Pedro M. Baeza, " "Therp BV, " - "Odoo Community Association (OCA), " - "Siddharth Bhalgami", - + "Siddharth Bhalgami," + "Tecnativa, " + "Odoo Community Association (OCA)", 'website': "http://acsone.eu", 'category': 'web', - 'version': '10.0.1.0.0', + 'version': '10.0.1.0.1', 'license': 'AGPL-3', - 'depends': [ 'web', ], diff --git a/web_dialog_size/static/src/js/web_dialog_size.js b/web_dialog_size/static/src/js/web_dialog_size.js index df56b8fee07c..e8f84da2b13b 100644 --- a/web_dialog_size/static/src/js/web_dialog_size.js +++ b/web_dialog_size/static/src/js/web_dialog_size.js @@ -14,7 +14,7 @@ Dialog.include({ new Model('ir.config_parameter').query(['key', 'value']). filter([['key', '=', 'web_dialog_size.default_maximize']]).all().then(function(default_maximize) { - if (default_maximize.length && default_maximize[0]['value'] == 1) { + if (default_maximize.length && default_maximize[0].value === 1) { self._extending(); } else { self._restore(); @@ -22,6 +22,24 @@ Dialog.include({ }); }, + open: function() { + var res = this._super.apply(this, arguments); + this.$modal.draggable({ + handle: '.modal-header', + helper: false + }); + return res; + }, + + close: function() { + var draggable = this.$modal.draggable( "instance" ); + if (draggable) { + this.$modal.draggable("destroy"); + } + var res = this._super.apply(this, arguments); + return res; + }, + _extending: function() { var dialog = this.$modal.find('.modal-dialog'); dialog.addClass('dialog_full_screen'); From e5b09e915008b544e0033ca837c5b06f7953c174 Mon Sep 17 00:00:00 2001 From: David Date: Tue, 19 Dec 2017 20:02:41 +0100 Subject: [PATCH 007/454] [FIX] web_dialog_size: default_maximize - default_maximize option wasn't working due to strict value comparison --- web_dialog_size/__manifest__.py | 2 +- web_dialog_size/static/src/js/web_dialog_size.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/web_dialog_size/__manifest__.py b/web_dialog_size/__manifest__.py index 6b8df22f57a5..a609e7c35296 100644 --- a/web_dialog_size/__manifest__.py +++ b/web_dialog_size/__manifest__.py @@ -14,7 +14,7 @@ "Odoo Community Association (OCA)", 'website': "http://acsone.eu", 'category': 'web', - 'version': '10.0.1.0.1', + 'version': '10.0.1.0.2', 'license': 'AGPL-3', 'depends': [ 'web', diff --git a/web_dialog_size/static/src/js/web_dialog_size.js b/web_dialog_size/static/src/js/web_dialog_size.js index e8f84da2b13b..f6faa4b10e3c 100644 --- a/web_dialog_size/static/src/js/web_dialog_size.js +++ b/web_dialog_size/static/src/js/web_dialog_size.js @@ -14,7 +14,7 @@ Dialog.include({ new Model('ir.config_parameter').query(['key', 'value']). filter([['key', '=', 'web_dialog_size.default_maximize']]).all().then(function(default_maximize) { - if (default_maximize.length && default_maximize[0].value === 1) { + if (default_maximize.length && default_maximize[0].value == 1) { self._extending(); } else { self._restore(); From 1570493f8a8ccb5636ba893485127c955ddf55cf Mon Sep 17 00:00:00 2001 From: Quentin Theuret Date: Sat, 17 Feb 2018 09:33:41 +0100 Subject: [PATCH 008/454] [MIG] Migrate web_dialog_size module to v11 --- web_dialog_size/README.rst | 3 +- web_dialog_size/__init__.py | 2 + web_dialog_size/__manifest__.py | 5 +- .../static/src/js/web_dialog_size.js | 46 ++++++++++--------- 4 files changed, 32 insertions(+), 24 deletions(-) diff --git a/web_dialog_size/README.rst b/web_dialog_size/README.rst index c936a028daba..6cc0acf8d72f 100644 --- a/web_dialog_size/README.rst +++ b/web_dialog_size/README.rst @@ -19,7 +19,7 @@ parameter `web_dialog_size.default_maximize` to `1`. .. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas :alt: Try me on Runbot - :target: https://runbot.odoo-community.org/runbot/162/10.0 + :target: https://runbot.odoo-community.org/runbot/162/11.0 Bug Tracker =========== @@ -47,6 +47,7 @@ Contributors * Siddharth Bhalgami * Wolfgang Pichler * David Vidal +* Quentin Theuret Do not contact contributors directly about support or help with technical issues. diff --git a/web_dialog_size/__init__.py b/web_dialog_size/__init__.py index e69de29bb2d1..2b46a37e4370 100644 --- a/web_dialog_size/__init__.py +++ b/web_dialog_size/__init__.py @@ -0,0 +1,2 @@ +# Copyright 2018 Quentin Theuret +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). \ No newline at end of file diff --git a/web_dialog_size/__manifest__.py b/web_dialog_size/__manifest__.py index a609e7c35296..df8945020b7b 100644 --- a/web_dialog_size/__manifest__.py +++ b/web_dialog_size/__manifest__.py @@ -1,5 +1,5 @@ -# -*- coding: utf-8 -*- # Copyright 2015 ACSONE SA/NV +# Copyright 2018 Amaris # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). { @@ -11,10 +11,11 @@ "Therp BV, " "Siddharth Bhalgami," "Tecnativa, " + "Amaris, " "Odoo Community Association (OCA)", 'website': "http://acsone.eu", 'category': 'web', - 'version': '10.0.1.0.2', + 'version': '11.0.1.0.1', 'license': 'AGPL-3', 'depends': [ 'web', diff --git a/web_dialog_size/static/src/js/web_dialog_size.js b/web_dialog_size/static/src/js/web_dialog_size.js index f6faa4b10e3c..93056f728131 100644 --- a/web_dialog_size/static/src/js/web_dialog_size.js +++ b/web_dialog_size/static/src/js/web_dialog_size.js @@ -1,34 +1,39 @@ odoo.define('web_dialog_size.web_dialog_size', function (require) { 'use strict'; -var Model = require('web.DataModel'); +var rpc = require('web.rpc'); var Dialog = require('web.Dialog'); Dialog.include({ - init: function (parent, options) { + willStart: function () { var self = this; - this._super.apply(this, arguments); - self.$modal.find('.dialog_button_extend').on('click', self.proxy('_extending')); - self.$modal.find('.dialog_button_restore').on('click', self.proxy('_restore')); - - new Model('ir.config_parameter').query(['key', 'value']). - filter([['key', '=', 'web_dialog_size.default_maximize']]).all().then(function(default_maximize) { - if (default_maximize.length && default_maximize[0].value == 1) { - self._extending(); - } else { - self._restore(); - } + return this._super.apply(this, arguments).then(function () { + self.$modal.find('.dialog_button_extend').on('click', self.proxy('_extending')); + self.$modal.find('.dialog_button_restore').on('click', self.proxy('_restore')); + return rpc.query({ + model: 'ir.config_parameter', + method: 'get_param', + args: ['web_dialog_size.default_maximize',], + }).then(function(default_maximize) { + if (default_maximize === "True" || default_maximize === 1) { + self._extending(); + } else { + self._restore(); + } + }); }); }, open: function() { - var res = this._super.apply(this, arguments); - this.$modal.draggable({ - handle: '.modal-header', - helper: false - }); - return res; + this._super.apply(this, arguments); + if (this.$modal) { + this.$modal.draggable({ + handle: '.modal-header', + helper: false + }); + }; + return this; }, close: function() { @@ -36,8 +41,7 @@ Dialog.include({ if (draggable) { this.$modal.draggable("destroy"); } - var res = this._super.apply(this, arguments); - return res; + return this._super.apply(this, arguments); }, _extending: function() { From f8e9147fca9bf8ea81a1a3984a3254b1b8acccf2 Mon Sep 17 00:00:00 2001 From: Quentin THEURET Date: Tue, 15 May 2018 20:42:14 +0200 Subject: [PATCH 009/454] [FIX] #921 Fixed issue when discard a modal with draggable element --- web_dialog_size/__manifest__.py | 2 +- web_dialog_size/static/src/js/web_dialog_size.js | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/web_dialog_size/__manifest__.py b/web_dialog_size/__manifest__.py index df8945020b7b..3b032fe7f5b8 100644 --- a/web_dialog_size/__manifest__.py +++ b/web_dialog_size/__manifest__.py @@ -15,7 +15,7 @@ "Odoo Community Association (OCA)", 'website': "http://acsone.eu", 'category': 'web', - 'version': '11.0.1.0.1', + 'version': '11.0.1.0.2', 'license': 'AGPL-3', 'depends': [ 'web', diff --git a/web_dialog_size/static/src/js/web_dialog_size.js b/web_dialog_size/static/src/js/web_dialog_size.js index 93056f728131..4aa412f4b6ea 100644 --- a/web_dialog_size/static/src/js/web_dialog_size.js +++ b/web_dialog_size/static/src/js/web_dialog_size.js @@ -37,9 +37,11 @@ Dialog.include({ }, close: function() { - var draggable = this.$modal.draggable( "instance" ); - if (draggable) { - this.$modal.draggable("destroy"); + if (this.$modal) { + var draggable = this.$modal.draggable("instance"); + if (draggable) { + this.$modal.draggable("destroy"); + } } return this._super.apply(this, arguments); }, From 40ced2ddf32e4e2cbd34b3489560455b9b04b278 Mon Sep 17 00:00:00 2001 From: Jairo Llopis Date: Wed, 13 Jun 2018 08:54:46 +0200 Subject: [PATCH 010/454] [FIX] web_dialog_size: Fix usage for non-admins and reduce calls (#954) This addon had 2 problems after migrating to v11: 1. One call to backend's `ir.config_parameter.get_param` was done for each instantiated dialog, while the setting served for the whole session equally. 2. That model is now readable only by admin users, so non-admins couldn't use the default at all. Fixed now. --- web_dialog_size/README.rst | 88 ++-- web_dialog_size/__init__.py | 3 +- web_dialog_size/__manifest__.py | 4 +- web_dialog_size/i18n/web_dialog_size.pot | 20 + web_dialog_size/models/__init__.py | 1 + web_dialog_size/models/ir_config_parameter.py | 17 + web_dialog_size/readme/CONFIGURATION.rst | 3 + web_dialog_size/readme/CONTRIBUTORS.rst | 11 + web_dialog_size/readme/DESCRIPTION.rst | 3 + web_dialog_size/static/description/index.html | 436 ++++++++++++++++++ .../static/src/js/web_dialog_size.js | 15 +- 11 files changed, 557 insertions(+), 44 deletions(-) create mode 100644 web_dialog_size/i18n/web_dialog_size.pot create mode 100644 web_dialog_size/models/__init__.py create mode 100644 web_dialog_size/models/ir_config_parameter.py create mode 100644 web_dialog_size/readme/CONFIGURATION.rst create mode 100644 web_dialog_size/readme/CONTRIBUTORS.rst create mode 100644 web_dialog_size/readme/DESCRIPTION.rst create mode 100644 web_dialog_size/static/description/index.html diff --git a/web_dialog_size/README.rst b/web_dialog_size/README.rst index 6cc0acf8d72f..440f06333c29 100644 --- a/web_dialog_size/README.rst +++ b/web_dialog_size/README.rst @@ -1,67 +1,89 @@ -.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg - :target: https://www.gnu.org/licenses/agpl - :alt: License: AGPL-3 - -============= -Expand Dialog -============= +=============== +Web Dialog Size +=============== + +.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png + :target: https://odoo-community.org/page/development-status + :alt: Beta +.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png + :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html + :alt: License: AGPL-3 +.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fweb-lightgray.png?logo=github + :target: https://github.com/OCA/web/tree/11.0/web_dialog_size + :alt: OCA/web +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png + :target: https://translation.odoo-community.org/projects/web-11-0/web-11-0-web_dialog_size + :alt: Translate me on Weblate +.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png + :target: https://runbot.odoo-community.org/runbot/162/11.0 + :alt: Try me on Runbot + +|badge1| |badge2| |badge3| |badge4| |badge5| A module that lets the user expand/restore the dialog box size through a button -in the upper right corner (mimicking most windows managers). -It does also add draggable support to the dialogs. - -Configuration -============= +in the upper right corner (imitating most windows managers). +It also adds draggable support to the dialogs. -By default, the module respects the caller's `dialog_size` option. If you want -to override this and have all dialogs maximized by default, set the configuration -parameter `web_dialog_size.default_maximize` to `1`. +**Table of contents** -.. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas - :alt: Try me on Runbot - :target: https://runbot.odoo-community.org/runbot/162/11.0 +.. contents:: + :local: Bug Tracker =========== -Bugs are tracked on `GitHub Issues -`_. In case of trouble, please -check there if your issue has already been reported. If you spotted it first, -help us smash it by providing detailed and welcomed feedback. +Bugs are tracked on `GitHub Issues `_. +In case of trouble, please check there if your issue has already been reported. +If you spotted it first, help us smashing it by providing a detailed and welcomed +`feedback `_. + +Do not contact contributors directly about support or help with technical issues. Credits ======= -Images ------- +Authors +~~~~~~~ -* Odoo Community Association: `Icon `_. +* ACSONE SA/NV +* Therp BV +* Siddharth Bhalgami +* Tecnativa +* Amaris Contributors ------------- +~~~~~~~~~~~~ * Anthony Muschang * Stéphane Bidoul -* Pedro M. Baeza * Holger Brunn * Siddharth Bhalgami * Wolfgang Pichler * David Vidal * Quentin Theuret +* `Tecnativa `_: -Do not contact contributors directly about support or help with technical issues. + * Pedro M. Baeza + * Jairo Llopis -Maintainer ----------- +Maintainers +~~~~~~~~~~~ + +This module is maintained by the OCA. .. image:: https://odoo-community.org/logo.png :alt: Odoo Community Association :target: https://odoo-community.org -This module is maintained by the OCA. - OCA, or the Odoo Community Association, is a nonprofit organization whose mission is to support the collaborative development of Odoo features and promote its widespread use. -To contribute to this module, please visit https://odoo-community.org. +This module is part of the `OCA/web `_ project on GitHub. + +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/web_dialog_size/__init__.py b/web_dialog_size/__init__.py index 2b46a37e4370..0650744f6bc6 100644 --- a/web_dialog_size/__init__.py +++ b/web_dialog_size/__init__.py @@ -1,2 +1 @@ -# Copyright 2018 Quentin Theuret -# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). \ No newline at end of file +from . import models diff --git a/web_dialog_size/__manifest__.py b/web_dialog_size/__manifest__.py index 3b032fe7f5b8..4e799d1a5f42 100644 --- a/web_dialog_size/__manifest__.py +++ b/web_dialog_size/__manifest__.py @@ -13,9 +13,9 @@ "Tecnativa, " "Amaris, " "Odoo Community Association (OCA)", - 'website': "http://acsone.eu", + 'website': "http://github.com/OCA/web", 'category': 'web', - 'version': '11.0.1.0.2', + 'version': '11.0.1.0.3', 'license': 'AGPL-3', 'depends': [ 'web', diff --git a/web_dialog_size/i18n/web_dialog_size.pot b/web_dialog_size/i18n/web_dialog_size.pot new file mode 100644 index 000000000000..ab1f7385cd1d --- /dev/null +++ b/web_dialog_size/i18n/web_dialog_size.pot @@ -0,0 +1,20 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * web_dialog_size +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 11.0\n" +"Report-Msgid-Bugs-To: \n" +"Last-Translator: <>\n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: \n" + +#. module: web_dialog_size +#: model:ir.model,name:web_dialog_size.model_ir_config_parameter +msgid "ir.config_parameter" +msgstr "" + diff --git a/web_dialog_size/models/__init__.py b/web_dialog_size/models/__init__.py new file mode 100644 index 000000000000..bd3aa9f10636 --- /dev/null +++ b/web_dialog_size/models/__init__.py @@ -0,0 +1 @@ +from . import ir_config_parameter diff --git a/web_dialog_size/models/ir_config_parameter.py b/web_dialog_size/models/ir_config_parameter.py new file mode 100644 index 000000000000..bc916db00fad --- /dev/null +++ b/web_dialog_size/models/ir_config_parameter.py @@ -0,0 +1,17 @@ +# Copyright 2018 Tecnativa - Jairo Llopis +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +from odoo.models import api, Model +from odoo.tools.safe_eval import const_eval + + +class IrConfigParameter(Model): + _inherit = "ir.config_parameter" + + @api.model + def get_web_dialog_size_config(self): + get_param = self.sudo().get_param + return { + key: const_eval(get_param("web_dialog_size.%s" % key, "False")) + for key in ["default_maximize"] + } diff --git a/web_dialog_size/readme/CONFIGURATION.rst b/web_dialog_size/readme/CONFIGURATION.rst new file mode 100644 index 000000000000..18b1ad078609 --- /dev/null +++ b/web_dialog_size/readme/CONFIGURATION.rst @@ -0,0 +1,3 @@ +By default, the module respects the caller's ``dialog_size`` option. +If you want to override this and have all dialogs maximized by default, +set the configuration parameter ``web_dialog_size.default_maximize`` to ``1``. diff --git a/web_dialog_size/readme/CONTRIBUTORS.rst b/web_dialog_size/readme/CONTRIBUTORS.rst new file mode 100644 index 000000000000..0641b1d1e15e --- /dev/null +++ b/web_dialog_size/readme/CONTRIBUTORS.rst @@ -0,0 +1,11 @@ +* Anthony Muschang +* Stéphane Bidoul +* Holger Brunn +* Siddharth Bhalgami +* Wolfgang Pichler +* David Vidal +* Quentin Theuret +* `Tecnativa `_: + + * Pedro M. Baeza + * Jairo Llopis diff --git a/web_dialog_size/readme/DESCRIPTION.rst b/web_dialog_size/readme/DESCRIPTION.rst new file mode 100644 index 000000000000..398e72f50cc7 --- /dev/null +++ b/web_dialog_size/readme/DESCRIPTION.rst @@ -0,0 +1,3 @@ +A module that lets the user expand/restore the dialog box size through a button +in the upper right corner (imitating most windows managers). +It also adds draggable support to the dialogs. diff --git a/web_dialog_size/static/description/index.html b/web_dialog_size/static/description/index.html new file mode 100644 index 000000000000..ce5afa5608e1 --- /dev/null +++ b/web_dialog_size/static/description/index.html @@ -0,0 +1,436 @@ + + + + + + +Web Dialog Size + + + +
+

Web Dialog Size

+ + +

Beta License: AGPL-3 OCA/web Translate me on Weblate Try me on Runbot

+

A module that lets the user expand/restore the dialog box size through a button +in the upper right corner (imitating most windows managers). +It also adds draggable support to the dialogs.

+

Table of contents

+ +
+

Bug Tracker

+

Bugs are tracked on GitHub Issues. +In case of trouble, please check there if your issue has already been reported. +If you spotted it first, help us smashing it by providing a detailed and welcomed +feedback.

+

Do not contact contributors directly about support or help with technical issues.

+
+
+

Credits

+
+

Authors

+
    +
  • ACSONE SA/NV
  • +
  • Therp BV
  • +
  • Siddharth Bhalgami
  • +
  • Tecnativa
  • +
  • Amaris
  • +
+
+
+

Contributors

+ +
+
+

Maintainers

+

This module is maintained by the OCA.

+Odoo Community Association +

OCA, or the Odoo Community Association, is a nonprofit organization whose +mission is to support the collaborative development of Odoo features and +promote its widespread use.

+

This module is part of the OCA/web project on GitHub.

+

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

+
+
+
+ + diff --git a/web_dialog_size/static/src/js/web_dialog_size.js b/web_dialog_size/static/src/js/web_dialog_size.js index 4aa412f4b6ea..4ec9424645ae 100644 --- a/web_dialog_size/static/src/js/web_dialog_size.js +++ b/web_dialog_size/static/src/js/web_dialog_size.js @@ -4,6 +4,11 @@ odoo.define('web_dialog_size.web_dialog_size', function (require) { var rpc = require('web.rpc'); var Dialog = require('web.Dialog'); +var config = rpc.query({ + model: 'ir.config_parameter', + method: 'get_web_dialog_size_config', +}); + Dialog.include({ willStart: function () { @@ -11,12 +16,8 @@ Dialog.include({ return this._super.apply(this, arguments).then(function () { self.$modal.find('.dialog_button_extend').on('click', self.proxy('_extending')); self.$modal.find('.dialog_button_restore').on('click', self.proxy('_restore')); - return rpc.query({ - model: 'ir.config_parameter', - method: 'get_param', - args: ['web_dialog_size.default_maximize',], - }).then(function(default_maximize) { - if (default_maximize === "True" || default_maximize === 1) { + return config.done(function(default_maximize) { + if (default_maximize) { self._extending(); } else { self._restore(); @@ -32,7 +33,7 @@ Dialog.include({ handle: '.modal-header', helper: false }); - }; + } return this; }, From 2a53454440aaaec8552654c7ca49cd7b72f959b2 Mon Sep 17 00:00:00 2001 From: QS5ELkMu Date: Wed, 18 Jul 2018 12:45:50 +0200 Subject: [PATCH 011/454] [11.0][FIX] web_dialog_size: Draggable Dialog --- .../static/src/js/web_dialog_size.js | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/web_dialog_size/static/src/js/web_dialog_size.js b/web_dialog_size/static/src/js/web_dialog_size.js index 4ec9424645ae..c5b281a048ed 100644 --- a/web_dialog_size/static/src/js/web_dialog_size.js +++ b/web_dialog_size/static/src/js/web_dialog_size.js @@ -26,15 +26,15 @@ Dialog.include({ }); }, - open: function() { - this._super.apply(this, arguments); - if (this.$modal) { - this.$modal.draggable({ - handle: '.modal-header', - helper: false - }); - } - return this; + opened: function(handler) { + return this._super.apply(this, arguments).then(function(){ + if (this.$modal) { + this.$modal.draggable({ + handle: '.modal-header', + helper: false + }); + } + }.bind(this)); }, close: function() { From 84b5dc1b3f928f8e125857751fac881c8db0a251 Mon Sep 17 00:00:00 2001 From: joezsweet Date: Fri, 21 Sep 2018 17:24:51 +0200 Subject: [PATCH 012/454] Fix default_maximize check Checking result of rpc call, `dialog_maximize`, will end to be always `true` as the method will return a json: `{'dialog_maximize': false }`. So i changed the test to test the value of json key `dialog_maximize` --- web_dialog_size/static/src/js/web_dialog_size.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/web_dialog_size/static/src/js/web_dialog_size.js b/web_dialog_size/static/src/js/web_dialog_size.js index c5b281a048ed..7c5ab7c5bb5c 100644 --- a/web_dialog_size/static/src/js/web_dialog_size.js +++ b/web_dialog_size/static/src/js/web_dialog_size.js @@ -16,8 +16,8 @@ Dialog.include({ return this._super.apply(this, arguments).then(function () { self.$modal.find('.dialog_button_extend').on('click', self.proxy('_extending')); self.$modal.find('.dialog_button_restore').on('click', self.proxy('_restore')); - return config.done(function(default_maximize) { - if (default_maximize) { + return config.done(function(r) { + if (r.default_maximize) { self._extending(); } else { self._restore(); From e7680d9e87229ce42b568adcdfbf1dc7c9c17323 Mon Sep 17 00:00:00 2001 From: ernesto Date: Wed, 21 Nov 2018 22:50:59 -0500 Subject: [PATCH 013/454] [MIG] web_dialog_size: Migration to 12.0 --- web_dialog_size/README.rst | 24 +++++++--- web_dialog_size/__manifest__.py | 2 +- web_dialog_size/i18n/web_dialog_size.pot | 4 +- web_dialog_size/models/ir_config_parameter.py | 4 +- web_dialog_size/readme/CONFIGURE.rst | 5 ++ web_dialog_size/readme/CONTRIBUTORS.rst | 5 +- web_dialog_size/static/description/index.html | 46 ++++++++++++------- .../static/src/css/web_dialog_size.css | 15 ------ .../static/src/scss/web_dialog_size.scss | 24 ++++++++++ .../static/src/xml/web_dialog_size.xml | 2 +- web_dialog_size/templates/assets.xml | 2 +- web_dialog_size/tests/__init__.py | 1 + web_dialog_size/tests/test_web_dialog_size.py | 20 ++++++++ 13 files changed, 107 insertions(+), 47 deletions(-) create mode 100644 web_dialog_size/readme/CONFIGURE.rst delete mode 100644 web_dialog_size/static/src/css/web_dialog_size.css create mode 100644 web_dialog_size/static/src/scss/web_dialog_size.scss create mode 100644 web_dialog_size/tests/__init__.py create mode 100644 web_dialog_size/tests/test_web_dialog_size.py diff --git a/web_dialog_size/README.rst b/web_dialog_size/README.rst index 440f06333c29..ee62e1816e95 100644 --- a/web_dialog_size/README.rst +++ b/web_dialog_size/README.rst @@ -14,13 +14,13 @@ Web Dialog Size :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html :alt: License: AGPL-3 .. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fweb-lightgray.png?logo=github - :target: https://github.com/OCA/web/tree/11.0/web_dialog_size + :target: https://github.com/OCA/web/tree/12.0/web_dialog_size :alt: OCA/web .. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png - :target: https://translation.odoo-community.org/projects/web-11-0/web-11-0-web_dialog_size + :target: https://translation.odoo-community.org/projects/web-12-0/web-12-0-web_dialog_size :alt: Translate me on Weblate .. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png - :target: https://runbot.odoo-community.org/runbot/162/11.0 + :target: https://runbot.odoo-community.org/runbot/162/12.0 :alt: Try me on Runbot |badge1| |badge2| |badge3| |badge4| |badge5| @@ -34,13 +34,22 @@ It also adds draggable support to the dialogs. .. contents:: :local: +Configuration +============= + +If you want to set dialog boxes maximized by default, you need to: + +#. Go to *Settings -> Technical -> Parameters -> System Parameters* +#. Add a new record with the text *web_dialog_size.default_maximize* in + the *Key* field and the text *True* in the *Value* field + Bug Tracker =========== Bugs are tracked on `GitHub Issues `_. In case of trouble, please check there if your issue has already been reported. If you spotted it first, help us smashing it by providing a detailed and welcomed -`feedback `_. +`feedback `_. Do not contact contributors directly about support or help with technical issues. @@ -68,8 +77,9 @@ Contributors * Quentin Theuret * `Tecnativa `_: - * Pedro M. Baeza - * Jairo Llopis + * Pedro M. Baeza + * Jairo Llopis + * Ernesto Tejeda Maintainers ~~~~~~~~~~~ @@ -84,6 +94,6 @@ OCA, or the Odoo Community Association, is a nonprofit organization whose mission is to support the collaborative development of Odoo features and promote its widespread use. -This module is part of the `OCA/web `_ project on GitHub. +This module is part of the `OCA/web `_ project on GitHub. You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/web_dialog_size/__manifest__.py b/web_dialog_size/__manifest__.py index 4e799d1a5f42..31f85ac95eb3 100644 --- a/web_dialog_size/__manifest__.py +++ b/web_dialog_size/__manifest__.py @@ -15,7 +15,7 @@ "Odoo Community Association (OCA)", 'website': "http://github.com/OCA/web", 'category': 'web', - 'version': '11.0.1.0.3', + 'version': '12.0.1.0.0', 'license': 'AGPL-3', 'depends': [ 'web', diff --git a/web_dialog_size/i18n/web_dialog_size.pot b/web_dialog_size/i18n/web_dialog_size.pot index ab1f7385cd1d..513879ed357e 100644 --- a/web_dialog_size/i18n/web_dialog_size.pot +++ b/web_dialog_size/i18n/web_dialog_size.pot @@ -4,7 +4,7 @@ # msgid "" msgstr "" -"Project-Id-Version: Odoo Server 11.0\n" +"Project-Id-Version: Odoo Server 12.0\n" "Report-Msgid-Bugs-To: \n" "Last-Translator: <>\n" "Language-Team: \n" @@ -15,6 +15,6 @@ msgstr "" #. module: web_dialog_size #: model:ir.model,name:web_dialog_size.model_ir_config_parameter -msgid "ir.config_parameter" +msgid "System Parameter" msgstr "" diff --git a/web_dialog_size/models/ir_config_parameter.py b/web_dialog_size/models/ir_config_parameter.py index bc916db00fad..4de06e322c4e 100644 --- a/web_dialog_size/models/ir_config_parameter.py +++ b/web_dialog_size/models/ir_config_parameter.py @@ -12,6 +12,6 @@ class IrConfigParameter(Model): def get_web_dialog_size_config(self): get_param = self.sudo().get_param return { - key: const_eval(get_param("web_dialog_size.%s" % key, "False")) - for key in ["default_maximize"] + "default_maximize": const_eval( + get_param("web_dialog_size.default_maximize", "False")) } diff --git a/web_dialog_size/readme/CONFIGURE.rst b/web_dialog_size/readme/CONFIGURE.rst new file mode 100644 index 000000000000..902f3316e49a --- /dev/null +++ b/web_dialog_size/readme/CONFIGURE.rst @@ -0,0 +1,5 @@ +If you want to set dialog boxes maximized by default, you need to: + +#. Go to *Settings -> Technical -> Parameters -> System Parameters* +#. Add a new record with the text *web_dialog_size.default_maximize* in + the *Key* field and the text *True* in the *Value* field diff --git a/web_dialog_size/readme/CONTRIBUTORS.rst b/web_dialog_size/readme/CONTRIBUTORS.rst index 0641b1d1e15e..e78168e415bf 100644 --- a/web_dialog_size/readme/CONTRIBUTORS.rst +++ b/web_dialog_size/readme/CONTRIBUTORS.rst @@ -7,5 +7,6 @@ * Quentin Theuret * `Tecnativa `_: - * Pedro M. Baeza - * Jairo Llopis + * Pedro M. Baeza + * Jairo Llopis + * Ernesto Tejeda diff --git a/web_dialog_size/static/description/index.html b/web_dialog_size/static/description/index.html index ce5afa5608e1..b35dab812deb 100644 --- a/web_dialog_size/static/description/index.html +++ b/web_dialog_size/static/description/index.html @@ -3,7 +3,7 @@ - + Web Dialog Size + + +
+

Calendar slot duration

+ + +

Production/Stable License: LGPL-3 OCA/web Translate me on Weblate Try me on Runbot

+

This module extends the functionality of backend calendars to support custom +slot durations and to allow you to provide more specific UX regarding event +duration and snapping.

+

Table of contents

+ +
+

Configuration

+

This documentation is for developers.

+

If you want to configure your calendar viewΓÇÖs snap duration, make sure that you +action includes a context similar to this (example is the default value):

+
+{"calendar_slot_duration": "00:30:00"}
+
+

It can be added in actions defined on python or as ir.actions.act_window +records.

+
+
+

Usage

+

To use this module, you need to install some other addon that uses it, as it +doesnΓÇÖt provide any end-user functionality.

+
+
+

Known issues / Roadmap

+ +
+
+

Bug Tracker

+

Bugs are tracked on GitHub Issues. +In case of trouble, please check there if your issue has already been reported. +If you spotted it first, help us smashing it by providing a detailed and welcomed +feedback.

+

Do not contact contributors directly about support or help with technical issues.

+
+
+

Credits

+
+

Authors

+
    +
  • Tecnativa
  • +
+
+
+

Maintainers

+

This module is maintained by the OCA.

+Odoo Community Association +

OCA, or the Odoo Community Association, is a nonprofit organization whose +mission is to support the collaborative development of Odoo features and +promote its widespread use.

+

Current maintainer:

+

Yajo

+

This module is part of the OCA/web project on GitHub.

+

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

+
+
+
+ + diff --git a/web_calendar_slot_duration/static/src/js/calendar_model.js b/web_calendar_slot_duration/static/src/js/calendar_model.js new file mode 100644 index 000000000000..e4fd434a35db --- /dev/null +++ b/web_calendar_slot_duration/static/src/js/calendar_model.js @@ -0,0 +1,22 @@ +/* Copyright 2021 Tecnativa - Jairo Llopis + * License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl). */ + +odoo.define("web_calendar_slot_duration.CalendarModel", function (require) { + "use strict"; + + var CalendarModel = require("web.CalendarModel"); + + CalendarModel.include({ + /** + * @override + */ + _getFullCalendarOptions: function () { + var result = this._super.call(this, arguments); + result.slotDuration = + this.data.context.calendar_slot_duration || + result.slotDuration || + "00:30:00"; + return result; + }, + }); +}); diff --git a/web_calendar_slot_duration/templates/assets.xml b/web_calendar_slot_duration/templates/assets.xml new file mode 100644 index 000000000000..74b6b5cd8e01 --- /dev/null +++ b/web_calendar_slot_duration/templates/assets.xml @@ -0,0 +1,13 @@ + + + + + + + + From bd408c15ca5bca3ff1f14cc11c67b08c9fac3125 Mon Sep 17 00:00:00 2001 From: Holger Brunn Date: Wed, 18 Mar 2015 10:26:00 +0100 Subject: [PATCH 060/454] [IMP] better readme, manifest --- web_ir_actions_act_window_message/README.rst | 6 ++---- web_ir_actions_act_window_message/__openerp__.py | 2 +- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/web_ir_actions_act_window_message/README.rst b/web_ir_actions_act_window_message/README.rst index 58cf35af9687..c689471253c6 100644 --- a/web_ir_actions_act_window_message/README.rst +++ b/web_ir_actions_act_window_message/README.rst @@ -12,14 +12,12 @@ Depend on this module and return { 'type': 'ir.actions.act_window.message', - 'title': 'My title', - 'message': 'My message' + 'title': _('My title'), + 'message': _('My message'), } You are responsible for translating the messages. -* https://www.odoo.com/forum/help-1 - Known issues / Roadmap ====================== diff --git a/web_ir_actions_act_window_message/__openerp__.py b/web_ir_actions_act_window_message/__openerp__.py index 98f67900f32f..7cd5baaed44f 100644 --- a/web_ir_actions_act_window_message/__openerp__.py +++ b/web_ir_actions_act_window_message/__openerp__.py @@ -24,7 +24,7 @@ "author": "Therp BV", "license": "AGPL-3", "category": "Hidden/Dependency", - "summary": "Show a warning to users", + "summary": "Show a message box to users", "depends": [ 'web', ], From 18fef2e9dae6d0c0143fc1fa5f43320bdeba0159 Mon Sep 17 00:00:00 2001 From: Yannick Vaucher Date: Fri, 22 May 2015 19:45:36 +0200 Subject: [PATCH 061/454] Add bug tracker link on README.rst --- web_ir_actions_act_window_message/README.rst | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/web_ir_actions_act_window_message/README.rst b/web_ir_actions_act_window_message/README.rst index c689471253c6..f330f0bfda1b 100644 --- a/web_ir_actions_act_window_message/README.rst +++ b/web_ir_actions_act_window_message/README.rst @@ -26,6 +26,16 @@ Known issues / Roadmap * have `button_title` to set the button title * have `buttons` containing button names and action definitions for triggering actions from the message box + +Bug Tracker +=========== + +Bugs are tracked on `GitHub Issues `_. +In case of trouble, please check there if your issue has already been reported. +If you spotted it first, help us smashing it by providing a detailed and welcomed feedback +`here `_. + + Credits ======= From 239cabfcda8150645019a0863b95200860da5c17 Mon Sep 17 00:00:00 2001 From: Markus Schneider Date: Thu, 4 Jun 2015 14:30:25 +0200 Subject: [PATCH 062/454] add OCA to author --- web_ir_actions_act_window_message/__openerp__.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/web_ir_actions_act_window_message/__openerp__.py b/web_ir_actions_act_window_message/__openerp__.py index 7cd5baaed44f..1cc57df0d732 100644 --- a/web_ir_actions_act_window_message/__openerp__.py +++ b/web_ir_actions_act_window_message/__openerp__.py @@ -21,7 +21,8 @@ { "name": "Client side message boxes", "version": "1.0", - "author": "Therp BV", + "author": "Therp BV, " + "Odoo Community Association (OCA)", "license": "AGPL-3", "category": "Hidden/Dependency", "summary": "Show a message box to users", From 4a8cd964fc0555e14a05d89856534c0ba3ec6f7d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Bidoul?= Date: Fri, 9 Oct 2015 10:03:39 +0200 Subject: [PATCH 063/454] [UPD] prefix versions with 8.0 --- web_ir_actions_act_window_message/__openerp__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web_ir_actions_act_window_message/__openerp__.py b/web_ir_actions_act_window_message/__openerp__.py index 1cc57df0d732..293f9f4de06b 100644 --- a/web_ir_actions_act_window_message/__openerp__.py +++ b/web_ir_actions_act_window_message/__openerp__.py @@ -20,7 +20,7 @@ ############################################################################## { "name": "Client side message boxes", - "version": "1.0", + "version": "8.0.1.0.0", "author": "Therp BV, " "Odoo Community Association (OCA)", "license": "AGPL-3", From ebe991b64456466efbb67e3c1549740d0b9e44a1 Mon Sep 17 00:00:00 2001 From: "Pedro M. Baeza" Date: Wed, 14 Oct 2015 02:57:05 +0200 Subject: [PATCH 064/454] [MIG] Make modules uninstallable --- web_ir_actions_act_window_message/__openerp__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web_ir_actions_act_window_message/__openerp__.py b/web_ir_actions_act_window_message/__openerp__.py index 293f9f4de06b..7a553c520fe0 100644 --- a/web_ir_actions_act_window_message/__openerp__.py +++ b/web_ir_actions_act_window_message/__openerp__.py @@ -36,7 +36,7 @@ 'static/src/xml/web_ir_actions_act_window_message.xml', ], "auto_install": False, - "installable": True, + 'installable': False, "application": False, "external_dependencies": { 'python': [], From db9a800d3940ca62ab207ace5f66faea88597adb Mon Sep 17 00:00:00 2001 From: "Pedro M. Baeza" Date: Thu, 6 Oct 2016 16:13:01 +0200 Subject: [PATCH 065/454] [MIG] Rename manifest files --- .../{__openerp__.py => __manifest__.py} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename web_ir_actions_act_window_message/{__openerp__.py => __manifest__.py} (100%) diff --git a/web_ir_actions_act_window_message/__openerp__.py b/web_ir_actions_act_window_message/__manifest__.py similarity index 100% rename from web_ir_actions_act_window_message/__openerp__.py rename to web_ir_actions_act_window_message/__manifest__.py From 4147ec24a6bc6eb53997bb44968f73edc2c0a64f Mon Sep 17 00:00:00 2001 From: Holger Brunn Date: Thu, 3 Mar 2016 17:27:19 +0100 Subject: [PATCH 066/454] allow to pass a list of buttons --- web_ir_actions_act_window_message/README.rst | 25 ++++++++- .../js/web_ir_actions_act_window_message.js | 55 ++++++++++++++++++- 2 files changed, 77 insertions(+), 3 deletions(-) diff --git a/web_ir_actions_act_window_message/README.rst b/web_ir_actions_act_window_message/README.rst index f330f0bfda1b..8341746d54f6 100644 --- a/web_ir_actions_act_window_message/README.rst +++ b/web_ir_actions_act_window_message/README.rst @@ -14,6 +14,30 @@ Depend on this module and return 'type': 'ir.actions.act_window.message', 'title': _('My title'), 'message': _('My message'), + # this is an optional list of buttons to show + 'buttons': [ + # a button can be any action (also ir.actions.report.xml et al) + { + 'type': 'ir.actions.act_window', + 'name': 'All customers', + 'res_model': 'res.partner', + 'view_mode': 'form', + 'views': [[False, 'list'], [False, 'form']], + 'domain': [('customer', '=', True)], + }, + # or if type == method, you need to pass a model, a method name and + # parameters + { + 'type': 'method', + 'name': _('Yes, do it'), + 'model': self._name, + 'method': 'myfunction', + # list of arguments to pass positionally + 'args': [self.ids], + # dictionary of keyword arguments + 'kwargs': {'force': True}, + } + ] } You are responsible for translating the messages. @@ -24,7 +48,6 @@ Known issues / Roadmap * add `message_type` to differenciate between warnings, errors, etc. * have one `message_type` to show a nonmodal warning on top right * have `button_title` to set the button title -* have `buttons` containing button names and action definitions for triggering actions from the message box Bug Tracker diff --git a/web_ir_actions_act_window_message/static/src/js/web_ir_actions_act_window_message.js b/web_ir_actions_act_window_message/static/src/js/web_ir_actions_act_window_message.js index bfc6f55da62a..95f3b26d4db1 100644 --- a/web_ir_actions_act_window_message/static/src/js/web_ir_actions_act_window_message.js +++ b/web_ir_actions_act_window_message/static/src/js/web_ir_actions_act_window_message.js @@ -24,7 +24,8 @@ openerp.web_ir_actions_act_window_message = function(instance) instance.web.ActionManager.include({ ir_actions_act_window_message: function(action, options) { - var dialog = new instance.web.Dialog( + var self = this, + dialog = new instance.web.Dialog( this, { size: 'medium', @@ -35,7 +36,10 @@ openerp.web_ir_actions_act_window_message = function(instance) click: function() { dialog.close() }, oe_link_class: 'oe_highlight', }, - ], + ].concat( + this.ir_actions_act_window_message_get_buttons( + action, function() { dialog.close() }) + ), }, jQuery(instance.web.qweb.render( 'web_ir_actions_act_window_message', @@ -46,5 +50,52 @@ openerp.web_ir_actions_act_window_message = function(instance) ) return dialog.open(); }, + ir_actions_act_window_message_get_buttons: function(action, close_func) + { + // return an array of button definitions from action + var self = this; + return _.map(action.buttons || [], function(button_definition) + { + return { + text: button_definition.name || 'No name set', + oe_link_class: button_definition.oe_link_class || + 'oe_highlight', + click: function() { + if(button_definition.type == 'method') + { + (new instance.web.Model(button_definition.model)) + .call( + button_definition.method, + button_definition.args, + button_definition.kwargs + ).then(function(result) + { + if(_.isObject(result)) + { + self.do_action(result); + } + else + { + if( + self.inner_widget && + self.inner_widget.views + ) + { + self.inner_widget + .views[self.inner_widget.active_view] + .controller.recursive_reload(); + } + } + }); + } + else + { + self.do_action(button_definition); + } + close_func(); + }, + } + }); + }, }); } From 1f100dd5f3dcd47035e57a96f2ac9961aa454cd0 Mon Sep 17 00:00:00 2001 From: Holger Brunn Date: Thu, 3 Mar 2016 17:38:57 +0100 Subject: [PATCH 067/454] implement close_button_title --- web_ir_actions_act_window_message/README.rst | 6 ++++- .../js/web_ir_actions_act_window_message.js | 22 ++++++++++++------- 2 files changed, 19 insertions(+), 9 deletions(-) diff --git a/web_ir_actions_act_window_message/README.rst b/web_ir_actions_act_window_message/README.rst index 8341746d54f6..cc368bed834b 100644 --- a/web_ir_actions_act_window_message/README.rst +++ b/web_ir_actions_act_window_message/README.rst @@ -14,6 +14,11 @@ Depend on this module and return 'type': 'ir.actions.act_window.message', 'title': _('My title'), 'message': _('My message'), + # optional title of the close button, if not set, will be _('Close') + # if set False, no close button will be shown + # you can create your own close button with an action of type + # ir.actions.act_window_close + 'close_button_title': 'Make this window go away', # this is an optional list of buttons to show 'buttons': [ # a button can be any action (also ir.actions.report.xml et al) @@ -47,7 +52,6 @@ Known issues / Roadmap * add `message_type` to differenciate between warnings, errors, etc. * have one `message_type` to show a nonmodal warning on top right -* have `button_title` to set the button title Bug Tracker diff --git a/web_ir_actions_act_window_message/static/src/js/web_ir_actions_act_window_message.js b/web_ir_actions_act_window_message/static/src/js/web_ir_actions_act_window_message.js index 95f3b26d4db1..227cd67109a8 100644 --- a/web_ir_actions_act_window_message/static/src/js/web_ir_actions_act_window_message.js +++ b/web_ir_actions_act_window_message/static/src/js/web_ir_actions_act_window_message.js @@ -25,18 +25,24 @@ openerp.web_ir_actions_act_window_message = function(instance) ir_actions_act_window_message: function(action, options) { var self = this, - dialog = new instance.web.Dialog( + buttons = []; + + if(action.close_button_title !== false) + { + buttons.push({ + text: action.close_button_title || + instance.web._t('Close'), + click: function() { dialog.close() }, + oe_link_class: 'oe_highlight', + }) + } + + var dialog = new instance.web.Dialog( this, { size: 'medium', title: action.title, - buttons: [ - { - text: instance.web._t('Close'), - click: function() { dialog.close() }, - oe_link_class: 'oe_highlight', - }, - ].concat( + buttons: buttons.concat( this.ir_actions_act_window_message_get_buttons( action, function() { dialog.close() }) ), From 81b3e6a1802af794f7f6bbe72a3f3dad6f0bb5e9 Mon Sep 17 00:00:00 2001 From: OCA Transbot Date: Mon, 23 Nov 2015 23:43:23 -0500 Subject: [PATCH 068/454] OCA Transbot updated translations from Transifex --- web_ir_actions_act_window_message/i18n/ar.po | 25 ++++++++++++++++++ web_ir_actions_act_window_message/i18n/de.po | 26 +++++++++++++++++++ web_ir_actions_act_window_message/i18n/es.po | 26 +++++++++++++++++++ web_ir_actions_act_window_message/i18n/eu.po | 25 ++++++++++++++++++ web_ir_actions_act_window_message/i18n/fi.po | 25 ++++++++++++++++++ web_ir_actions_act_window_message/i18n/fr.po | 25 ++++++++++++++++++ web_ir_actions_act_window_message/i18n/hr.po | 25 ++++++++++++++++++ web_ir_actions_act_window_message/i18n/it.po | 25 ++++++++++++++++++ web_ir_actions_act_window_message/i18n/nl.po | 25 ++++++++++++++++++ .../i18n/pt_BR.po | 25 ++++++++++++++++++ web_ir_actions_act_window_message/i18n/sl.po | 25 ++++++++++++++++++ web_ir_actions_act_window_message/i18n/tr.po | 25 ++++++++++++++++++ 12 files changed, 302 insertions(+) create mode 100644 web_ir_actions_act_window_message/i18n/ar.po create mode 100644 web_ir_actions_act_window_message/i18n/de.po create mode 100644 web_ir_actions_act_window_message/i18n/es.po create mode 100644 web_ir_actions_act_window_message/i18n/eu.po create mode 100644 web_ir_actions_act_window_message/i18n/fi.po create mode 100644 web_ir_actions_act_window_message/i18n/fr.po create mode 100644 web_ir_actions_act_window_message/i18n/hr.po create mode 100644 web_ir_actions_act_window_message/i18n/it.po create mode 100644 web_ir_actions_act_window_message/i18n/nl.po create mode 100644 web_ir_actions_act_window_message/i18n/pt_BR.po create mode 100644 web_ir_actions_act_window_message/i18n/sl.po create mode 100644 web_ir_actions_act_window_message/i18n/tr.po diff --git a/web_ir_actions_act_window_message/i18n/ar.po b/web_ir_actions_act_window_message/i18n/ar.po new file mode 100644 index 000000000000..c2bc8c41de96 --- /dev/null +++ b/web_ir_actions_act_window_message/i18n/ar.po @@ -0,0 +1,25 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * web_ir_actions_act_window_message +# +# Translators: +msgid "" +msgstr "" +"Project-Id-Version: web (8.0)\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2015-12-16 07:41+0000\n" +"PO-Revision-Date: 2015-11-07 11:20+0000\n" +"Last-Translator: <>\n" +"Language-Team: Arabic (http://www.transifex.com/oca/OCA-web-8-0/language/ar/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: ar\n" +"Plural-Forms: nplurals=6; plural=n==0 ? 0 : n==1 ? 1 : n==2 ? 2 : n%100>=3 && n%100<=10 ? 3 : n%100>=11 && n%100<=99 ? 4 : 5;\n" + +#. module: web_ir_actions_act_window_message +#. openerp-web +#: code:addons/web_ir_actions_act_window_message/static/src/js/web_ir_actions_act_window_message.js:34 +#, python-format +msgid "Close" +msgstr "إغلاق" diff --git a/web_ir_actions_act_window_message/i18n/de.po b/web_ir_actions_act_window_message/i18n/de.po new file mode 100644 index 000000000000..1a53b6648dc2 --- /dev/null +++ b/web_ir_actions_act_window_message/i18n/de.po @@ -0,0 +1,26 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * web_ir_actions_act_window_message +# +# Translators: +# Rudolf Schnapka , 2016 +msgid "" +msgstr "" +"Project-Id-Version: web (8.0)\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2016-01-10 07:31+0000\n" +"PO-Revision-Date: 2016-01-18 20:15+0000\n" +"Last-Translator: Rudolf Schnapka \n" +"Language-Team: German (http://www.transifex.com/oca/OCA-web-8-0/language/de/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: de\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#. module: web_ir_actions_act_window_message +#. openerp-web +#: code:addons/web_ir_actions_act_window_message/static/src/js/web_ir_actions_act_window_message.js:34 +#, python-format +msgid "Close" +msgstr "Schließen" diff --git a/web_ir_actions_act_window_message/i18n/es.po b/web_ir_actions_act_window_message/i18n/es.po new file mode 100644 index 000000000000..3b8d60e185cf --- /dev/null +++ b/web_ir_actions_act_window_message/i18n/es.po @@ -0,0 +1,26 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * web_ir_actions_act_window_message +# +# Translators: +# Antonio Trueba, 2016 +msgid "" +msgstr "" +"Project-Id-Version: web (8.0)\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2016-01-10 07:31+0000\n" +"PO-Revision-Date: 2016-02-10 16:40+0000\n" +"Last-Translator: Antonio Trueba\n" +"Language-Team: Spanish (http://www.transifex.com/oca/OCA-web-8-0/language/es/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: es\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#. module: web_ir_actions_act_window_message +#. openerp-web +#: code:addons/web_ir_actions_act_window_message/static/src/js/web_ir_actions_act_window_message.js:34 +#, python-format +msgid "Close" +msgstr "Cerrar" diff --git a/web_ir_actions_act_window_message/i18n/eu.po b/web_ir_actions_act_window_message/i18n/eu.po new file mode 100644 index 000000000000..5ff5a28f4b80 --- /dev/null +++ b/web_ir_actions_act_window_message/i18n/eu.po @@ -0,0 +1,25 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * web_ir_actions_act_window_message +# +# Translators: +msgid "" +msgstr "" +"Project-Id-Version: web (8.0)\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-02-18 09:01+0000\n" +"PO-Revision-Date: 2015-11-07 11:20+0000\n" +"Last-Translator: <>\n" +"Language-Team: Basque (http://www.transifex.com/oca/OCA-web-8-0/language/eu/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: eu\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#. module: web_ir_actions_act_window_message +#. openerp-web +#: code:addons/web_ir_actions_act_window_message/static/src/js/web_ir_actions_act_window_message.js:34 +#, python-format +msgid "Close" +msgstr "Itxi" diff --git a/web_ir_actions_act_window_message/i18n/fi.po b/web_ir_actions_act_window_message/i18n/fi.po new file mode 100644 index 000000000000..30cc25fc6856 --- /dev/null +++ b/web_ir_actions_act_window_message/i18n/fi.po @@ -0,0 +1,25 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * web_ir_actions_act_window_message +# +# Translators: +msgid "" +msgstr "" +"Project-Id-Version: web (8.0)\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2016-01-10 07:31+0000\n" +"PO-Revision-Date: 2015-11-07 11:20+0000\n" +"Last-Translator: <>\n" +"Language-Team: Finnish (http://www.transifex.com/oca/OCA-web-8-0/language/fi/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: fi\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#. module: web_ir_actions_act_window_message +#. openerp-web +#: code:addons/web_ir_actions_act_window_message/static/src/js/web_ir_actions_act_window_message.js:34 +#, python-format +msgid "Close" +msgstr "Sulje" diff --git a/web_ir_actions_act_window_message/i18n/fr.po b/web_ir_actions_act_window_message/i18n/fr.po new file mode 100644 index 000000000000..92af8cf48c12 --- /dev/null +++ b/web_ir_actions_act_window_message/i18n/fr.po @@ -0,0 +1,25 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * web_ir_actions_act_window_message +# +# Translators: +msgid "" +msgstr "" +"Project-Id-Version: web (8.0)\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2015-11-23 13:46+0000\n" +"PO-Revision-Date: 2015-11-07 11:20+0000\n" +"Last-Translator: <>\n" +"Language-Team: French (http://www.transifex.com/oca/OCA-web-8-0/language/fr/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: fr\n" +"Plural-Forms: nplurals=2; plural=(n > 1);\n" + +#. module: web_ir_actions_act_window_message +#. openerp-web +#: code:addons/web_ir_actions_act_window_message/static/src/js/web_ir_actions_act_window_message.js:34 +#, python-format +msgid "Close" +msgstr "Fermer" diff --git a/web_ir_actions_act_window_message/i18n/hr.po b/web_ir_actions_act_window_message/i18n/hr.po new file mode 100644 index 000000000000..6fdf3b7eb407 --- /dev/null +++ b/web_ir_actions_act_window_message/i18n/hr.po @@ -0,0 +1,25 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * web_ir_actions_act_window_message +# +# Translators: +msgid "" +msgstr "" +"Project-Id-Version: web (8.0)\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2016-06-24 00:46+0000\n" +"PO-Revision-Date: 2015-11-07 11:20+0000\n" +"Last-Translator: <>\n" +"Language-Team: Croatian (http://www.transifex.com/oca/OCA-web-8-0/language/hr/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: hr\n" +"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n" + +#. module: web_ir_actions_act_window_message +#. openerp-web +#: code:addons/web_ir_actions_act_window_message/static/src/js/web_ir_actions_act_window_message.js:34 +#, python-format +msgid "Close" +msgstr "Zatvori" diff --git a/web_ir_actions_act_window_message/i18n/it.po b/web_ir_actions_act_window_message/i18n/it.po new file mode 100644 index 000000000000..108201e809ba --- /dev/null +++ b/web_ir_actions_act_window_message/i18n/it.po @@ -0,0 +1,25 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * web_ir_actions_act_window_message +# +# Translators: +msgid "" +msgstr "" +"Project-Id-Version: web (8.0)\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2016-03-17 07:29+0000\n" +"PO-Revision-Date: 2015-11-07 11:20+0000\n" +"Last-Translator: <>\n" +"Language-Team: Italian (http://www.transifex.com/oca/OCA-web-8-0/language/it/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: it\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#. module: web_ir_actions_act_window_message +#. openerp-web +#: code:addons/web_ir_actions_act_window_message/static/src/js/web_ir_actions_act_window_message.js:34 +#, python-format +msgid "Close" +msgstr "Chiudi" diff --git a/web_ir_actions_act_window_message/i18n/nl.po b/web_ir_actions_act_window_message/i18n/nl.po new file mode 100644 index 000000000000..67049ccfe75d --- /dev/null +++ b/web_ir_actions_act_window_message/i18n/nl.po @@ -0,0 +1,25 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * web_ir_actions_act_window_message +# +# Translators: +msgid "" +msgstr "" +"Project-Id-Version: web (8.0)\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-01-21 08:52+0000\n" +"PO-Revision-Date: 2015-11-07 11:20+0000\n" +"Last-Translator: <>\n" +"Language-Team: Dutch (http://www.transifex.com/oca/OCA-web-8-0/language/nl/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: nl\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#. module: web_ir_actions_act_window_message +#. openerp-web +#: code:addons/web_ir_actions_act_window_message/static/src/js/web_ir_actions_act_window_message.js:34 +#, python-format +msgid "Close" +msgstr "Sluiten" diff --git a/web_ir_actions_act_window_message/i18n/pt_BR.po b/web_ir_actions_act_window_message/i18n/pt_BR.po new file mode 100644 index 000000000000..dd6d8167ea9f --- /dev/null +++ b/web_ir_actions_act_window_message/i18n/pt_BR.po @@ -0,0 +1,25 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * web_ir_actions_act_window_message +# +# Translators: +msgid "" +msgstr "" +"Project-Id-Version: web (8.0)\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2016-03-11 02:17+0000\n" +"PO-Revision-Date: 2016-03-05 16:20+0000\n" +"Last-Translator: danimaribeiro \n" +"Language-Team: Portuguese (Brazil) (http://www.transifex.com/oca/OCA-web-8-0/language/pt_BR/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: pt_BR\n" +"Plural-Forms: nplurals=2; plural=(n > 1);\n" + +#. module: web_ir_actions_act_window_message +#. openerp-web +#: code:addons/web_ir_actions_act_window_message/static/src/js/web_ir_actions_act_window_message.js:34 +#, python-format +msgid "Close" +msgstr "Fechar" diff --git a/web_ir_actions_act_window_message/i18n/sl.po b/web_ir_actions_act_window_message/i18n/sl.po new file mode 100644 index 000000000000..63ddbc003dd7 --- /dev/null +++ b/web_ir_actions_act_window_message/i18n/sl.po @@ -0,0 +1,25 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * web_ir_actions_act_window_message +# +# Translators: +msgid "" +msgstr "" +"Project-Id-Version: web (8.0)\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2015-11-23 13:46+0000\n" +"PO-Revision-Date: 2015-11-08 05:45+0000\n" +"Last-Translator: Matjaž Mozetič \n" +"Language-Team: Slovenian (http://www.transifex.com/oca/OCA-web-8-0/language/sl/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: sl\n" +"Plural-Forms: nplurals=4; plural=(n%100==1 ? 0 : n%100==2 ? 1 : n%100==3 || n%100==4 ? 2 : 3);\n" + +#. module: web_ir_actions_act_window_message +#. openerp-web +#: code:addons/web_ir_actions_act_window_message/static/src/js/web_ir_actions_act_window_message.js:34 +#, python-format +msgid "Close" +msgstr "Zaključi" diff --git a/web_ir_actions_act_window_message/i18n/tr.po b/web_ir_actions_act_window_message/i18n/tr.po new file mode 100644 index 000000000000..7d4493a4fe83 --- /dev/null +++ b/web_ir_actions_act_window_message/i18n/tr.po @@ -0,0 +1,25 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * web_ir_actions_act_window_message +# +# Translators: +msgid "" +msgstr "" +"Project-Id-Version: web (8.0)\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2016-01-08 21:34+0000\n" +"PO-Revision-Date: 2015-12-30 22:16+0000\n" +"Last-Translator: Ahmet Altınışık \n" +"Language-Team: Turkish (http://www.transifex.com/oca/OCA-web-8-0/language/tr/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: tr\n" +"Plural-Forms: nplurals=2; plural=(n > 1);\n" + +#. module: web_ir_actions_act_window_message +#. openerp-web +#: code:addons/web_ir_actions_act_window_message/static/src/js/web_ir_actions_act_window_message.js:34 +#, python-format +msgid "Close" +msgstr "Kapat" From f124c0681eee4870b91b2f1941f286aa436926f6 Mon Sep 17 00:00:00 2001 From: Zakaria Makrelouf Date: Tue, 25 Apr 2017 13:15:01 +0100 Subject: [PATCH 069/454] web_ir_actions_act_window_message: Migration to V9 * Update the module version to 9.0. * Align file header to the OCA Guidelines. * Migrate Javascript file to the V9 API. * Refresh the view before closing the dialog when clicking on close button --- web_ir_actions_act_window_message/README.rst | 1 + web_ir_actions_act_window_message/__init__.py | 20 ----- .../__manifest__.py | 30 +------ .../js/web_ir_actions_act_window_message.js | 82 ++++++++----------- .../views/templates.xml | 23 +++--- 5 files changed, 54 insertions(+), 102 deletions(-) diff --git a/web_ir_actions_act_window_message/README.rst b/web_ir_actions_act_window_message/README.rst index cc368bed834b..e991265c9d72 100644 --- a/web_ir_actions_act_window_message/README.rst +++ b/web_ir_actions_act_window_message/README.rst @@ -70,6 +70,7 @@ Contributors ------------ * Holger Brunn +* Zakaria Makrelouf (ACSONE SA/NV) Maintainer ---------- diff --git a/web_ir_actions_act_window_message/__init__.py b/web_ir_actions_act_window_message/__init__.py index faef9dac007f..e69de29bb2d1 100644 --- a/web_ir_actions_act_window_message/__init__.py +++ b/web_ir_actions_act_window_message/__init__.py @@ -1,20 +0,0 @@ -# -*- coding: utf-8 -*- -############################################################################## -# -# OpenERP, Open Source Management Solution -# This module copyright (C) 2015 Therp BV . -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as -# published by the Free Software Foundation, either version 3 of the -# License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . -# -############################################################################## diff --git a/web_ir_actions_act_window_message/__manifest__.py b/web_ir_actions_act_window_message/__manifest__.py index 7a553c520fe0..9a8bdcc1d2d5 100644 --- a/web_ir_actions_act_window_message/__manifest__.py +++ b/web_ir_actions_act_window_message/__manifest__.py @@ -1,27 +1,11 @@ # -*- coding: utf-8 -*- -############################################################################## -# -# OpenERP, Open Source Management Solution -# This module copyright (C) 2015 Therp BV . -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as -# published by the Free Software Foundation, either version 3 of the -# License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . -# -############################################################################## +# Copyright 2017 Therp BV, ACSONE SA/NV +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). { "name": "Client side message boxes", - "version": "8.0.1.0.0", + "version": "9.0.1.0.0", "author": "Therp BV, " + "ACSONE SA/NV, " "Odoo Community Association (OCA)", "license": "AGPL-3", "category": "Hidden/Dependency", @@ -35,10 +19,4 @@ "qweb": [ 'static/src/xml/web_ir_actions_act_window_message.xml', ], - "auto_install": False, - 'installable': False, - "application": False, - "external_dependencies": { - 'python': [], - }, } diff --git a/web_ir_actions_act_window_message/static/src/js/web_ir_actions_act_window_message.js b/web_ir_actions_act_window_message/static/src/js/web_ir_actions_act_window_message.js index 227cd67109a8..006ac8df30db 100644 --- a/web_ir_actions_act_window_message/static/src/js/web_ir_actions_act_window_message.js +++ b/web_ir_actions_act_window_message/static/src/js/web_ir_actions_act_window_message.js @@ -1,59 +1,51 @@ -//-*- coding: utf-8 -*- -//############################################################################ -// -// OpenERP, Open Source Management Solution -// This module copyright (C) 2015 Therp BV . -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU Affero General Public License as -// published by the Free Software Foundation, either version 3 of the -// License, or (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Affero General Public License for more details. -// -// You should have received a copy of the GNU Affero General Public License -// along with this program. If not, see . -// -//############################################################################ +/* Copyright 2017 Therp BV, ACSONE SA/NV + * * License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). */ + +odoo.define('web.web_ir_actions_act_window_message', function (require) { + "use strict"; + + var ActionManager = require('web.ActionManager'), + core = require('web.core'), + _ = require('_'), + Model = require('web.Model'), + Dialog = require('web.Dialog'); + + var _t = core._t; + + ActionManager.include({ + ir_actions_act_window_message: function(action, options){ -openerp.web_ir_actions_act_window_message = function(instance) -{ - instance.web.ActionManager.include({ - ir_actions_act_window_message: function(action, options) - { var self = this, buttons = []; if(action.close_button_title !== false) { buttons.push({ - text: action.close_button_title || - instance.web._t('Close'), - click: function() { dialog.close() }, + text: action.close_button_title || _t('Close'), + click: function() { + // refresh the view before closing the dialog + self.inner_widget.active_view + .controller.recursive_reload(); + dialog.close() + }, oe_link_class: 'oe_highlight', }) } - var dialog = new instance.web.Dialog( + var dialog = new Dialog( this, - { + _.extend({ size: 'medium', title: action.title, + $content: $('
', { + text: action.message, + }), buttons: buttons.concat( this.ir_actions_act_window_message_get_buttons( action, function() { dialog.close() }) ), - }, - jQuery(instance.web.qweb.render( - 'web_ir_actions_act_window_message', - { - 'this': this, - 'action': action, - })) - ) + }, options) + ); return dialog.open(); }, ir_actions_act_window_message_get_buttons: function(action, close_func) @@ -67,9 +59,8 @@ openerp.web_ir_actions_act_window_message = function(instance) oe_link_class: button_definition.oe_link_class || 'oe_highlight', click: function() { - if(button_definition.type == 'method') - { - (new instance.web.Model(button_definition.model)) + if(button_definition.type == 'method'){ + (new Model(button_definition.model)) .call( button_definition.method, button_definition.args, @@ -94,14 +85,13 @@ openerp.web_ir_actions_act_window_message = function(instance) } }); } - else - { + else{ self.do_action(button_definition); } close_func(); - }, + } } }); - }, + } }); -} +}); diff --git a/web_ir_actions_act_window_message/views/templates.xml b/web_ir_actions_act_window_message/views/templates.xml index 9ba42b0b2a76..44b1c287ea97 100644 --- a/web_ir_actions_act_window_message/views/templates.xml +++ b/web_ir_actions_act_window_message/views/templates.xml @@ -1,10 +1,13 @@ - - - - - - + + + + + + + + \ No newline at end of file From 459d4755bf7cadbdaf6c319605927b93aeb6797a Mon Sep 17 00:00:00 2001 From: Zakaria Makrelouf Date: Sun, 7 May 2017 10:16:19 +0100 Subject: [PATCH 070/454] web_ir_actions_act_window_message: always refresh view after action --- .../src/js/web_ir_actions_act_window_message.js | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/web_ir_actions_act_window_message/static/src/js/web_ir_actions_act_window_message.js b/web_ir_actions_act_window_message/static/src/js/web_ir_actions_act_window_message.js index 006ac8df30db..6a71ace1df31 100644 --- a/web_ir_actions_act_window_message/static/src/js/web_ir_actions_act_window_message.js +++ b/web_ir_actions_act_window_message/static/src/js/web_ir_actions_act_window_message.js @@ -71,18 +71,10 @@ odoo.define('web.web_ir_actions_act_window_message', function (require) { { self.do_action(result); } - else - { - if( - self.inner_widget && - self.inner_widget.views - ) - { - self.inner_widget - .views[self.inner_widget.active_view] - .controller.recursive_reload(); - } - } + // always refresh the view after the action + // ex: action updates a status + self.inner_widget.active_view + .controller.recursive_reload(); }); } else{ From 9d61b945030094b2fdfc351d92e4944e7fdd3fb1 Mon Sep 17 00:00:00 2001 From: Zakaria Makrelouf Date: Tue, 16 May 2017 08:56:39 +0100 Subject: [PATCH 071/454] Reformat the code to have coherent coding style --- .../js/web_ir_actions_act_window_message.js | 45 +++++++++++-------- 1 file changed, 26 insertions(+), 19 deletions(-) diff --git a/web_ir_actions_act_window_message/static/src/js/web_ir_actions_act_window_message.js b/web_ir_actions_act_window_message/static/src/js/web_ir_actions_act_window_message.js index 6a71ace1df31..fbc620a091c9 100644 --- a/web_ir_actions_act_window_message/static/src/js/web_ir_actions_act_window_message.js +++ b/web_ir_actions_act_window_message/static/src/js/web_ir_actions_act_window_message.js @@ -1,7 +1,8 @@ /* Copyright 2017 Therp BV, ACSONE SA/NV * * License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). */ -odoo.define('web.web_ir_actions_act_window_message', function (require) { +odoo.define('web.web_ir_actions_act_window_message', function(require) +{ "use strict"; var ActionManager = require('web.ActionManager'), @@ -13,8 +14,8 @@ odoo.define('web.web_ir_actions_act_window_message', function (require) { var _t = core._t; ActionManager.include({ - ir_actions_act_window_message: function(action, options){ - + ir_actions_act_window_message: function(action, options) + { var self = this, buttons = []; @@ -34,18 +35,22 @@ odoo.define('web.web_ir_actions_act_window_message', function (require) { var dialog = new Dialog( this, - _.extend({ - size: 'medium', - title: action.title, - $content: $('
', { - text: action.message, - }), - buttons: buttons.concat( - this.ir_actions_act_window_message_get_buttons( - action, function() { dialog.close() }) - ), - }, options) - ); + _.extend( + { + size: 'medium', + title: action.title, + $content: $('
', + { + text: action.message, + } + ), + buttons: buttons.concat( + this.ir_actions_act_window_message_get_buttons( + action, function() { dialog.close() }) + ), + }, + options) + ) return dialog.open(); }, ir_actions_act_window_message_get_buttons: function(action, close_func) @@ -59,7 +64,8 @@ odoo.define('web.web_ir_actions_act_window_message', function (require) { oe_link_class: button_definition.oe_link_class || 'oe_highlight', click: function() { - if(button_definition.type == 'method'){ + if(button_definition.type == 'method') + { (new Model(button_definition.model)) .call( button_definition.method, @@ -77,13 +83,14 @@ odoo.define('web.web_ir_actions_act_window_message', function (require) { .controller.recursive_reload(); }); } - else{ + else + { self.do_action(button_definition); } close_func(); - } + }, } }); - } + }, }); }); From 72d649ac3f6993912f07a4ee816936949e3b6d7f Mon Sep 17 00:00:00 2001 From: Zakaria Makrelouf Date: Tue, 16 May 2017 09:00:16 +0100 Subject: [PATCH 072/454] s/oe_link_class/classes s/oe_highlight/btn-default and add it to readme * In v9.0 odoo uses classes for dialog buttons instead of oe_link_class --- web_ir_actions_act_window_message/README.rst | 2 ++ .../static/src/js/web_ir_actions_act_window_message.js | 5 ++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/web_ir_actions_act_window_message/README.rst b/web_ir_actions_act_window_message/README.rst index e991265c9d72..4a64a92ed4e6 100644 --- a/web_ir_actions_act_window_message/README.rst +++ b/web_ir_actions_act_window_message/README.rst @@ -41,6 +41,8 @@ Depend on this module and return 'args': [self.ids], # dictionary of keyword arguments 'kwargs': {'force': True}, + # button style + 'classes': 'btn-primary', } ] } diff --git a/web_ir_actions_act_window_message/static/src/js/web_ir_actions_act_window_message.js b/web_ir_actions_act_window_message/static/src/js/web_ir_actions_act_window_message.js index fbc620a091c9..d2a838e2fc1c 100644 --- a/web_ir_actions_act_window_message/static/src/js/web_ir_actions_act_window_message.js +++ b/web_ir_actions_act_window_message/static/src/js/web_ir_actions_act_window_message.js @@ -29,7 +29,7 @@ odoo.define('web.web_ir_actions_act_window_message', function(require) .controller.recursive_reload(); dialog.close() }, - oe_link_class: 'oe_highlight', + classes: 'btn-default', }) } @@ -61,8 +61,7 @@ odoo.define('web.web_ir_actions_act_window_message', function(require) { return { text: button_definition.name || 'No name set', - oe_link_class: button_definition.oe_link_class || - 'oe_highlight', + classes: button_definition.classes || 'btn-default', click: function() { if(button_definition.type == 'method') { From f3731a4be8421e9931ee7f2ef9ae521ff80282b2 Mon Sep 17 00:00:00 2001 From: Zakaria Makrelouf Date: Tue, 16 May 2017 09:37:43 +0100 Subject: [PATCH 073/454] wrap line breaks of the action message --- .../static/src/js/web_ir_actions_act_window_message.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/web_ir_actions_act_window_message/static/src/js/web_ir_actions_act_window_message.js b/web_ir_actions_act_window_message/static/src/js/web_ir_actions_act_window_message.js index d2a838e2fc1c..4ea153d4882e 100644 --- a/web_ir_actions_act_window_message/static/src/js/web_ir_actions_act_window_message.js +++ b/web_ir_actions_act_window_message/static/src/js/web_ir_actions_act_window_message.js @@ -42,6 +42,9 @@ odoo.define('web.web_ir_actions_act_window_message', function(require) $content: $('
', { text: action.message, + css: { + 'white-space': 'pre-line', + } } ), buttons: buttons.concat( From 6e4d796be69e466b4c9e36b016fede2fa90518ae Mon Sep 17 00:00:00 2001 From: Benjamin Willig Date: Tue, 23 May 2017 17:25:01 +0200 Subject: [PATCH 074/454] [MIG] web_ir_actions_act_window_message: Migration to 10. Also added HTML handling --- web_ir_actions_act_window_message/README.rst | 5 +++- .../__manifest__.py | 2 +- .../js/web_ir_actions_act_window_message.js | 26 ++++++++++++------- 3 files changed, 22 insertions(+), 11 deletions(-) diff --git a/web_ir_actions_act_window_message/README.rst b/web_ir_actions_act_window_message/README.rst index 4a64a92ed4e6..3772ad3e7bb8 100644 --- a/web_ir_actions_act_window_message/README.rst +++ b/web_ir_actions_act_window_message/README.rst @@ -19,6 +19,8 @@ Depend on this module and return # you can create your own close button with an action of type # ir.actions.act_window_close 'close_button_title': 'Make this window go away', + # Use HTML instead of text + 'is_html_message': True, # this is an optional list of buttons to show 'buttons': [ # a button can be any action (also ir.actions.report.xml et al) @@ -73,6 +75,7 @@ Contributors * Holger Brunn * Zakaria Makrelouf (ACSONE SA/NV) +* Benjamin Willig (ACSONE SA/NV) Maintainer ---------- @@ -85,4 +88,4 @@ This module is maintained by the OCA. OCA, or the Odoo Community Association, is a nonprofit organization whose mission is to support the collaborative development of Odoo features and promote its widespread use. -To contribute to this module, please visit http://odoo-community.org. +To contribute to this module, please visit http://odoo-community.org. \ No newline at end of file diff --git a/web_ir_actions_act_window_message/__manifest__.py b/web_ir_actions_act_window_message/__manifest__.py index 9a8bdcc1d2d5..5dd3b18b13a2 100644 --- a/web_ir_actions_act_window_message/__manifest__.py +++ b/web_ir_actions_act_window_message/__manifest__.py @@ -3,7 +3,7 @@ # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). { "name": "Client side message boxes", - "version": "9.0.1.0.0", + "version": "10.0.1.0.0", "author": "Therp BV, " "ACSONE SA/NV, " "Odoo Community Association (OCA)", diff --git a/web_ir_actions_act_window_message/static/src/js/web_ir_actions_act_window_message.js b/web_ir_actions_act_window_message/static/src/js/web_ir_actions_act_window_message.js index 4ea153d4882e..1b0708d719be 100644 --- a/web_ir_actions_act_window_message/static/src/js/web_ir_actions_act_window_message.js +++ b/web_ir_actions_act_window_message/static/src/js/web_ir_actions_act_window_message.js @@ -7,7 +7,6 @@ odoo.define('web.web_ir_actions_act_window_message', function(require) var ActionManager = require('web.ActionManager'), core = require('web.core'), - _ = require('_'), Model = require('web.Model'), Dialog = require('web.Dialog'); @@ -33,20 +32,29 @@ odoo.define('web.web_ir_actions_act_window_message', function(require) }) } + var is_html = action.is_html_message === true; + var content_properties = {}; + + if (is_html) { + content_properties = { + html: action.message, + }; + } else { + content_properties = { + text: action.message, + css: { + 'white-space': 'pre-line', + } + }; + } + var dialog = new Dialog( this, _.extend( { size: 'medium', title: action.title, - $content: $('
', - { - text: action.message, - css: { - 'white-space': 'pre-line', - } - } - ), + $content: $('
', content_properties), buttons: buttons.concat( this.ir_actions_act_window_message_get_buttons( action, function() { dialog.close() }) From 2ae478a3d80be73ad9eff5d692f285f95687de86 Mon Sep 17 00:00:00 2001 From: OCA Transbot Date: Sat, 3 Jun 2017 12:41:51 +0200 Subject: [PATCH 075/454] OCA Transbot updated translations from Transifex --- web_ir_actions_act_window_message/i18n/ar.po | 13 +++++----- web_ir_actions_act_window_message/i18n/de.po | 14 +++++----- web_ir_actions_act_window_message/i18n/es.po | 14 +++++----- web_ir_actions_act_window_message/i18n/eu.po | 13 +++++----- web_ir_actions_act_window_message/i18n/fi.po | 13 +++++----- web_ir_actions_act_window_message/i18n/fr.po | 13 +++++----- web_ir_actions_act_window_message/i18n/hr.po | 13 +++++----- web_ir_actions_act_window_message/i18n/it.po | 13 +++++----- web_ir_actions_act_window_message/i18n/nl.po | 13 +++++----- .../i18n/nl_NL.po | 26 +++++++++++++++++++ web_ir_actions_act_window_message/i18n/pt.po | 26 +++++++++++++++++++ .../i18n/pt_BR.po | 13 +++++----- web_ir_actions_act_window_message/i18n/ro.po | 26 +++++++++++++++++++ web_ir_actions_act_window_message/i18n/sl.po | 13 +++++----- web_ir_actions_act_window_message/i18n/tr.po | 13 +++++----- 15 files changed, 162 insertions(+), 74 deletions(-) create mode 100644 web_ir_actions_act_window_message/i18n/nl_NL.po create mode 100644 web_ir_actions_act_window_message/i18n/pt.po create mode 100644 web_ir_actions_act_window_message/i18n/ro.po diff --git a/web_ir_actions_act_window_message/i18n/ar.po b/web_ir_actions_act_window_message/i18n/ar.po index c2bc8c41de96..0008b6b6d0db 100644 --- a/web_ir_actions_act_window_message/i18n/ar.po +++ b/web_ir_actions_act_window_message/i18n/ar.po @@ -3,14 +3,15 @@ # * web_ir_actions_act_window_message # # Translators: +# OCA Transbot , 2017 msgid "" msgstr "" -"Project-Id-Version: web (8.0)\n" +"Project-Id-Version: Odoo Server 10.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2015-12-16 07:41+0000\n" -"PO-Revision-Date: 2015-11-07 11:20+0000\n" -"Last-Translator: <>\n" -"Language-Team: Arabic (http://www.transifex.com/oca/OCA-web-8-0/language/ar/)\n" +"POT-Creation-Date: 2017-06-02 09:52+0000\n" +"PO-Revision-Date: 2017-06-02 09:52+0000\n" +"Last-Translator: OCA Transbot , 2017\n" +"Language-Team: Arabic (https://www.transifex.com/oca/teams/23907/ar/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" @@ -19,7 +20,7 @@ msgstr "" #. module: web_ir_actions_act_window_message #. openerp-web -#: code:addons/web_ir_actions_act_window_message/static/src/js/web_ir_actions_act_window_message.js:34 +#: code:addons/web_ir_actions_act_window_message/static/src/js/web_ir_actions_act_window_message.js:24 #, python-format msgid "Close" msgstr "إغلاق" diff --git a/web_ir_actions_act_window_message/i18n/de.po b/web_ir_actions_act_window_message/i18n/de.po index 1a53b6648dc2..b1f6629a0bf1 100644 --- a/web_ir_actions_act_window_message/i18n/de.po +++ b/web_ir_actions_act_window_message/i18n/de.po @@ -3,15 +3,15 @@ # * web_ir_actions_act_window_message # # Translators: -# Rudolf Schnapka , 2016 +# OCA Transbot , 2017 msgid "" msgstr "" -"Project-Id-Version: web (8.0)\n" +"Project-Id-Version: Odoo Server 10.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2016-01-10 07:31+0000\n" -"PO-Revision-Date: 2016-01-18 20:15+0000\n" -"Last-Translator: Rudolf Schnapka \n" -"Language-Team: German (http://www.transifex.com/oca/OCA-web-8-0/language/de/)\n" +"POT-Creation-Date: 2017-06-02 09:52+0000\n" +"PO-Revision-Date: 2017-06-02 09:52+0000\n" +"Last-Translator: OCA Transbot , 2017\n" +"Language-Team: German (https://www.transifex.com/oca/teams/23907/de/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" @@ -20,7 +20,7 @@ msgstr "" #. module: web_ir_actions_act_window_message #. openerp-web -#: code:addons/web_ir_actions_act_window_message/static/src/js/web_ir_actions_act_window_message.js:34 +#: code:addons/web_ir_actions_act_window_message/static/src/js/web_ir_actions_act_window_message.js:24 #, python-format msgid "Close" msgstr "Schließen" diff --git a/web_ir_actions_act_window_message/i18n/es.po b/web_ir_actions_act_window_message/i18n/es.po index 3b8d60e185cf..3b6d628ff3ff 100644 --- a/web_ir_actions_act_window_message/i18n/es.po +++ b/web_ir_actions_act_window_message/i18n/es.po @@ -3,15 +3,15 @@ # * web_ir_actions_act_window_message # # Translators: -# Antonio Trueba, 2016 +# OCA Transbot , 2017 msgid "" msgstr "" -"Project-Id-Version: web (8.0)\n" +"Project-Id-Version: Odoo Server 10.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2016-01-10 07:31+0000\n" -"PO-Revision-Date: 2016-02-10 16:40+0000\n" -"Last-Translator: Antonio Trueba\n" -"Language-Team: Spanish (http://www.transifex.com/oca/OCA-web-8-0/language/es/)\n" +"POT-Creation-Date: 2017-06-02 09:52+0000\n" +"PO-Revision-Date: 2017-06-02 09:52+0000\n" +"Last-Translator: OCA Transbot , 2017\n" +"Language-Team: Spanish (https://www.transifex.com/oca/teams/23907/es/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" @@ -20,7 +20,7 @@ msgstr "" #. module: web_ir_actions_act_window_message #. openerp-web -#: code:addons/web_ir_actions_act_window_message/static/src/js/web_ir_actions_act_window_message.js:34 +#: code:addons/web_ir_actions_act_window_message/static/src/js/web_ir_actions_act_window_message.js:24 #, python-format msgid "Close" msgstr "Cerrar" diff --git a/web_ir_actions_act_window_message/i18n/eu.po b/web_ir_actions_act_window_message/i18n/eu.po index 5ff5a28f4b80..41fb36af5bfc 100644 --- a/web_ir_actions_act_window_message/i18n/eu.po +++ b/web_ir_actions_act_window_message/i18n/eu.po @@ -3,14 +3,15 @@ # * web_ir_actions_act_window_message # # Translators: +# OCA Transbot , 2017 msgid "" msgstr "" -"Project-Id-Version: web (8.0)\n" +"Project-Id-Version: Odoo Server 10.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2017-02-18 09:01+0000\n" -"PO-Revision-Date: 2015-11-07 11:20+0000\n" -"Last-Translator: <>\n" -"Language-Team: Basque (http://www.transifex.com/oca/OCA-web-8-0/language/eu/)\n" +"POT-Creation-Date: 2017-06-02 09:52+0000\n" +"PO-Revision-Date: 2017-06-02 09:52+0000\n" +"Last-Translator: OCA Transbot , 2017\n" +"Language-Team: Basque (https://www.transifex.com/oca/teams/23907/eu/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" @@ -19,7 +20,7 @@ msgstr "" #. module: web_ir_actions_act_window_message #. openerp-web -#: code:addons/web_ir_actions_act_window_message/static/src/js/web_ir_actions_act_window_message.js:34 +#: code:addons/web_ir_actions_act_window_message/static/src/js/web_ir_actions_act_window_message.js:24 #, python-format msgid "Close" msgstr "Itxi" diff --git a/web_ir_actions_act_window_message/i18n/fi.po b/web_ir_actions_act_window_message/i18n/fi.po index 30cc25fc6856..5f8ffd6a3f6c 100644 --- a/web_ir_actions_act_window_message/i18n/fi.po +++ b/web_ir_actions_act_window_message/i18n/fi.po @@ -3,14 +3,15 @@ # * web_ir_actions_act_window_message # # Translators: +# OCA Transbot , 2017 msgid "" msgstr "" -"Project-Id-Version: web (8.0)\n" +"Project-Id-Version: Odoo Server 10.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2016-01-10 07:31+0000\n" -"PO-Revision-Date: 2015-11-07 11:20+0000\n" -"Last-Translator: <>\n" -"Language-Team: Finnish (http://www.transifex.com/oca/OCA-web-8-0/language/fi/)\n" +"POT-Creation-Date: 2017-06-02 09:52+0000\n" +"PO-Revision-Date: 2017-06-02 09:52+0000\n" +"Last-Translator: OCA Transbot , 2017\n" +"Language-Team: Finnish (https://www.transifex.com/oca/teams/23907/fi/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" @@ -19,7 +20,7 @@ msgstr "" #. module: web_ir_actions_act_window_message #. openerp-web -#: code:addons/web_ir_actions_act_window_message/static/src/js/web_ir_actions_act_window_message.js:34 +#: code:addons/web_ir_actions_act_window_message/static/src/js/web_ir_actions_act_window_message.js:24 #, python-format msgid "Close" msgstr "Sulje" diff --git a/web_ir_actions_act_window_message/i18n/fr.po b/web_ir_actions_act_window_message/i18n/fr.po index 92af8cf48c12..458aeb94b485 100644 --- a/web_ir_actions_act_window_message/i18n/fr.po +++ b/web_ir_actions_act_window_message/i18n/fr.po @@ -3,14 +3,15 @@ # * web_ir_actions_act_window_message # # Translators: +# OCA Transbot , 2017 msgid "" msgstr "" -"Project-Id-Version: web (8.0)\n" +"Project-Id-Version: Odoo Server 10.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2015-11-23 13:46+0000\n" -"PO-Revision-Date: 2015-11-07 11:20+0000\n" -"Last-Translator: <>\n" -"Language-Team: French (http://www.transifex.com/oca/OCA-web-8-0/language/fr/)\n" +"POT-Creation-Date: 2017-06-02 09:52+0000\n" +"PO-Revision-Date: 2017-06-02 09:52+0000\n" +"Last-Translator: OCA Transbot , 2017\n" +"Language-Team: French (https://www.transifex.com/oca/teams/23907/fr/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" @@ -19,7 +20,7 @@ msgstr "" #. module: web_ir_actions_act_window_message #. openerp-web -#: code:addons/web_ir_actions_act_window_message/static/src/js/web_ir_actions_act_window_message.js:34 +#: code:addons/web_ir_actions_act_window_message/static/src/js/web_ir_actions_act_window_message.js:24 #, python-format msgid "Close" msgstr "Fermer" diff --git a/web_ir_actions_act_window_message/i18n/hr.po b/web_ir_actions_act_window_message/i18n/hr.po index 6fdf3b7eb407..5ac4e74c235b 100644 --- a/web_ir_actions_act_window_message/i18n/hr.po +++ b/web_ir_actions_act_window_message/i18n/hr.po @@ -3,14 +3,15 @@ # * web_ir_actions_act_window_message # # Translators: +# OCA Transbot , 2017 msgid "" msgstr "" -"Project-Id-Version: web (8.0)\n" +"Project-Id-Version: Odoo Server 10.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2016-06-24 00:46+0000\n" -"PO-Revision-Date: 2015-11-07 11:20+0000\n" -"Last-Translator: <>\n" -"Language-Team: Croatian (http://www.transifex.com/oca/OCA-web-8-0/language/hr/)\n" +"POT-Creation-Date: 2017-06-02 09:52+0000\n" +"PO-Revision-Date: 2017-06-02 09:52+0000\n" +"Last-Translator: OCA Transbot , 2017\n" +"Language-Team: Croatian (https://www.transifex.com/oca/teams/23907/hr/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" @@ -19,7 +20,7 @@ msgstr "" #. module: web_ir_actions_act_window_message #. openerp-web -#: code:addons/web_ir_actions_act_window_message/static/src/js/web_ir_actions_act_window_message.js:34 +#: code:addons/web_ir_actions_act_window_message/static/src/js/web_ir_actions_act_window_message.js:24 #, python-format msgid "Close" msgstr "Zatvori" diff --git a/web_ir_actions_act_window_message/i18n/it.po b/web_ir_actions_act_window_message/i18n/it.po index 108201e809ba..7baa87e59567 100644 --- a/web_ir_actions_act_window_message/i18n/it.po +++ b/web_ir_actions_act_window_message/i18n/it.po @@ -3,14 +3,15 @@ # * web_ir_actions_act_window_message # # Translators: +# OCA Transbot , 2017 msgid "" msgstr "" -"Project-Id-Version: web (8.0)\n" +"Project-Id-Version: Odoo Server 10.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2016-03-17 07:29+0000\n" -"PO-Revision-Date: 2015-11-07 11:20+0000\n" -"Last-Translator: <>\n" -"Language-Team: Italian (http://www.transifex.com/oca/OCA-web-8-0/language/it/)\n" +"POT-Creation-Date: 2017-06-02 09:52+0000\n" +"PO-Revision-Date: 2017-06-02 09:52+0000\n" +"Last-Translator: OCA Transbot , 2017\n" +"Language-Team: Italian (https://www.transifex.com/oca/teams/23907/it/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" @@ -19,7 +20,7 @@ msgstr "" #. module: web_ir_actions_act_window_message #. openerp-web -#: code:addons/web_ir_actions_act_window_message/static/src/js/web_ir_actions_act_window_message.js:34 +#: code:addons/web_ir_actions_act_window_message/static/src/js/web_ir_actions_act_window_message.js:24 #, python-format msgid "Close" msgstr "Chiudi" diff --git a/web_ir_actions_act_window_message/i18n/nl.po b/web_ir_actions_act_window_message/i18n/nl.po index 67049ccfe75d..a6a02243de06 100644 --- a/web_ir_actions_act_window_message/i18n/nl.po +++ b/web_ir_actions_act_window_message/i18n/nl.po @@ -3,14 +3,15 @@ # * web_ir_actions_act_window_message # # Translators: +# OCA Transbot , 2017 msgid "" msgstr "" -"Project-Id-Version: web (8.0)\n" +"Project-Id-Version: Odoo Server 10.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2017-01-21 08:52+0000\n" -"PO-Revision-Date: 2015-11-07 11:20+0000\n" -"Last-Translator: <>\n" -"Language-Team: Dutch (http://www.transifex.com/oca/OCA-web-8-0/language/nl/)\n" +"POT-Creation-Date: 2017-06-02 09:52+0000\n" +"PO-Revision-Date: 2017-06-02 09:52+0000\n" +"Last-Translator: OCA Transbot , 2017\n" +"Language-Team: Dutch (https://www.transifex.com/oca/teams/23907/nl/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" @@ -19,7 +20,7 @@ msgstr "" #. module: web_ir_actions_act_window_message #. openerp-web -#: code:addons/web_ir_actions_act_window_message/static/src/js/web_ir_actions_act_window_message.js:34 +#: code:addons/web_ir_actions_act_window_message/static/src/js/web_ir_actions_act_window_message.js:24 #, python-format msgid "Close" msgstr "Sluiten" diff --git a/web_ir_actions_act_window_message/i18n/nl_NL.po b/web_ir_actions_act_window_message/i18n/nl_NL.po new file mode 100644 index 000000000000..c6bd95c79b31 --- /dev/null +++ b/web_ir_actions_act_window_message/i18n/nl_NL.po @@ -0,0 +1,26 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * web_ir_actions_act_window_message +# +# Translators: +# Peter Hageman , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-06-22 08:27+0000\n" +"PO-Revision-Date: 2017-06-22 08:27+0000\n" +"Last-Translator: Peter Hageman , 2017\n" +"Language-Team: Dutch (Netherlands) (https://www.transifex.com/oca/teams/23907/nl_NL/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: nl_NL\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#. module: web_ir_actions_act_window_message +#. openerp-web +#: code:addons/web_ir_actions_act_window_message/static/src/js/web_ir_actions_act_window_message.js:24 +#, python-format +msgid "Close" +msgstr "Sluiten" diff --git a/web_ir_actions_act_window_message/i18n/pt.po b/web_ir_actions_act_window_message/i18n/pt.po new file mode 100644 index 000000000000..0bb7ba96570e --- /dev/null +++ b/web_ir_actions_act_window_message/i18n/pt.po @@ -0,0 +1,26 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * web_ir_actions_act_window_message +# +# Translators: +# Pedro Castro Silva , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2018-01-03 03:50+0000\n" +"PO-Revision-Date: 2018-01-03 03:50+0000\n" +"Last-Translator: Pedro Castro Silva , 2017\n" +"Language-Team: Portuguese (https://www.transifex.com/oca/teams/23907/pt/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: pt\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#. module: web_ir_actions_act_window_message +#. openerp-web +#: code:addons/web_ir_actions_act_window_message/static/src/js/web_ir_actions_act_window_message.js:24 +#, python-format +msgid "Close" +msgstr "Fechar" diff --git a/web_ir_actions_act_window_message/i18n/pt_BR.po b/web_ir_actions_act_window_message/i18n/pt_BR.po index dd6d8167ea9f..6e9f2a684050 100644 --- a/web_ir_actions_act_window_message/i18n/pt_BR.po +++ b/web_ir_actions_act_window_message/i18n/pt_BR.po @@ -3,14 +3,15 @@ # * web_ir_actions_act_window_message # # Translators: +# OCA Transbot , 2017 msgid "" msgstr "" -"Project-Id-Version: web (8.0)\n" +"Project-Id-Version: Odoo Server 10.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2016-03-11 02:17+0000\n" -"PO-Revision-Date: 2016-03-05 16:20+0000\n" -"Last-Translator: danimaribeiro \n" -"Language-Team: Portuguese (Brazil) (http://www.transifex.com/oca/OCA-web-8-0/language/pt_BR/)\n" +"POT-Creation-Date: 2017-06-02 09:52+0000\n" +"PO-Revision-Date: 2017-06-02 09:52+0000\n" +"Last-Translator: OCA Transbot , 2017\n" +"Language-Team: Portuguese (Brazil) (https://www.transifex.com/oca/teams/23907/pt_BR/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" @@ -19,7 +20,7 @@ msgstr "" #. module: web_ir_actions_act_window_message #. openerp-web -#: code:addons/web_ir_actions_act_window_message/static/src/js/web_ir_actions_act_window_message.js:34 +#: code:addons/web_ir_actions_act_window_message/static/src/js/web_ir_actions_act_window_message.js:24 #, python-format msgid "Close" msgstr "Fechar" diff --git a/web_ir_actions_act_window_message/i18n/ro.po b/web_ir_actions_act_window_message/i18n/ro.po new file mode 100644 index 000000000000..5f0f9ca7d1f2 --- /dev/null +++ b/web_ir_actions_act_window_message/i18n/ro.po @@ -0,0 +1,26 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * web_ir_actions_act_window_message +# +# Translators: +# Dorin Hongu , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2018-01-03 03:50+0000\n" +"PO-Revision-Date: 2018-01-03 03:50+0000\n" +"Last-Translator: Dorin Hongu , 2017\n" +"Language-Team: Romanian (https://www.transifex.com/oca/teams/23907/ro/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: ro\n" +"Plural-Forms: nplurals=3; plural=(n==1?0:(((n%100>19)||((n%100==0)&&(n!=0)))?2:1));\n" + +#. module: web_ir_actions_act_window_message +#. openerp-web +#: code:addons/web_ir_actions_act_window_message/static/src/js/web_ir_actions_act_window_message.js:24 +#, python-format +msgid "Close" +msgstr "Închide" diff --git a/web_ir_actions_act_window_message/i18n/sl.po b/web_ir_actions_act_window_message/i18n/sl.po index 63ddbc003dd7..5725b8df4286 100644 --- a/web_ir_actions_act_window_message/i18n/sl.po +++ b/web_ir_actions_act_window_message/i18n/sl.po @@ -3,14 +3,15 @@ # * web_ir_actions_act_window_message # # Translators: +# OCA Transbot , 2017 msgid "" msgstr "" -"Project-Id-Version: web (8.0)\n" +"Project-Id-Version: Odoo Server 10.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2015-11-23 13:46+0000\n" -"PO-Revision-Date: 2015-11-08 05:45+0000\n" -"Last-Translator: Matjaž Mozetič \n" -"Language-Team: Slovenian (http://www.transifex.com/oca/OCA-web-8-0/language/sl/)\n" +"POT-Creation-Date: 2017-06-02 09:52+0000\n" +"PO-Revision-Date: 2017-06-02 09:52+0000\n" +"Last-Translator: OCA Transbot , 2017\n" +"Language-Team: Slovenian (https://www.transifex.com/oca/teams/23907/sl/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" @@ -19,7 +20,7 @@ msgstr "" #. module: web_ir_actions_act_window_message #. openerp-web -#: code:addons/web_ir_actions_act_window_message/static/src/js/web_ir_actions_act_window_message.js:34 +#: code:addons/web_ir_actions_act_window_message/static/src/js/web_ir_actions_act_window_message.js:24 #, python-format msgid "Close" msgstr "Zaključi" diff --git a/web_ir_actions_act_window_message/i18n/tr.po b/web_ir_actions_act_window_message/i18n/tr.po index 7d4493a4fe83..4f3a7178dd65 100644 --- a/web_ir_actions_act_window_message/i18n/tr.po +++ b/web_ir_actions_act_window_message/i18n/tr.po @@ -3,14 +3,15 @@ # * web_ir_actions_act_window_message # # Translators: +# OCA Transbot , 2017 msgid "" msgstr "" -"Project-Id-Version: web (8.0)\n" +"Project-Id-Version: Odoo Server 10.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2016-01-08 21:34+0000\n" -"PO-Revision-Date: 2015-12-30 22:16+0000\n" -"Last-Translator: Ahmet Altınışık \n" -"Language-Team: Turkish (http://www.transifex.com/oca/OCA-web-8-0/language/tr/)\n" +"POT-Creation-Date: 2017-06-02 09:52+0000\n" +"PO-Revision-Date: 2017-06-02 09:52+0000\n" +"Last-Translator: OCA Transbot , 2017\n" +"Language-Team: Turkish (https://www.transifex.com/oca/teams/23907/tr/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" @@ -19,7 +20,7 @@ msgstr "" #. module: web_ir_actions_act_window_message #. openerp-web -#: code:addons/web_ir_actions_act_window_message/static/src/js/web_ir_actions_act_window_message.js:34 +#: code:addons/web_ir_actions_act_window_message/static/src/js/web_ir_actions_act_window_message.js:24 #, python-format msgid "Close" msgstr "Kapat" From 63e984ec9a02a51a2565415ebc2ce182c44931b0 Mon Sep 17 00:00:00 2001 From: oca-travis Date: Sun, 24 Jun 2018 01:39:29 +0000 Subject: [PATCH 076/454] [UPD] Update web_ir_actions_act_window_message.pot --- web_ir_actions_act_window_message/i18n/ar.po | 7 +++--- web_ir_actions_act_window_message/i18n/de.po | 4 ++-- web_ir_actions_act_window_message/i18n/es.po | 4 ++-- web_ir_actions_act_window_message/i18n/eu.po | 4 ++-- web_ir_actions_act_window_message/i18n/fi.po | 4 ++-- web_ir_actions_act_window_message/i18n/fr.po | 4 ++-- web_ir_actions_act_window_message/i18n/hr.po | 7 +++--- web_ir_actions_act_window_message/i18n/it.po | 4 ++-- web_ir_actions_act_window_message/i18n/nl.po | 4 ++-- .../i18n/nl_NL.po | 7 +++--- web_ir_actions_act_window_message/i18n/pt.po | 4 ++-- .../i18n/pt_BR.po | 7 +++--- web_ir_actions_act_window_message/i18n/ro.po | 7 +++--- web_ir_actions_act_window_message/i18n/sl.po | 7 +++--- web_ir_actions_act_window_message/i18n/tr.po | 4 ++-- .../web_ir_actions_act_window_message.pot | 22 +++++++++++++++++++ 16 files changed, 64 insertions(+), 36 deletions(-) create mode 100644 web_ir_actions_act_window_message/i18n/web_ir_actions_act_window_message.pot diff --git a/web_ir_actions_act_window_message/i18n/ar.po b/web_ir_actions_act_window_message/i18n/ar.po index 0008b6b6d0db..6c0e056f7c6f 100644 --- a/web_ir_actions_act_window_message/i18n/ar.po +++ b/web_ir_actions_act_window_message/i18n/ar.po @@ -1,7 +1,7 @@ # Translation of Odoo Server. # This file contains the translation of the following modules: # * web_ir_actions_act_window_message -# +# # Translators: # OCA Transbot , 2017 msgid "" @@ -12,11 +12,12 @@ msgstr "" "PO-Revision-Date: 2017-06-02 09:52+0000\n" "Last-Translator: OCA Transbot , 2017\n" "Language-Team: Arabic (https://www.transifex.com/oca/teams/23907/ar/)\n" +"Language: ar\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" -"Language: ar\n" -"Plural-Forms: nplurals=6; plural=n==0 ? 0 : n==1 ? 1 : n==2 ? 2 : n%100>=3 && n%100<=10 ? 3 : n%100>=11 && n%100<=99 ? 4 : 5;\n" +"Plural-Forms: nplurals=6; plural=n==0 ? 0 : n==1 ? 1 : n==2 ? 2 : n%100>=3 " +"&& n%100<=10 ? 3 : n%100>=11 && n%100<=99 ? 4 : 5;\n" #. module: web_ir_actions_act_window_message #. openerp-web diff --git a/web_ir_actions_act_window_message/i18n/de.po b/web_ir_actions_act_window_message/i18n/de.po index b1f6629a0bf1..15a2786571fd 100644 --- a/web_ir_actions_act_window_message/i18n/de.po +++ b/web_ir_actions_act_window_message/i18n/de.po @@ -1,7 +1,7 @@ # Translation of Odoo Server. # This file contains the translation of the following modules: # * web_ir_actions_act_window_message -# +# # Translators: # OCA Transbot , 2017 msgid "" @@ -12,10 +12,10 @@ msgstr "" "PO-Revision-Date: 2017-06-02 09:52+0000\n" "Last-Translator: OCA Transbot , 2017\n" "Language-Team: German (https://www.transifex.com/oca/teams/23907/de/)\n" +"Language: de\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" -"Language: de\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #. module: web_ir_actions_act_window_message diff --git a/web_ir_actions_act_window_message/i18n/es.po b/web_ir_actions_act_window_message/i18n/es.po index 3b6d628ff3ff..b5ea46f18873 100644 --- a/web_ir_actions_act_window_message/i18n/es.po +++ b/web_ir_actions_act_window_message/i18n/es.po @@ -1,7 +1,7 @@ # Translation of Odoo Server. # This file contains the translation of the following modules: # * web_ir_actions_act_window_message -# +# # Translators: # OCA Transbot , 2017 msgid "" @@ -12,10 +12,10 @@ msgstr "" "PO-Revision-Date: 2017-06-02 09:52+0000\n" "Last-Translator: OCA Transbot , 2017\n" "Language-Team: Spanish (https://www.transifex.com/oca/teams/23907/es/)\n" +"Language: es\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" -"Language: es\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #. module: web_ir_actions_act_window_message diff --git a/web_ir_actions_act_window_message/i18n/eu.po b/web_ir_actions_act_window_message/i18n/eu.po index 41fb36af5bfc..182c1e76beb1 100644 --- a/web_ir_actions_act_window_message/i18n/eu.po +++ b/web_ir_actions_act_window_message/i18n/eu.po @@ -1,7 +1,7 @@ # Translation of Odoo Server. # This file contains the translation of the following modules: # * web_ir_actions_act_window_message -# +# # Translators: # OCA Transbot , 2017 msgid "" @@ -12,10 +12,10 @@ msgstr "" "PO-Revision-Date: 2017-06-02 09:52+0000\n" "Last-Translator: OCA Transbot , 2017\n" "Language-Team: Basque (https://www.transifex.com/oca/teams/23907/eu/)\n" +"Language: eu\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" -"Language: eu\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #. module: web_ir_actions_act_window_message diff --git a/web_ir_actions_act_window_message/i18n/fi.po b/web_ir_actions_act_window_message/i18n/fi.po index 5f8ffd6a3f6c..932ae1e7b607 100644 --- a/web_ir_actions_act_window_message/i18n/fi.po +++ b/web_ir_actions_act_window_message/i18n/fi.po @@ -1,7 +1,7 @@ # Translation of Odoo Server. # This file contains the translation of the following modules: # * web_ir_actions_act_window_message -# +# # Translators: # OCA Transbot , 2017 msgid "" @@ -12,10 +12,10 @@ msgstr "" "PO-Revision-Date: 2017-06-02 09:52+0000\n" "Last-Translator: OCA Transbot , 2017\n" "Language-Team: Finnish (https://www.transifex.com/oca/teams/23907/fi/)\n" +"Language: fi\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" -"Language: fi\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #. module: web_ir_actions_act_window_message diff --git a/web_ir_actions_act_window_message/i18n/fr.po b/web_ir_actions_act_window_message/i18n/fr.po index 458aeb94b485..bcb10858cfaf 100644 --- a/web_ir_actions_act_window_message/i18n/fr.po +++ b/web_ir_actions_act_window_message/i18n/fr.po @@ -1,7 +1,7 @@ # Translation of Odoo Server. # This file contains the translation of the following modules: # * web_ir_actions_act_window_message -# +# # Translators: # OCA Transbot , 2017 msgid "" @@ -12,10 +12,10 @@ msgstr "" "PO-Revision-Date: 2017-06-02 09:52+0000\n" "Last-Translator: OCA Transbot , 2017\n" "Language-Team: French (https://www.transifex.com/oca/teams/23907/fr/)\n" +"Language: fr\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" -"Language: fr\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" #. module: web_ir_actions_act_window_message diff --git a/web_ir_actions_act_window_message/i18n/hr.po b/web_ir_actions_act_window_message/i18n/hr.po index 5ac4e74c235b..799efce488fc 100644 --- a/web_ir_actions_act_window_message/i18n/hr.po +++ b/web_ir_actions_act_window_message/i18n/hr.po @@ -1,7 +1,7 @@ # Translation of Odoo Server. # This file contains the translation of the following modules: # * web_ir_actions_act_window_message -# +# # Translators: # OCA Transbot , 2017 msgid "" @@ -12,11 +12,12 @@ msgstr "" "PO-Revision-Date: 2017-06-02 09:52+0000\n" "Last-Translator: OCA Transbot , 2017\n" "Language-Team: Croatian (https://www.transifex.com/oca/teams/23907/hr/)\n" +"Language: hr\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" -"Language: hr\n" -"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n" +"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n" +"%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n" #. module: web_ir_actions_act_window_message #. openerp-web diff --git a/web_ir_actions_act_window_message/i18n/it.po b/web_ir_actions_act_window_message/i18n/it.po index 7baa87e59567..b68dc6564b1c 100644 --- a/web_ir_actions_act_window_message/i18n/it.po +++ b/web_ir_actions_act_window_message/i18n/it.po @@ -1,7 +1,7 @@ # Translation of Odoo Server. # This file contains the translation of the following modules: # * web_ir_actions_act_window_message -# +# # Translators: # OCA Transbot , 2017 msgid "" @@ -12,10 +12,10 @@ msgstr "" "PO-Revision-Date: 2017-06-02 09:52+0000\n" "Last-Translator: OCA Transbot , 2017\n" "Language-Team: Italian (https://www.transifex.com/oca/teams/23907/it/)\n" +"Language: it\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" -"Language: it\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #. module: web_ir_actions_act_window_message diff --git a/web_ir_actions_act_window_message/i18n/nl.po b/web_ir_actions_act_window_message/i18n/nl.po index a6a02243de06..5f3a60ad1d73 100644 --- a/web_ir_actions_act_window_message/i18n/nl.po +++ b/web_ir_actions_act_window_message/i18n/nl.po @@ -1,7 +1,7 @@ # Translation of Odoo Server. # This file contains the translation of the following modules: # * web_ir_actions_act_window_message -# +# # Translators: # OCA Transbot , 2017 msgid "" @@ -12,10 +12,10 @@ msgstr "" "PO-Revision-Date: 2017-06-02 09:52+0000\n" "Last-Translator: OCA Transbot , 2017\n" "Language-Team: Dutch (https://www.transifex.com/oca/teams/23907/nl/)\n" +"Language: nl\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" -"Language: nl\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #. module: web_ir_actions_act_window_message diff --git a/web_ir_actions_act_window_message/i18n/nl_NL.po b/web_ir_actions_act_window_message/i18n/nl_NL.po index c6bd95c79b31..cb772c2f7022 100644 --- a/web_ir_actions_act_window_message/i18n/nl_NL.po +++ b/web_ir_actions_act_window_message/i18n/nl_NL.po @@ -1,7 +1,7 @@ # Translation of Odoo Server. # This file contains the translation of the following modules: # * web_ir_actions_act_window_message -# +# # Translators: # Peter Hageman , 2017 msgid "" @@ -11,11 +11,12 @@ msgstr "" "POT-Creation-Date: 2017-06-22 08:27+0000\n" "PO-Revision-Date: 2017-06-22 08:27+0000\n" "Last-Translator: Peter Hageman , 2017\n" -"Language-Team: Dutch (Netherlands) (https://www.transifex.com/oca/teams/23907/nl_NL/)\n" +"Language-Team: Dutch (Netherlands) (https://www.transifex.com/oca/" +"teams/23907/nl_NL/)\n" +"Language: nl_NL\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" -"Language: nl_NL\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #. module: web_ir_actions_act_window_message diff --git a/web_ir_actions_act_window_message/i18n/pt.po b/web_ir_actions_act_window_message/i18n/pt.po index 0bb7ba96570e..e25efb477117 100644 --- a/web_ir_actions_act_window_message/i18n/pt.po +++ b/web_ir_actions_act_window_message/i18n/pt.po @@ -1,7 +1,7 @@ # Translation of Odoo Server. # This file contains the translation of the following modules: # * web_ir_actions_act_window_message -# +# # Translators: # Pedro Castro Silva , 2017 msgid "" @@ -12,10 +12,10 @@ msgstr "" "PO-Revision-Date: 2018-01-03 03:50+0000\n" "Last-Translator: Pedro Castro Silva , 2017\n" "Language-Team: Portuguese (https://www.transifex.com/oca/teams/23907/pt/)\n" +"Language: pt\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" -"Language: pt\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #. module: web_ir_actions_act_window_message diff --git a/web_ir_actions_act_window_message/i18n/pt_BR.po b/web_ir_actions_act_window_message/i18n/pt_BR.po index 6e9f2a684050..c9a7d2189b55 100644 --- a/web_ir_actions_act_window_message/i18n/pt_BR.po +++ b/web_ir_actions_act_window_message/i18n/pt_BR.po @@ -1,7 +1,7 @@ # Translation of Odoo Server. # This file contains the translation of the following modules: # * web_ir_actions_act_window_message -# +# # Translators: # OCA Transbot , 2017 msgid "" @@ -11,11 +11,12 @@ msgstr "" "POT-Creation-Date: 2017-06-02 09:52+0000\n" "PO-Revision-Date: 2017-06-02 09:52+0000\n" "Last-Translator: OCA Transbot , 2017\n" -"Language-Team: Portuguese (Brazil) (https://www.transifex.com/oca/teams/23907/pt_BR/)\n" +"Language-Team: Portuguese (Brazil) (https://www.transifex.com/oca/" +"teams/23907/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" -"Language: pt_BR\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" #. module: web_ir_actions_act_window_message diff --git a/web_ir_actions_act_window_message/i18n/ro.po b/web_ir_actions_act_window_message/i18n/ro.po index 5f0f9ca7d1f2..25cae0dd5bc0 100644 --- a/web_ir_actions_act_window_message/i18n/ro.po +++ b/web_ir_actions_act_window_message/i18n/ro.po @@ -1,7 +1,7 @@ # Translation of Odoo Server. # This file contains the translation of the following modules: # * web_ir_actions_act_window_message -# +# # Translators: # Dorin Hongu , 2017 msgid "" @@ -12,11 +12,12 @@ msgstr "" "PO-Revision-Date: 2018-01-03 03:50+0000\n" "Last-Translator: Dorin Hongu , 2017\n" "Language-Team: Romanian (https://www.transifex.com/oca/teams/23907/ro/)\n" +"Language: ro\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" -"Language: ro\n" -"Plural-Forms: nplurals=3; plural=(n==1?0:(((n%100>19)||((n%100==0)&&(n!=0)))?2:1));\n" +"Plural-Forms: nplurals=3; plural=(n==1?0:(((n%100>19)||((n%100==0)&&(n!=0)))?" +"2:1));\n" #. module: web_ir_actions_act_window_message #. openerp-web diff --git a/web_ir_actions_act_window_message/i18n/sl.po b/web_ir_actions_act_window_message/i18n/sl.po index 5725b8df4286..85dfd671aee3 100644 --- a/web_ir_actions_act_window_message/i18n/sl.po +++ b/web_ir_actions_act_window_message/i18n/sl.po @@ -1,7 +1,7 @@ # Translation of Odoo Server. # This file contains the translation of the following modules: # * web_ir_actions_act_window_message -# +# # Translators: # OCA Transbot , 2017 msgid "" @@ -12,11 +12,12 @@ msgstr "" "PO-Revision-Date: 2017-06-02 09:52+0000\n" "Last-Translator: OCA Transbot , 2017\n" "Language-Team: Slovenian (https://www.transifex.com/oca/teams/23907/sl/)\n" +"Language: sl\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" -"Language: sl\n" -"Plural-Forms: nplurals=4; plural=(n%100==1 ? 0 : n%100==2 ? 1 : n%100==3 || n%100==4 ? 2 : 3);\n" +"Plural-Forms: nplurals=4; plural=(n%100==1 ? 0 : n%100==2 ? 1 : n%100==3 || n" +"%100==4 ? 2 : 3);\n" #. module: web_ir_actions_act_window_message #. openerp-web diff --git a/web_ir_actions_act_window_message/i18n/tr.po b/web_ir_actions_act_window_message/i18n/tr.po index 4f3a7178dd65..bdd84af6b8a2 100644 --- a/web_ir_actions_act_window_message/i18n/tr.po +++ b/web_ir_actions_act_window_message/i18n/tr.po @@ -1,7 +1,7 @@ # Translation of Odoo Server. # This file contains the translation of the following modules: # * web_ir_actions_act_window_message -# +# # Translators: # OCA Transbot , 2017 msgid "" @@ -12,10 +12,10 @@ msgstr "" "PO-Revision-Date: 2017-06-02 09:52+0000\n" "Last-Translator: OCA Transbot , 2017\n" "Language-Team: Turkish (https://www.transifex.com/oca/teams/23907/tr/)\n" +"Language: tr\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" -"Language: tr\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" #. module: web_ir_actions_act_window_message diff --git a/web_ir_actions_act_window_message/i18n/web_ir_actions_act_window_message.pot b/web_ir_actions_act_window_message/i18n/web_ir_actions_act_window_message.pot new file mode 100644 index 000000000000..f878e4512e56 --- /dev/null +++ b/web_ir_actions_act_window_message/i18n/web_ir_actions_act_window_message.pot @@ -0,0 +1,22 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * web_ir_actions_act_window_message +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"Last-Translator: <>\n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: \n" + +#. module: web_ir_actions_act_window_message +#. openerp-web +#: code:addons/web_ir_actions_act_window_message/static/src/js/web_ir_actions_act_window_message.js:24 +#, python-format +msgid "Close" +msgstr "" + From 6f5002ea70fa48b660e5506f2b063c828b79905a Mon Sep 17 00:00:00 2001 From: Abraham Anes Date: Thu, 21 Nov 2019 16:01:14 +0100 Subject: [PATCH 077/454] [12.0][MIG] web_ir_actions_act_window_message: Migration to 12.0 --- web_ir_actions_act_window_message/README.rst | 65 ++- .../__manifest__.py | 2 +- .../readme/CONTRIBUTORS.rst | 5 + .../readme/DESCRIPTION.rst | 1 + .../readme/ROADMAP.rst | 2 + .../readme/USAGE.rst | 44 ++ .../static/description/index.html | 456 ++++++++++++++++++ .../js/web_ir_actions_act_window_message.js | 35 +- 8 files changed, 584 insertions(+), 26 deletions(-) create mode 100644 web_ir_actions_act_window_message/readme/CONTRIBUTORS.rst create mode 100644 web_ir_actions_act_window_message/readme/DESCRIPTION.rst create mode 100644 web_ir_actions_act_window_message/readme/ROADMAP.rst create mode 100644 web_ir_actions_act_window_message/readme/USAGE.rst create mode 100644 web_ir_actions_act_window_message/static/description/index.html diff --git a/web_ir_actions_act_window_message/README.rst b/web_ir_actions_act_window_message/README.rst index 3772ad3e7bb8..73d5c905e0f1 100644 --- a/web_ir_actions_act_window_message/README.rst +++ b/web_ir_actions_act_window_message/README.rst @@ -1,8 +1,37 @@ +========================= Client side message boxes ========================= +.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png + :target: https://odoo-community.org/page/development-status + :alt: Beta +.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png + :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html + :alt: License: AGPL-3 +.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fweb-lightgray.png?logo=github + :target: https://github.com/OCA/web/tree/12.0/web_ir_actions_act_window_message + :alt: OCA/web +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png + :target: https://translation.odoo-community.org/projects/web-12-0/web-12-0-web_ir_actions_act_window_message + :alt: Translate me on Weblate +.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png + :target: https://runbot.odoo-community.org/runbot/162/12.0 + :alt: Try me on Runbot + +|badge1| |badge2| |badge3| |badge4| |badge5| + This module allows to show a message popup on the client side as result of a button. +**Table of contents** + +.. contents:: + :local: + Usage ===== @@ -57,35 +86,47 @@ Known issues / Roadmap * add `message_type` to differenciate between warnings, errors, etc. * have one `message_type` to show a nonmodal warning on top right - Bug Tracker =========== Bugs are tracked on `GitHub Issues `_. In case of trouble, please check there if your issue has already been reported. -If you spotted it first, help us smashing it by providing a detailed and welcomed feedback -`here `_. +If you spotted it first, help us smashing it by providing a detailed and welcomed +`feedback `_. +Do not contact contributors directly about support or help with technical issues. Credits ======= +Authors +~~~~~~~ + +* Therp BV +* ACSONE SA/NV + Contributors ------------- +~~~~~~~~~~~~ * Holger Brunn * Zakaria Makrelouf (ACSONE SA/NV) * Benjamin Willig (ACSONE SA/NV) +* Ioan Galan (Studio73) +* Abraham Anes (Studio73) -Maintainer ----------- - -.. image:: http://odoo-community.org/logo.png - :alt: Odoo Community Association - :target: http://odoo-community.org +Maintainers +~~~~~~~~~~~ This module is maintained by the OCA. -OCA, or the Odoo Community Association, is a nonprofit organization whose mission is to support the collaborative development of Odoo features and promote its widespread use. +.. image:: https://odoo-community.org/logo.png + :alt: Odoo Community Association + :target: https://odoo-community.org + +OCA, or the Odoo Community Association, is a nonprofit organization whose +mission is to support the collaborative development of Odoo features and +promote its widespread use. + +This module is part of the `OCA/web `_ project on GitHub. -To contribute to this module, please visit http://odoo-community.org. \ No newline at end of file +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/web_ir_actions_act_window_message/__manifest__.py b/web_ir_actions_act_window_message/__manifest__.py index 5dd3b18b13a2..8b17eb02d3ba 100644 --- a/web_ir_actions_act_window_message/__manifest__.py +++ b/web_ir_actions_act_window_message/__manifest__.py @@ -3,7 +3,7 @@ # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). { "name": "Client side message boxes", - "version": "10.0.1.0.0", + "version": "12.0.1.0.0", "author": "Therp BV, " "ACSONE SA/NV, " "Odoo Community Association (OCA)", diff --git a/web_ir_actions_act_window_message/readme/CONTRIBUTORS.rst b/web_ir_actions_act_window_message/readme/CONTRIBUTORS.rst new file mode 100644 index 000000000000..7b22f2ca06b0 --- /dev/null +++ b/web_ir_actions_act_window_message/readme/CONTRIBUTORS.rst @@ -0,0 +1,5 @@ +* Holger Brunn +* Zakaria Makrelouf (ACSONE SA/NV) +* Benjamin Willig (ACSONE SA/NV) +* Ioan Galan (Studio73) +* Abraham Anes (Studio73) diff --git a/web_ir_actions_act_window_message/readme/DESCRIPTION.rst b/web_ir_actions_act_window_message/readme/DESCRIPTION.rst new file mode 100644 index 000000000000..1223482e36d7 --- /dev/null +++ b/web_ir_actions_act_window_message/readme/DESCRIPTION.rst @@ -0,0 +1 @@ +This module allows to show a message popup on the client side as result of a button. diff --git a/web_ir_actions_act_window_message/readme/ROADMAP.rst b/web_ir_actions_act_window_message/readme/ROADMAP.rst new file mode 100644 index 000000000000..1a49589d6e6e --- /dev/null +++ b/web_ir_actions_act_window_message/readme/ROADMAP.rst @@ -0,0 +1,2 @@ +* add `message_type` to differenciate between warnings, errors, etc. +* have one `message_type` to show a nonmodal warning on top right diff --git a/web_ir_actions_act_window_message/readme/USAGE.rst b/web_ir_actions_act_window_message/readme/USAGE.rst new file mode 100644 index 000000000000..3f34ff7ce73a --- /dev/null +++ b/web_ir_actions_act_window_message/readme/USAGE.rst @@ -0,0 +1,44 @@ +Depend on this module and return + +.. code:: python + + { + 'type': 'ir.actions.act_window.message', + 'title': _('My title'), + 'message': _('My message'), + # optional title of the close button, if not set, will be _('Close') + # if set False, no close button will be shown + # you can create your own close button with an action of type + # ir.actions.act_window_close + 'close_button_title': 'Make this window go away', + # Use HTML instead of text + 'is_html_message': True, + # this is an optional list of buttons to show + 'buttons': [ + # a button can be any action (also ir.actions.report.xml et al) + { + 'type': 'ir.actions.act_window', + 'name': 'All customers', + 'res_model': 'res.partner', + 'view_mode': 'form', + 'views': [[False, 'list'], [False, 'form']], + 'domain': [('customer', '=', True)], + }, + # or if type == method, you need to pass a model, a method name and + # parameters + { + 'type': 'method', + 'name': _('Yes, do it'), + 'model': self._name, + 'method': 'myfunction', + # list of arguments to pass positionally + 'args': [self.ids], + # dictionary of keyword arguments + 'kwargs': {'force': True}, + # button style + 'classes': 'btn-primary', + } + ] + } + +You are responsible for translating the messages. diff --git a/web_ir_actions_act_window_message/static/description/index.html b/web_ir_actions_act_window_message/static/description/index.html new file mode 100644 index 000000000000..5eb47701fd92 --- /dev/null +++ b/web_ir_actions_act_window_message/static/description/index.html @@ -0,0 +1,456 @@ + + + + + + +Client side message boxes + + + +
+

Client side message boxes

+ + +

Beta License: AGPL-3 OCA/web Translate me on Weblate Try me on Runbot

+

This module allows to show a message popup on the client side as result of a button.

+

Table of contents

+ +
+

Usage

+

Depend on this module and return

+
+{
+    'type': 'ir.actions.act_window.message',
+    'title': _('My title'),
+    'message': _('My message'),
+    # optional title of the close button, if not set, will be _('Close')
+    # if set False, no close button will be shown
+    # you can create your own close button with an action of type
+    # ir.actions.act_window_close
+    'close_button_title': 'Make this window go away',
+    # Use HTML instead of text
+    'is_html_message': True,
+    # this is an optional list of buttons to show
+    'buttons': [
+        # a button can be any action (also ir.actions.report.xml et al)
+        {
+            'type': 'ir.actions.act_window',
+            'name': 'All customers',
+            'res_model': 'res.partner',
+            'view_mode': 'form',
+            'views': [[False, 'list'], [False, 'form']],
+            'domain': [('customer', '=', True)],
+        },
+        # or if type == method, you need to pass a model, a method name and
+        # parameters
+        {
+            'type': 'method',
+            'name': _('Yes, do it'),
+            'model': self._name,
+            'method': 'myfunction',
+            # list of arguments to pass positionally
+            'args': [self.ids],
+            # dictionary of keyword arguments
+            'kwargs': {'force': True},
+            # button style
+            'classes': 'btn-primary',
+        }
+    ]
+}
+
+

You are responsible for translating the messages.

+
+
+

Known issues / Roadmap

+
    +
  • add message_type to differenciate between warnings, errors, etc.
  • +
  • have one message_type to show a nonmodal warning on top right
  • +
+
+
+

Bug Tracker

+

Bugs are tracked on GitHub Issues. +In case of trouble, please check there if your issue has already been reported. +If you spotted it first, help us smashing it by providing a detailed and welcomed +feedback.

+

Do not contact contributors directly about support or help with technical issues.

+
+
+

Credits

+
+

Authors

+
    +
  • Therp BV
  • +
  • ACSONE SA/NV
  • +
+
+
+

Contributors

+ +
+
+

Maintainers

+

This module is maintained by the OCA.

+Odoo Community Association +

OCA, or the Odoo Community Association, is a nonprofit organization whose +mission is to support the collaborative development of Odoo features and +promote its widespread use.

+

This module is part of the OCA/web project on GitHub.

+

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

+
+
+
+ + diff --git a/web_ir_actions_act_window_message/static/src/js/web_ir_actions_act_window_message.js b/web_ir_actions_act_window_message/static/src/js/web_ir_actions_act_window_message.js index 1b0708d719be..1651a40d5d1c 100644 --- a/web_ir_actions_act_window_message/static/src/js/web_ir_actions_act_window_message.js +++ b/web_ir_actions_act_window_message/static/src/js/web_ir_actions_act_window_message.js @@ -7,13 +7,18 @@ odoo.define('web.web_ir_actions_act_window_message', function(require) var ActionManager = require('web.ActionManager'), core = require('web.core'), - Model = require('web.Model'), Dialog = require('web.Dialog'); var _t = core._t; ActionManager.include({ - ir_actions_act_window_message: function(action, options) + _handleAction: function (action, options) { + if (action.type === 'ir.actions.act_window.message') { + return this._executeWindowMessageAction(action, options); + } + return this._super.apply(this, arguments); + }, + _executeWindowMessageAction: function(action, options) { var self = this, buttons = []; @@ -24,8 +29,10 @@ odoo.define('web.web_ir_actions_act_window_message', function(require) text: action.close_button_title || _t('Close'), click: function() { // refresh the view before closing the dialog - self.inner_widget.active_view - .controller.recursive_reload(); + var controller = self.getCurrentController(); + if (controller && controller.widget) { + controller.widget.reload(); + } dialog.close() }, classes: 'btn-default', @@ -62,7 +69,7 @@ odoo.define('web.web_ir_actions_act_window_message', function(require) }, options) ) - return dialog.open(); + return dialog.open()._opened; }, ir_actions_act_window_message_get_buttons: function(action, close_func) { @@ -76,12 +83,12 @@ odoo.define('web.web_ir_actions_act_window_message', function(require) click: function() { if(button_definition.type == 'method') { - (new Model(button_definition.model)) - .call( - button_definition.method, - button_definition.args, - button_definition.kwargs - ).then(function(result) + self._rpc({ + model: button_definition.model, + method: button_definition.method, + args: button_definition.args, + kwargs: button_definition.kwargs + }).then(function(result) { if(_.isObject(result)) { @@ -89,8 +96,10 @@ odoo.define('web.web_ir_actions_act_window_message', function(require) } // always refresh the view after the action // ex: action updates a status - self.inner_widget.active_view - .controller.recursive_reload(); + var controller = self.getCurrentController(); + if (controller && controller.widget) { + controller.widget.reload(); + } }); } else From 9aab380de6f9c6182bc80ee64a3304d6334fc773 Mon Sep 17 00:00:00 2001 From: oca-travis Date: Tue, 26 Nov 2019 16:54:22 +0000 Subject: [PATCH 078/454] [UPD] Update web_ir_actions_act_window_message.pot --- .../i18n/web_ir_actions_act_window_message.pot | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/web_ir_actions_act_window_message/i18n/web_ir_actions_act_window_message.pot b/web_ir_actions_act_window_message/i18n/web_ir_actions_act_window_message.pot index f878e4512e56..4e9bada5a3e8 100644 --- a/web_ir_actions_act_window_message/i18n/web_ir_actions_act_window_message.pot +++ b/web_ir_actions_act_window_message/i18n/web_ir_actions_act_window_message.pot @@ -4,7 +4,7 @@ # msgid "" msgstr "" -"Project-Id-Version: Odoo Server 10.0\n" +"Project-Id-Version: Odoo Server 12.0\n" "Report-Msgid-Bugs-To: \n" "Last-Translator: <>\n" "Language-Team: \n" @@ -15,7 +15,7 @@ msgstr "" #. module: web_ir_actions_act_window_message #. openerp-web -#: code:addons/web_ir_actions_act_window_message/static/src/js/web_ir_actions_act_window_message.js:24 +#: code:addons/web_ir_actions_act_window_message/static/src/js/web_ir_actions_act_window_message.js:29 #, python-format msgid "Close" msgstr "" From b9726f6c851e6b5dbfd04f54b8ade5e156ea9c58 Mon Sep 17 00:00:00 2001 From: OCA-git-bot Date: Tue, 26 Nov 2019 17:20:35 +0000 Subject: [PATCH 079/454] [UPD] README.rst --- .../static/description/index.html | 30 ++++++++++++++++--- 1 file changed, 26 insertions(+), 4 deletions(-) diff --git a/web_ir_actions_act_window_message/static/description/index.html b/web_ir_actions_act_window_message/static/description/index.html index 5eb47701fd92..0555730768f3 100644 --- a/web_ir_actions_act_window_message/static/description/index.html +++ b/web_ir_actions_act_window_message/static/description/index.html @@ -3,13 +3,13 @@ - + Client side message boxes -
-

Client side message boxes

+
+ + +Odoo Community Association + +
+

Client side message boxes

-

Beta License: AGPL-3 OCA/web Translate me on Weblate Try me on Runboat

+

Beta License: AGPL-3 OCA/web Translate me on Weblate Try me on Runboat

This module allows to show a message popup on the client side as result of a button.

Table of contents

@@ -387,7 +392,7 @@

Client side message boxes

-

Usage

+

Usage

Depend on this module and return

 {
@@ -432,14 +437,14 @@ 

Usage

You are responsible for translating the messages.

-

Known issues / Roadmap

+

Known issues / Roadmap

  • add message_type to differenciate between warnings, errors, etc.
  • have one message_type to show a nonmodal warning on top right
-

Bug Tracker

+

Bug Tracker

Bugs are tracked on GitHub Issues. In case of trouble, please check there if your issue has already been reported. If you spotted it first, help us to smash it by providing a detailed and welcomed @@ -447,16 +452,16 @@

Bug Tracker

Do not contact contributors directly about support or help with technical issues.

-

Credits

+

Credits

-

Authors

+

Authors

  • Therp BV
  • ACSONE SA/NV
-

Contributors

+

Contributors

-

Maintainers

+

Maintainers

This module is maintained by the OCA.

Odoo Community Association @@ -485,5 +490,6 @@

Maintainers

+
From 844c1d0010816c26281b5267d340d6f55634d4e7 Mon Sep 17 00:00:00 2001 From: Vicent-S73 Date: Fri, 7 Nov 2025 11:58:10 +0100 Subject: [PATCH 106/454] [IMP] web_ir_act_window_message: pre-commit auto fixes --- web_ir_actions_act_window_message/README.rst | 10 +++++----- web_ir_actions_act_window_message/__manifest__.py | 2 +- .../static/description/index.html | 6 +++--- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/web_ir_actions_act_window_message/README.rst b/web_ir_actions_act_window_message/README.rst index 8bbf40165459..81fe2301fd25 100644 --- a/web_ir_actions_act_window_message/README.rst +++ b/web_ir_actions_act_window_message/README.rst @@ -21,13 +21,13 @@ Client side message boxes :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html :alt: License: AGPL-3 .. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fweb-lightgray.png?logo=github - :target: https://github.com/OCA/web/tree/18.0/web_ir_actions_act_window_message + :target: https://github.com/OCA/web/tree/19.0/web_ir_actions_act_window_message :alt: OCA/web .. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png - :target: https://translation.odoo-community.org/projects/web-18-0/web-18-0-web_ir_actions_act_window_message + :target: https://translation.odoo-community.org/projects/web-19-0/web-19-0-web_ir_actions_act_window_message :alt: Translate me on Weblate .. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png - :target: https://runboat.odoo-community.org/builds?repo=OCA/web&target_branch=18.0 + :target: https://runboat.odoo-community.org/builds?repo=OCA/web&target_branch=19.0 :alt: Try me on Runboat |badge1| |badge2| |badge3| |badge4| |badge5| @@ -100,7 +100,7 @@ Bug Tracker Bugs are tracked on `GitHub Issues `_. In case of trouble, please check there if your issue has already been reported. If you spotted it first, help us to smash it by providing a detailed and welcomed -`feedback `_. +`feedback `_. Do not contact contributors directly about support or help with technical issues. @@ -140,6 +140,6 @@ OCA, or the Odoo Community Association, is a nonprofit organization whose mission is to support the collaborative development of Odoo features and promote its widespread use. -This module is part of the `OCA/web `_ project on GitHub. +This module is part of the `OCA/web `_ project on GitHub. You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/web_ir_actions_act_window_message/__manifest__.py b/web_ir_actions_act_window_message/__manifest__.py index 0cfce8a88952..8ab6dbc372e3 100644 --- a/web_ir_actions_act_window_message/__manifest__.py +++ b/web_ir_actions_act_window_message/__manifest__.py @@ -3,7 +3,7 @@ { "name": "Client side message boxes", "version": "18.0.1.0.0", - "author": "Therp BV, " "ACSONE SA/NV, " "Odoo Community Association (OCA)", + "author": "Therp BV, ACSONE SA/NV, Odoo Community Association (OCA)", "website": "https://github.com/OCA/web", "license": "AGPL-3", "category": "Hidden/Dependency", diff --git a/web_ir_actions_act_window_message/static/description/index.html b/web_ir_actions_act_window_message/static/description/index.html index 78cf10e74592..7e524f5adc0d 100644 --- a/web_ir_actions_act_window_message/static/description/index.html +++ b/web_ir_actions_act_window_message/static/description/index.html @@ -374,7 +374,7 @@

Client side message boxes

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !! source digest: sha256:7ce537d4c262436ca7e2b131817ed046ba5a113a8bb31c56e077546948571918 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! --> -

Beta License: AGPL-3 OCA/web Translate me on Weblate Try me on Runboat

+

Beta License: AGPL-3 OCA/web Translate me on Weblate Try me on Runboat

This module allows to show a message popup on the client side as result of a button.

Table of contents

@@ -448,7 +448,7 @@

Bug Tracker

Bugs are tracked on GitHub Issues. In case of trouble, please check there if your issue has already been reported. If you spotted it first, help us to smash it by providing a detailed and welcomed -feedback.

+feedback.

Do not contact contributors directly about support or help with technical issues.

@@ -485,7 +485,7 @@

Maintainers

OCA, or the Odoo Community Association, is a nonprofit organization whose mission is to support the collaborative development of Odoo features and promote its widespread use.

-

This module is part of the OCA/web project on GitHub.

+

This module is part of the OCA/web project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

From 079363f6300c63209666755a550c43bcba1b7465 Mon Sep 17 00:00:00 2001 From: Vicent-S73 Date: Fri, 7 Nov 2025 13:17:26 +0100 Subject: [PATCH 107/454] [MIG] web_ir_actions_act_window_message: Migration to 19.0 --- web_ir_actions_act_window_message/__manifest__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web_ir_actions_act_window_message/__manifest__.py b/web_ir_actions_act_window_message/__manifest__.py index 8ab6dbc372e3..11b31af29ab1 100644 --- a/web_ir_actions_act_window_message/__manifest__.py +++ b/web_ir_actions_act_window_message/__manifest__.py @@ -2,7 +2,7 @@ # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). { "name": "Client side message boxes", - "version": "18.0.1.0.0", + "version": "19.0.1.0.0", "author": "Therp BV, ACSONE SA/NV, Odoo Community Association (OCA)", "website": "https://github.com/OCA/web", "license": "AGPL-3", From 736ad4358ce79535fc23bf78a7181ec827c70195 Mon Sep 17 00:00:00 2001 From: Holger Brunn Date: Fri, 7 Nov 2025 10:06:02 +0100 Subject: [PATCH 108/454] [IMP] web_ir_actions_act_window_message: add demo action (cherry picked from commit dc491488174d697e461fe433110fbbdee6348bb7) --- web_ir_actions_act_window_message/README.rst | 4 ++ .../__manifest__.py | 3 + .../demo/ir_actions_server.xml | 58 +++++++++++++++++++ .../readme/USAGE.md | 2 + .../static/description/index.html | 3 + 5 files changed, 70 insertions(+) create mode 100644 web_ir_actions_act_window_message/demo/ir_actions_server.xml diff --git a/web_ir_actions_act_window_message/README.rst b/web_ir_actions_act_window_message/README.rst index 81fe2301fd25..9dfd7199167e 100644 --- a/web_ir_actions_act_window_message/README.rst +++ b/web_ir_actions_act_window_message/README.rst @@ -88,6 +88,10 @@ Depend on this module and return You are responsible for translating the messages. +Demo data contains server actions on the module model that demo the +features of this addon, those are also convenient for reviewers and +migrators to verify correct function. + Known issues / Roadmap ====================== diff --git a/web_ir_actions_act_window_message/__manifest__.py b/web_ir_actions_act_window_message/__manifest__.py index 11b31af29ab1..adfd858434c3 100644 --- a/web_ir_actions_act_window_message/__manifest__.py +++ b/web_ir_actions_act_window_message/__manifest__.py @@ -12,6 +12,9 @@ "data": [ "security/ir.model.access.csv", ], + "demo": [ + "demo/ir_actions_server.xml", + ], "assets": { "web.assets_backend": [ "web_ir_actions_act_window_message/static/src/**/*", diff --git a/web_ir_actions_act_window_message/demo/ir_actions_server.xml b/web_ir_actions_act_window_message/demo/ir_actions_server.xml new file mode 100644 index 000000000000..87dc4d8f2afe --- /dev/null +++ b/web_ir_actions_act_window_message/demo/ir_actions_server.xml @@ -0,0 +1,58 @@ + + + web_ir_actions_act_window_message test (html) + code + + +record.write({'shortdesc': '%s modified before message box' % record.shortdesc}) +action = { + 'type': 'ir.actions.act_window.message', + 'title': 'The message title', + 'message': 'This is a message containing a html entity: &#127881; (should be rendered as emoticon) ' + 'When the box is closed, the form/list should be reloaded to reflect that the action has changed the module name', + 'is_html_message': True, + 'close_button_title': 'Custom close button text', +} + + + + + web_ir_actions_act_window_message test (text) + code + + + action = { + 'type': 'ir.actions.act_window.message', + 'message': 'This is a message containing a html entity: &#127881; (should be rendered as text) ' + 'Should show three buttons, one of them highlighted', + 'close_button_title': False, + 'buttons': [ + { + 'name': 'Append text to module name', + 'type': 'method', + 'model': model._name, + 'method': 'write', + 'args': [record.id], + 'kwargs': {'vals': {'shortdesc': '%s modified by message box' % record.name}}, + }, + { + 'name': 'Open module in new form', + 'type': 'ir.actions.act_window', + 'res_model': model._name, + 'res_id': record.id, + 'views': [(False, 'form')], + }, + { + 'name': 'Run the update module list wizard', + 'type': 'ir.actions.act_window', + 'res_model': 'base.module.update', + 'target': 'new', + 'classes': 'btn btn-primary', + 'views': [(False, 'form')], + }, + ], + } + + + + diff --git a/web_ir_actions_act_window_message/readme/USAGE.md b/web_ir_actions_act_window_message/readme/USAGE.md index 845656ae9376..0077754da0c2 100644 --- a/web_ir_actions_act_window_message/readme/USAGE.md +++ b/web_ir_actions_act_window_message/readme/USAGE.md @@ -42,3 +42,5 @@ Depend on this module and return ``` You are responsible for translating the messages. + +Demo data contains server actions on the module model that demo the features of this addon, those are also convenient for reviewers and migrators to verify correct function. diff --git a/web_ir_actions_act_window_message/static/description/index.html b/web_ir_actions_act_window_message/static/description/index.html index 7e524f5adc0d..256e80bdf97d 100644 --- a/web_ir_actions_act_window_message/static/description/index.html +++ b/web_ir_actions_act_window_message/static/description/index.html @@ -435,6 +435,9 @@

Usage

}

You are responsible for translating the messages.

+

Demo data contains server actions on the module model that demo the +features of this addon, those are also convenient for reviewers and +migrators to verify correct function.

Known issues / Roadmap

From 8aa5a7bc4c18ac4b32fb7aa9a141099568f580c3 Mon Sep 17 00:00:00 2001 From: Holger Brunn Date: Fri, 7 Nov 2025 10:07:53 +0100 Subject: [PATCH 109/454] [UPD] web_ir_actions_act_window_message: set hbrunn as maintainer (cherry picked from commit 10d750b6af08322c584c2ba02a05ce8b7f058680) --- web_ir_actions_act_window_message/README.rst | 8 ++++++++ web_ir_actions_act_window_message/__manifest__.py | 1 + .../static/description/index.html | 2 ++ 3 files changed, 11 insertions(+) diff --git a/web_ir_actions_act_window_message/README.rst b/web_ir_actions_act_window_message/README.rst index 9dfd7199167e..b0e9c5d88b73 100644 --- a/web_ir_actions_act_window_message/README.rst +++ b/web_ir_actions_act_window_message/README.rst @@ -144,6 +144,14 @@ OCA, or the Odoo Community Association, is a nonprofit organization whose mission is to support the collaborative development of Odoo features and promote its widespread use. +.. |maintainer-hbrunn| image:: https://github.com/hbrunn.png?size=40px + :target: https://github.com/hbrunn + :alt: hbrunn + +Current `maintainer `__: + +|maintainer-hbrunn| + This module is part of the `OCA/web `_ project on GitHub. You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/web_ir_actions_act_window_message/__manifest__.py b/web_ir_actions_act_window_message/__manifest__.py index adfd858434c3..02924fa5234c 100644 --- a/web_ir_actions_act_window_message/__manifest__.py +++ b/web_ir_actions_act_window_message/__manifest__.py @@ -8,6 +8,7 @@ "license": "AGPL-3", "category": "Hidden/Dependency", "summary": "Show a message box to users", + "maintainers": ["hbrunn"], "depends": ["web"], "data": [ "security/ir.model.access.csv", diff --git a/web_ir_actions_act_window_message/static/description/index.html b/web_ir_actions_act_window_message/static/description/index.html index 256e80bdf97d..5a98ab77f9e0 100644 --- a/web_ir_actions_act_window_message/static/description/index.html +++ b/web_ir_actions_act_window_message/static/description/index.html @@ -488,6 +488,8 @@

Maintainers

OCA, or the Odoo Community Association, is a nonprofit organization whose mission is to support the collaborative development of Odoo features and promote its widespread use.

+

Current maintainer:

+

hbrunn

This module is part of the OCA/web project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

From 7822168085ea9385ba9634b8052d6f357cf9c3ce Mon Sep 17 00:00:00 2001 From: Holger Brunn Date: Fri, 7 Nov 2025 16:10:49 +0100 Subject: [PATCH 110/454] [FIX] web_ir_actions_act_window_message: remove incorrect documentation (cherry picked from commit 5f164f56d85dda3bfaf066074df114db833677d7) --- web_ir_actions_act_window_message/README.rst | 2 -- web_ir_actions_act_window_message/readme/USAGE.md | 2 -- web_ir_actions_act_window_message/static/description/index.html | 2 -- 3 files changed, 6 deletions(-) diff --git a/web_ir_actions_act_window_message/README.rst b/web_ir_actions_act_window_message/README.rst index b0e9c5d88b73..e4b8cc7c84b9 100644 --- a/web_ir_actions_act_window_message/README.rst +++ b/web_ir_actions_act_window_message/README.rst @@ -53,8 +53,6 @@ Depend on this module and return 'message': _('My message'), # optional title of the close button, if not set, will be _('Close') # if set False, no close button will be shown - # you can create your own close button with an action of type - # ir.actions.act_window_close 'close_button_title': 'Make this window go away', # Use HTML instead of text 'is_html_message': True, diff --git a/web_ir_actions_act_window_message/readme/USAGE.md b/web_ir_actions_act_window_message/readme/USAGE.md index 0077754da0c2..d9bbccfd8a30 100644 --- a/web_ir_actions_act_window_message/readme/USAGE.md +++ b/web_ir_actions_act_window_message/readme/USAGE.md @@ -7,8 +7,6 @@ Depend on this module and return 'message': _('My message'), # optional title of the close button, if not set, will be _('Close') # if set False, no close button will be shown - # you can create your own close button with an action of type - # ir.actions.act_window_close 'close_button_title': 'Make this window go away', # Use HTML instead of text 'is_html_message': True, diff --git a/web_ir_actions_act_window_message/static/description/index.html b/web_ir_actions_act_window_message/static/description/index.html index 5a98ab77f9e0..dd645880fe23 100644 --- a/web_ir_actions_act_window_message/static/description/index.html +++ b/web_ir_actions_act_window_message/static/description/index.html @@ -401,8 +401,6 @@

Usage

'message': _('My message'), # optional title of the close button, if not set, will be _('Close') # if set False, no close button will be shown - # you can create your own close button with an action of type - # ir.actions.act_window_close 'close_button_title': 'Make this window go away', # Use HTML instead of text 'is_html_message': True, From 29f93e71f798616b9268ae3727f2612294b31e04 Mon Sep 17 00:00:00 2001 From: Holger Brunn Date: Fri, 7 Nov 2025 16:13:04 +0100 Subject: [PATCH 111/454] [DEL] web_ir_actions_act_window_message: remove entry from roadmap this possible now already with web_notify (cherry picked from commit 827a6729bd448838551ee494c41c911da93346ac) --- web_ir_actions_act_window_message/README.rst | 1 - web_ir_actions_act_window_message/readme/ROADMAP.md | 1 - web_ir_actions_act_window_message/static/description/index.html | 1 - 3 files changed, 3 deletions(-) diff --git a/web_ir_actions_act_window_message/README.rst b/web_ir_actions_act_window_message/README.rst index e4b8cc7c84b9..e183c7999849 100644 --- a/web_ir_actions_act_window_message/README.rst +++ b/web_ir_actions_act_window_message/README.rst @@ -94,7 +94,6 @@ Known issues / Roadmap ====================== - add message_type to differenciate between warnings, errors, etc. -- have one message_type to show a nonmodal warning on top right Bug Tracker =========== diff --git a/web_ir_actions_act_window_message/readme/ROADMAP.md b/web_ir_actions_act_window_message/readme/ROADMAP.md index fdc126a7b20f..44d6a4be5ded 100644 --- a/web_ir_actions_act_window_message/readme/ROADMAP.md +++ b/web_ir_actions_act_window_message/readme/ROADMAP.md @@ -1,2 +1 @@ - add message_type to differenciate between warnings, errors, etc. -- have one message_type to show a nonmodal warning on top right diff --git a/web_ir_actions_act_window_message/static/description/index.html b/web_ir_actions_act_window_message/static/description/index.html index dd645880fe23..3c0f50b9571f 100644 --- a/web_ir_actions_act_window_message/static/description/index.html +++ b/web_ir_actions_act_window_message/static/description/index.html @@ -441,7 +441,6 @@

Usage

Known issues / Roadmap

  • add message_type to differenciate between warnings, errors, etc.
  • -
  • have one message_type to show a nonmodal warning on top right
From 459f95754ed38c82962509aa3396ffaa691f0d8c Mon Sep 17 00:00:00 2001 From: sergio Date: Thu, 28 Aug 2025 12:03:33 +0200 Subject: [PATCH 112/454] fix error: env.services.rpc is not a function (cherry picked from commit 613a71edc6e6f5cb5376ea6db8003d9fba06cd96) --- web_ir_actions_act_window_message/README.rst | 1 + .../readme/CONTRIBUTORS.md | 2 + .../static/description/index.html | 1 + .../web_ir_actions_act_window_message.esm.js | 1 - ...ir_actions_act_window_msg_component.esm.js | 51 +++++++++++-------- 5 files changed, 35 insertions(+), 21 deletions(-) diff --git a/web_ir_actions_act_window_message/README.rst b/web_ir_actions_act_window_message/README.rst index e183c7999849..6fc907dc4286 100644 --- a/web_ir_actions_act_window_message/README.rst +++ b/web_ir_actions_act_window_message/README.rst @@ -123,6 +123,7 @@ Contributors - Ioan Galan (Studio73) - Abraham Anes (Studio73) - Miguel Gandia (Studio73) +- Sergio Martínez (Studio73) - `DynApps NV `__: - Koen Loodts diff --git a/web_ir_actions_act_window_message/readme/CONTRIBUTORS.md b/web_ir_actions_act_window_message/readme/CONTRIBUTORS.md index ef72ec137efc..dcc775ef199e 100644 --- a/web_ir_actions_act_window_message/readme/CONTRIBUTORS.md +++ b/web_ir_actions_act_window_message/readme/CONTRIBUTORS.md @@ -4,6 +4,8 @@ - Ioan Galan (Studio73) \<\> - Abraham Anes (Studio73) \<\> - Miguel Gandia (Studio73) \<\> +- Sergio Martínez (Studio73) \<\> - [DynApps NV](https://www.dynapps.be): - Koen Loodts - Raf Ven + diff --git a/web_ir_actions_act_window_message/static/description/index.html b/web_ir_actions_act_window_message/static/description/index.html index 3c0f50b9571f..b1a76c7be2c2 100644 --- a/web_ir_actions_act_window_message/static/description/index.html +++ b/web_ir_actions_act_window_message/static/description/index.html @@ -469,6 +469,7 @@

Contributors

  • Ioan Galan (Studio73) <ioan@studio73.es>
  • Abraham Anes (Studio73) <abraham@studio73.es>
  • Miguel Gandia (Studio73) <miguel@studio73.es>
  • +
  • Sergio Martínez (Studio73) <sergio.martinez@studio73.es>
  • DynApps NV:
    • Koen Loodts
    • Raf Ven
    • diff --git a/web_ir_actions_act_window_message/static/src/js/web_ir_actions_act_window_message.esm.js b/web_ir_actions_act_window_message/static/src/js/web_ir_actions_act_window_message.esm.js index 8be74551c6ea..510f48b82e5c 100644 --- a/web_ir_actions_act_window_message/static/src/js/web_ir_actions_act_window_message.esm.js +++ b/web_ir_actions_act_window_message/static/src/js/web_ir_actions_act_window_message.esm.js @@ -11,7 +11,6 @@ function openDialog({env, action}) { action: action, is_html_message: action.is_html_message, size: "md", - env: env, }); } diff --git a/web_ir_actions_act_window_message/static/src/js/web_ir_actions_act_window_msg_component.esm.js b/web_ir_actions_act_window_message/static/src/js/web_ir_actions_act_window_msg_component.esm.js index 1c72aa96370f..fbf4f010ec6c 100644 --- a/web_ir_actions_act_window_message/static/src/js/web_ir_actions_act_window_msg_component.esm.js +++ b/web_ir_actions_act_window_message/static/src/js/web_ir_actions_act_window_msg_component.esm.js @@ -1,9 +1,13 @@ import {Component, onWillStart, useState} from "@odoo/owl"; import {Dialog} from "@web/core/dialog/dialog"; import {_t} from "@web/core/l10n/translation"; +import {useService} from "@web/core/utils/hooks"; +import {router} from "@web/core/browser/router"; export class ActWindowMessageDialog extends Component { setup() { + this.orm = useService("orm"); + this.action = useService("action"); this.state = useState({ buttons: [], }); @@ -14,23 +18,28 @@ export class ActWindowMessageDialog extends Component { this.generateButtons(); } - _refreshWidget(env) { - const controller = env.services.action.currentController; - const state = env.services.router.current.hash; + _refreshWidget() { + const controller = this.action.currentController; + const state = router.current; const props = controller.props; - env.services.action.switchView(props.type, {resId: state.id}); + this.action + .switchView(props.type, { + resId: state.resId, + }) + .catch((err) => { + console.error("Error updating the view:", err); + window.location.reload(); + }); } generateButtons() { var self = this; const action = self.props.action; - const env = self.props.env; if (action.close_button_title !== false) { self.state.buttons.push({ name: action.close_button_title || _t("Close"), click: () => { - // Refresh the view before closing the dialog - self._refreshWidget(env); + self._refreshWidget(); self.props.close(); }, classes: "btn btn-default", @@ -43,23 +52,26 @@ export class ActWindowMessageDialog extends Component { classes: button.classes || "btn btn-default", click: () => { if (button.type === "method") { - env.services - .rpc("/web/dataset/call_button", { - model: button.model, - method: button.method, - args: button.args, - kwargs: button.kwargs, - }) - .then(function (result) { + self.orm + .call( + button.model, + button.method, + button.args, + button.kwargs + ) + .then((result) => { if (typeof result === "object") { - return env.services.action.doAction(result); + return self.action.doAction(result).then(() => { + self.props.close(); + }); } - self._refreshWidget(env); + self._refreshWidget(); }); } else { - return env.services.action.doAction(button); + return self.action.doAction(button).then(() => { + self.props.close(); + }); } - self.props.close(); }, }; self.state.buttons.push(button_data); @@ -82,7 +94,6 @@ ActWindowMessageDialog.props = { optional: true, }, action: {type: Object, optional: true}, - env: {type: Object, optional: true}, is_html_message: {type: Boolean, optional: true}, size: {type: String}, close: Function, From 4e6a1b709324722cf1d0dd8da1e98b79c5cceac2 Mon Sep 17 00:00:00 2001 From: Vicent-S73 Date: Tue, 25 Nov 2025 11:42:19 +0100 Subject: [PATCH 113/454] fixup! [MIG] web_ir_actions_act_window_message: Migration to 19.0 --- .../src/js/web_ir_actions_act_window_msg_component.esm.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/web_ir_actions_act_window_message/static/src/js/web_ir_actions_act_window_msg_component.esm.js b/web_ir_actions_act_window_message/static/src/js/web_ir_actions_act_window_msg_component.esm.js index fbf4f010ec6c..941fc6d517e5 100644 --- a/web_ir_actions_act_window_message/static/src/js/web_ir_actions_act_window_msg_component.esm.js +++ b/web_ir_actions_act_window_message/static/src/js/web_ir_actions_act_window_msg_component.esm.js @@ -21,7 +21,15 @@ export class ActWindowMessageDialog extends Component { _refreshWidget() { const controller = this.action.currentController; const state = router.current; + if (!controller || !controller.props || !state || !state.resId) { + console.warn("ActWindowMessageDialog: unable to refresh view"); + return; + } const props = controller.props; + if (!props.type) { + console.warn("Controller props.type is missing, cannot switch view"); + return; + } this.action .switchView(props.type, { resId: state.resId, From 78a920e9db053332cf0b39ba8d595d7dd2e1294f Mon Sep 17 00:00:00 2001 From: Nicolas JEUDY Date: Tue, 19 Nov 2013 00:12:30 +0100 Subject: [PATCH 114/454] - Rename web_m2o_enhanced to web_m2x_options - Add static/description/index.html fix: use include instead of extend in js function inheritance. fix: not overwriting the existing object references with the result of the include fix: update name according to new module name. fix: error when displaying many2many field without options defined. --- web_m2x_options/README.rst | 63 +++ web_m2x_options/__init__.py | 0 web_m2x_options/__openerp__.py | 46 +++ web_m2x_options/static/description/index.html | 391 ++++++++++++++++++ web_m2x_options/static/src/js/form.js | 224 ++++++++++ 5 files changed, 724 insertions(+) create mode 100644 web_m2x_options/README.rst create mode 100644 web_m2x_options/__init__.py create mode 100644 web_m2x_options/__openerp__.py create mode 100644 web_m2x_options/static/description/index.html create mode 100644 web_m2x_options/static/src/js/form.js diff --git a/web_m2x_options/README.rst b/web_m2x_options/README.rst new file mode 100644 index 000000000000..2b1fafdb57a2 --- /dev/null +++ b/web_m2x_options/README.rst @@ -0,0 +1,63 @@ +================================== +Add new options for many2one field +================================== + + +Description +----------- + +This modules modifies "many2one" form fields so as to add some new display +control options. + +** New: support many2manytags widget ! ** + +Options provided includes possibility to remove "Create..." and/or "Create and +Edit..." entries from many2one drop down. You can also change default number of +proposition appearing in the drop-down. Or prevent the dialog box poping in +case of validation error. + +If not specified, the module will avoid proposing any of the create options +if the current user have no permission rights to create the related object. + + +Requirements +------------ + +Was tested on openerp v7.0 + + +New option +---------- + +``create`` *boolean* (Default: depends if user have create rights) + + Whether to display the "Create..." entry in dropdown panel. + +``create_edit`` *boolean* (Default: depends if user have create rights) + + Whether to display "Create and Edit..." entry in dropdown panel + +``m2o_dialog`` *boolean* (Default: depends if user have create rights) + + Whether to display the many2one dialog in case of validation error. + +``limit`` *int* (Default: openerp default value is ``7``) + + Number of displayed record in drop-down panel + + +Example +------- + +Your XML form view definition could contain:: + + ... + + ... + +Note +---- + +Double check that you have no inherited view that remote ``options`` you set on a field ! +If nothing work, add a debugger in the first ligne of ``get_search_result method`` and enable debug mode in OpenERP. When you write something in a many2one field, javascript debugger should pause. If not verify your installation. + diff --git a/web_m2x_options/__init__.py b/web_m2x_options/__init__.py new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/web_m2x_options/__openerp__.py b/web_m2x_options/__openerp__.py new file mode 100644 index 000000000000..f428885e4a5e --- /dev/null +++ b/web_m2x_options/__openerp__.py @@ -0,0 +1,46 @@ +# -*- coding: utf-8 -*- + +{ + "name": 'web_m2x_options', + "version": "0.1", + "description": +""" +===================================================== +Add new options for many2one and many2manytags field: +===================================================== + +- create: true/false -> disable "create" entry in dropdown panel +- create_edit: true/false -> disable "create and edit" entry in dropdown panel +- limit: 10 (int) -> change number of selected record return in dropdown panel +- m2o_dialog: true/false -> disable quick create M20Dialog triggered on error. + +Example: +-------- + + + +Note: +----- + +if one of those options are not set, many2one field use default many2one field options. + +Thanks to: +---------- + +- Nicolas JEUDY +- Valentin LAB + +""", + "depends": [ + 'base', + 'web', + ], + "js": [ + 'static/src/js/form.js', + ], + "author": "Tuxservices", + "installable" : True, + "active" : False, +} + + diff --git a/web_m2x_options/static/description/index.html b/web_m2x_options/static/description/index.html new file mode 100644 index 000000000000..30abedb7a5d9 --- /dev/null +++ b/web_m2x_options/static/description/index.html @@ -0,0 +1,391 @@ + + + + + + +Add new options for many2one field + + + +
      +

      Add new options for many2one field

      + +
      +

      Description

      +

      This modules modifies "many2one" form fields so as to add some new display +control options.

      +

      ** New: support many2manytags widget ! **

      +

      Options provided includes possibility to remove "Create..." and/or "Create and +Edit..." entries from many2one drop down. You can also change default number of +proposition appearing in the drop-down. Or prevent the dialog box poping in +case of validation error.

      +

      If not specified, the module will avoid proposing any of the create options +if the current user have no permission rights to create the related object.

      +
      +
      +

      Requirements

      +

      Was tested on openerp v7.0

      +
      +
      +

      New option

      +

      create boolean (Default: depends if user have create rights)

      +
      +Whether to display the "Create..." entry in dropdown panel.
      +

      create_edit boolean (Default: depends if user have create rights)

      +
      +Whether to display "Create and Edit..." entry in dropdown panel
      +

      m2o_dialog boolean (Default: depends if user have create rights)

      +
      +Whether to display the many2one dialog in case of validation error.
      +

      limit int (Default: openerp default value is 7)

      +
      +Number of displayed record in drop-down panel
      +
      +
      +

      Example

      +

      Your XML form view definition could contain:

      +
      +...
      +<field name="partner_id" options="{'limit': 10, 'create': false, 'create_edit': false}"/>
      +...
      +
      +
      +
      +

      Note

      +

      Double check that you have no inherited view that remote options you set on a field ! +If nothing work, add a debugger in the first ligne of get_search_result method and enable debug mode in OpenERP. When you write something in a many2one field, javascript debugger should pause. If not verify your installation.

      +
      +
      + + diff --git a/web_m2x_options/static/src/js/form.js b/web_m2x_options/static/src/js/form.js new file mode 100644 index 000000000000..00885a098b54 --- /dev/null +++ b/web_m2x_options/static/src/js/form.js @@ -0,0 +1,224 @@ +/*global openerp, _, $ */ + +openerp.web_m2x_options = function (instance) { + + "use strict"; + + var QWeb = instance.web.qweb, + _t = instance.web._t, + _lt = instance.web._lt; + + instance.web.form.FieldMany2One.include({ + + show_error_displayer: function () { + if ((typeof this.options.m2o_dialog === 'undefined' && this.can_create) || + this.options.m2o_dialog) { + new instance.web.form.M2ODialog(this).open(); + } + }, + + get_search_result: function (search_val) { + + var def = $.Deferred(); + var self = this; + // add options limit used to change number of selections record + // returned. + + if (typeof this.options.limit === 'number') { + this.limit = this.options.limit; + } + + var dataset = new instance.web.DataSet(this, this.field.relation, + self.build_context()); + var blacklist = this.get_search_blacklist(); + this.last_query = search_val; + + var search_result = this.orderer.add(dataset.name_search( + search_val, + new instance.web.CompoundDomain( + self.build_domain(), [["id", "not in", blacklist]]), + 'ilike', this.limit + 1, + self.build_context())); + + var create_rights; + if (typeof this.options.create === "undefined" || + typeof this.options.create_edit === "undefined") { + create_rights = new instance.web.Model(this.field.relation).call( + "check_access_rights", ["create", false]); + } + + $.when(search_result, create_rights).then(function (_data, _can_create) { + var data = _data[0]; + + var can_create = _can_create ? _can_create[0] : null; + + self.can_create = can_create; // for ``.show_error_displayer()`` + self.last_search = data; + // possible selections for the m2o + var values = _.map(data, function (x) { + x[1] = x[1].split("\n")[0]; + return { + label: _.str.escapeHTML(x[1]), + value: x[1], + name: x[1], + id: x[0], + }; + }); + + // search more... if more results that max + + if (values.length > self.limit) { + values = values.slice(0, self.limit); + values.push({ + label: _t("Search More..."), + action: function () { + dataset.name_search( + search_val, self.build_domain(), + 'ilike', false).done(function (data) { + self._search_create_popup("search", data); + }); + }, + classname: 'oe_m2o_dropdown_option' + }); + } + + // quick create + + var raw_result = _(data.result).map(function (x) { + return x[1]; + }); + + if ((typeof self.options.create === 'undefined' && can_create) || + self.options.create) { + + if (search_val.length > 0 && + !_.include(raw_result, search_val)) { + + values.push({ + label: _.str.sprintf( + _t('Create "%s"'), + $('').text(search_val).html()), + action: function () { + self._quick_create(search_val); + }, + classname: 'oe_m2o_dropdown_option' + }); + } + } + + // create... + + if ((typeof self.options.create_edit === 'undefined' && can_create) || + self.options.create_edit) { + + values.push({ + label: _t("Create and Edit..."), + action: function () { + self._search_create_popup( + "form", undefined, + self._create_context(search_val)); + }, + classname: 'oe_m2o_dropdown_option' + }); + } + + def.resolve(values); + }); + + return def; + } + }); + + instance.web.form.FieldMany2ManyTags.include({ + + show_error_displayer: function () { + if ((typeof this.options.m2o_dialog === 'undefined' && this.can_create) || + this.options.m2o_dialog) { + new instance.web.form.M2ODialog(this).open(); + } + }, + + /** + * Call this method to search using a string. + */ + + get_search_result: function(search_val) { + var self = this; + + // add options limit used to change number of selections record + // returned. + + if (typeof this.options.limit === 'number') { + this.limit = this.options.limit; + } + + var dataset = new instance.web.DataSet(this, this.field.relation, self.build_context()); + var blacklist = this.get_search_blacklist(); + this.last_query = search_val; + + return this.orderer.add(dataset.name_search( + search_val, new instance.web.CompoundDomain(self.build_domain(), [["id", "not in", blacklist]]), + 'ilike', this.limit + 1, self.build_context())).then(function(data) { + self.last_search = data; + // possible selections for the m2o + var values = _.map(data, function(x) { + x[1] = x[1].split("\n")[0]; + return { + label: _.str.escapeHTML(x[1]), + value: x[1], + name: x[1], + id: x[0], + }; + }); + + // search more... if more results that max + if (values.length > self.limit) { + values = values.slice(0, self.limit); + values.push({ + label: _t("Search More..."), + action: function() { + dataset.name_search(search_val, self.build_domain(), 'ilike', false).done(function(data) { + self._search_create_popup("search", data); + }); + }, + classname: 'oe_m2o_dropdown_option' + }); + } + // quick create + + if ((typeof self.options.create === 'undefined') || + self.options.create) { + + var raw_result = _(data.result).map(function(x) {return x[1];}); + if (search_val.length > 0 && !_.include(raw_result, search_val)) { + values.push({ + label: _.str.sprintf(_t('Create "%s"'), + $('').text(search_val).html()), + action: function() { + self._quick_create(search_val); + }, + classname: 'oe_m2o_dropdown_option' + }); + } + } + + // create... + + if ((typeof self.options.create_edit === 'undefined') || + self.options.create_edit) { + + values.push({ + label: _t("Create and Edit..."), + action: function() { + self._search_create_popup("form", undefined, self._create_context(search_val)); + }, + classname: 'oe_m2o_dropdown_option' + }); + } + + return values; + }) + }, + }); +}; + From 53bac334c75379ad429b21612c2565945da16fa4 Mon Sep 17 00:00:00 2001 From: Holger Brunn Date: Mon, 7 Jul 2014 13:11:28 +0200 Subject: [PATCH 115/454] move all addons to __unported__, set all addons as not installable --- web_m2x_options/README.rst | 63 --- web_m2x_options/__init__.py | 0 web_m2x_options/__openerp__.py | 46 --- web_m2x_options/static/description/index.html | 391 ------------------ web_m2x_options/static/src/js/form.js | 224 ---------- 5 files changed, 724 deletions(-) delete mode 100644 web_m2x_options/README.rst delete mode 100644 web_m2x_options/__init__.py delete mode 100644 web_m2x_options/__openerp__.py delete mode 100644 web_m2x_options/static/description/index.html delete mode 100644 web_m2x_options/static/src/js/form.js diff --git a/web_m2x_options/README.rst b/web_m2x_options/README.rst deleted file mode 100644 index 2b1fafdb57a2..000000000000 --- a/web_m2x_options/README.rst +++ /dev/null @@ -1,63 +0,0 @@ -================================== -Add new options for many2one field -================================== - - -Description ------------ - -This modules modifies "many2one" form fields so as to add some new display -control options. - -** New: support many2manytags widget ! ** - -Options provided includes possibility to remove "Create..." and/or "Create and -Edit..." entries from many2one drop down. You can also change default number of -proposition appearing in the drop-down. Or prevent the dialog box poping in -case of validation error. - -If not specified, the module will avoid proposing any of the create options -if the current user have no permission rights to create the related object. - - -Requirements ------------- - -Was tested on openerp v7.0 - - -New option ----------- - -``create`` *boolean* (Default: depends if user have create rights) - - Whether to display the "Create..." entry in dropdown panel. - -``create_edit`` *boolean* (Default: depends if user have create rights) - - Whether to display "Create and Edit..." entry in dropdown panel - -``m2o_dialog`` *boolean* (Default: depends if user have create rights) - - Whether to display the many2one dialog in case of validation error. - -``limit`` *int* (Default: openerp default value is ``7``) - - Number of displayed record in drop-down panel - - -Example -------- - -Your XML form view definition could contain:: - - ... - - ... - -Note ----- - -Double check that you have no inherited view that remote ``options`` you set on a field ! -If nothing work, add a debugger in the first ligne of ``get_search_result method`` and enable debug mode in OpenERP. When you write something in a many2one field, javascript debugger should pause. If not verify your installation. - diff --git a/web_m2x_options/__init__.py b/web_m2x_options/__init__.py deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/web_m2x_options/__openerp__.py b/web_m2x_options/__openerp__.py deleted file mode 100644 index f428885e4a5e..000000000000 --- a/web_m2x_options/__openerp__.py +++ /dev/null @@ -1,46 +0,0 @@ -# -*- coding: utf-8 -*- - -{ - "name": 'web_m2x_options', - "version": "0.1", - "description": -""" -===================================================== -Add new options for many2one and many2manytags field: -===================================================== - -- create: true/false -> disable "create" entry in dropdown panel -- create_edit: true/false -> disable "create and edit" entry in dropdown panel -- limit: 10 (int) -> change number of selected record return in dropdown panel -- m2o_dialog: true/false -> disable quick create M20Dialog triggered on error. - -Example: --------- - - - -Note: ------ - -if one of those options are not set, many2one field use default many2one field options. - -Thanks to: ----------- - -- Nicolas JEUDY -- Valentin LAB - -""", - "depends": [ - 'base', - 'web', - ], - "js": [ - 'static/src/js/form.js', - ], - "author": "Tuxservices", - "installable" : True, - "active" : False, -} - - diff --git a/web_m2x_options/static/description/index.html b/web_m2x_options/static/description/index.html deleted file mode 100644 index 30abedb7a5d9..000000000000 --- a/web_m2x_options/static/description/index.html +++ /dev/null @@ -1,391 +0,0 @@ - - - - - - -Add new options for many2one field - - - -
      -

      Add new options for many2one field

      - -
      -

      Description

      -

      This modules modifies "many2one" form fields so as to add some new display -control options.

      -

      ** New: support many2manytags widget ! **

      -

      Options provided includes possibility to remove "Create..." and/or "Create and -Edit..." entries from many2one drop down. You can also change default number of -proposition appearing in the drop-down. Or prevent the dialog box poping in -case of validation error.

      -

      If not specified, the module will avoid proposing any of the create options -if the current user have no permission rights to create the related object.

      -
      -
      -

      Requirements

      -

      Was tested on openerp v7.0

      -
      -
      -

      New option

      -

      create boolean (Default: depends if user have create rights)

      -
      -Whether to display the "Create..." entry in dropdown panel.
      -

      create_edit boolean (Default: depends if user have create rights)

      -
      -Whether to display "Create and Edit..." entry in dropdown panel
      -

      m2o_dialog boolean (Default: depends if user have create rights)

      -
      -Whether to display the many2one dialog in case of validation error.
      -

      limit int (Default: openerp default value is 7)

      -
      -Number of displayed record in drop-down panel
      -
      -
      -

      Example

      -

      Your XML form view definition could contain:

      -
      -...
      -<field name="partner_id" options="{'limit': 10, 'create': false, 'create_edit': false}"/>
      -...
      -
      -
      -
      -

      Note

      -

      Double check that you have no inherited view that remote options you set on a field ! -If nothing work, add a debugger in the first ligne of get_search_result method and enable debug mode in OpenERP. When you write something in a many2one field, javascript debugger should pause. If not verify your installation.

      -
      -
      - - diff --git a/web_m2x_options/static/src/js/form.js b/web_m2x_options/static/src/js/form.js deleted file mode 100644 index 00885a098b54..000000000000 --- a/web_m2x_options/static/src/js/form.js +++ /dev/null @@ -1,224 +0,0 @@ -/*global openerp, _, $ */ - -openerp.web_m2x_options = function (instance) { - - "use strict"; - - var QWeb = instance.web.qweb, - _t = instance.web._t, - _lt = instance.web._lt; - - instance.web.form.FieldMany2One.include({ - - show_error_displayer: function () { - if ((typeof this.options.m2o_dialog === 'undefined' && this.can_create) || - this.options.m2o_dialog) { - new instance.web.form.M2ODialog(this).open(); - } - }, - - get_search_result: function (search_val) { - - var def = $.Deferred(); - var self = this; - // add options limit used to change number of selections record - // returned. - - if (typeof this.options.limit === 'number') { - this.limit = this.options.limit; - } - - var dataset = new instance.web.DataSet(this, this.field.relation, - self.build_context()); - var blacklist = this.get_search_blacklist(); - this.last_query = search_val; - - var search_result = this.orderer.add(dataset.name_search( - search_val, - new instance.web.CompoundDomain( - self.build_domain(), [["id", "not in", blacklist]]), - 'ilike', this.limit + 1, - self.build_context())); - - var create_rights; - if (typeof this.options.create === "undefined" || - typeof this.options.create_edit === "undefined") { - create_rights = new instance.web.Model(this.field.relation).call( - "check_access_rights", ["create", false]); - } - - $.when(search_result, create_rights).then(function (_data, _can_create) { - var data = _data[0]; - - var can_create = _can_create ? _can_create[0] : null; - - self.can_create = can_create; // for ``.show_error_displayer()`` - self.last_search = data; - // possible selections for the m2o - var values = _.map(data, function (x) { - x[1] = x[1].split("\n")[0]; - return { - label: _.str.escapeHTML(x[1]), - value: x[1], - name: x[1], - id: x[0], - }; - }); - - // search more... if more results that max - - if (values.length > self.limit) { - values = values.slice(0, self.limit); - values.push({ - label: _t("Search More..."), - action: function () { - dataset.name_search( - search_val, self.build_domain(), - 'ilike', false).done(function (data) { - self._search_create_popup("search", data); - }); - }, - classname: 'oe_m2o_dropdown_option' - }); - } - - // quick create - - var raw_result = _(data.result).map(function (x) { - return x[1]; - }); - - if ((typeof self.options.create === 'undefined' && can_create) || - self.options.create) { - - if (search_val.length > 0 && - !_.include(raw_result, search_val)) { - - values.push({ - label: _.str.sprintf( - _t('Create "%s"'), - $('').text(search_val).html()), - action: function () { - self._quick_create(search_val); - }, - classname: 'oe_m2o_dropdown_option' - }); - } - } - - // create... - - if ((typeof self.options.create_edit === 'undefined' && can_create) || - self.options.create_edit) { - - values.push({ - label: _t("Create and Edit..."), - action: function () { - self._search_create_popup( - "form", undefined, - self._create_context(search_val)); - }, - classname: 'oe_m2o_dropdown_option' - }); - } - - def.resolve(values); - }); - - return def; - } - }); - - instance.web.form.FieldMany2ManyTags.include({ - - show_error_displayer: function () { - if ((typeof this.options.m2o_dialog === 'undefined' && this.can_create) || - this.options.m2o_dialog) { - new instance.web.form.M2ODialog(this).open(); - } - }, - - /** - * Call this method to search using a string. - */ - - get_search_result: function(search_val) { - var self = this; - - // add options limit used to change number of selections record - // returned. - - if (typeof this.options.limit === 'number') { - this.limit = this.options.limit; - } - - var dataset = new instance.web.DataSet(this, this.field.relation, self.build_context()); - var blacklist = this.get_search_blacklist(); - this.last_query = search_val; - - return this.orderer.add(dataset.name_search( - search_val, new instance.web.CompoundDomain(self.build_domain(), [["id", "not in", blacklist]]), - 'ilike', this.limit + 1, self.build_context())).then(function(data) { - self.last_search = data; - // possible selections for the m2o - var values = _.map(data, function(x) { - x[1] = x[1].split("\n")[0]; - return { - label: _.str.escapeHTML(x[1]), - value: x[1], - name: x[1], - id: x[0], - }; - }); - - // search more... if more results that max - if (values.length > self.limit) { - values = values.slice(0, self.limit); - values.push({ - label: _t("Search More..."), - action: function() { - dataset.name_search(search_val, self.build_domain(), 'ilike', false).done(function(data) { - self._search_create_popup("search", data); - }); - }, - classname: 'oe_m2o_dropdown_option' - }); - } - // quick create - - if ((typeof self.options.create === 'undefined') || - self.options.create) { - - var raw_result = _(data.result).map(function(x) {return x[1];}); - if (search_val.length > 0 && !_.include(raw_result, search_val)) { - values.push({ - label: _.str.sprintf(_t('Create "%s"'), - $('').text(search_val).html()), - action: function() { - self._quick_create(search_val); - }, - classname: 'oe_m2o_dropdown_option' - }); - } - } - - // create... - - if ((typeof self.options.create_edit === 'undefined') || - self.options.create_edit) { - - values.push({ - label: _t("Create and Edit..."), - action: function() { - self._search_create_popup("form", undefined, self._create_context(search_val)); - }, - classname: 'oe_m2o_dropdown_option' - }); - } - - return values; - }) - }, - }); -}; - From bc09b3155af92620f410474727b36a0a76043ed3 Mon Sep 17 00:00:00 2001 From: Nicolas JEUDY Date: Mon, 5 Jan 2015 12:24:37 +0100 Subject: [PATCH 116/454] fix: obscur wrong path on last commit. recreate portage from scratch. --- web_m2x_options/README.rst | 115 +++++ web_m2x_options/__init__.py | 0 web_m2x_options/__openerp__.py | 14 + web_m2x_options/static/description/icon.png | Bin 0 -> 9455 bytes web_m2x_options/static/description/index.html | 412 ++++++++++++++++++ web_m2x_options/static/src/js/form.js | 341 +++++++++++++++ web_m2x_options/views/view.xml | 12 + 7 files changed, 894 insertions(+) create mode 100644 web_m2x_options/README.rst create mode 100644 web_m2x_options/__init__.py create mode 100644 web_m2x_options/__openerp__.py create mode 100644 web_m2x_options/static/description/icon.png create mode 100644 web_m2x_options/static/description/index.html create mode 100644 web_m2x_options/static/src/js/form.js create mode 100644 web_m2x_options/views/view.xml diff --git a/web_m2x_options/README.rst b/web_m2x_options/README.rst new file mode 100644 index 000000000000..be6e76039157 --- /dev/null +++ b/web_m2x_options/README.rst @@ -0,0 +1,115 @@ +================================== +Add new options for many2one field +================================== + + +Description +----------- + +This modules modifies "many2one" and "many2manytags" form widgets so as to add some new display +control options. + +**New: support many2manytags widget !** + +**New: support global option management with ir.config_parameter !** + +Options provided includes possibility to remove "Create..." and/or "Create and +Edit..." entries from many2one drop down. You can also change default number of +proposition appearing in the drop-down. Or prevent the dialog box poping in +case of validation error. + +If not specified, the module will avoid proposing any of the create options +if the current user have no permission rights to create the related object. + + +Requirements +------------ + +Was tested on openerp 8.0, trunk, saas-5 branch. New way to import js file. (thanks to tfossoul) + + +New options +----------- + +``create`` *boolean* (Default: depends if user have create rights) + + Whether to display the "Create..." entry in dropdown panel. + +``create_edit`` *boolean* (Default: depends if user have create rights) + + Whether to display "Create and Edit..." entry in dropdown panel + +``m2o_dialog`` *boolean* (Default: depends if user have create rights) + + Whether to display the many2one dialog in case of validation error. + +``limit`` *int* (Default: openerp default value is ``7``) + + Number of displayed record in drop-down panel + +``search_more`` *boolean* + + Used to force disable/enable search more button. + +``field_color`` *string* + + A string to define the field used to define color. + This option has to be used with colors. + +``colors`` *dictionary* + + A dictionary to link field value with a HTML color. + This option has to be used with field_color. + + + +ir.config_parameter options +--------------------------- + +Now you can disable "Create..." and "Create and Edit..." entry for all widgets in the odoo instance. +If you disable one option, you can enable it for particular field by setting "create: True" option directly on the field definition. + +``web_m2x_options.create`` *boolean* (Default: depends if user have create rights) + + Whether to display the "Create..." entry in dropdown panel for all fields in the odoo instance. + +``web_m2x_options.create_edit`` *boolean* (Default: depends if user have create rights) + + Whether to display "Create and Edit..." entry in dropdown panel for all fields in the odoo instance. + +``web_m2x_options.m2o_dialog`` *boolean* (Default: depends if user have create rights) + + Whether to display the many2one dialog in case of validation error for all fields in the odoo instance. + +``web_m2x_options.limit`` *int* (Default: openerp default value is ``7``) + + Number of displayed record in drop-down panel for all fields in the odoo instance + +``web_m2x_options.search_more`` *boolean* (Default: default value is ``False``) + + Whether the field should always show "Search more..." entry or not. + +To add these parameters go to Configuration -> Technical -> Parameters -> System Parameters and add new parameters like: + +- web_m2x_options.create: False +- web_m2x_options.create_edit: False +- web_m2x_options.m2o_dialog: False +- web_m2x_options.limit: 10 +- web_m2x_options.search_more: True + + +Example +------- + +Your XML form view definition could contain:: + + ... + + ... + +Note +---- + +Double check that you have no inherited view that remote ``options`` you set on a field ! +If nothing work, add a debugger in the first ligne of ``get_search_result method`` and enable debug mode in OpenERP. When you write something in a many2one field, javascript debugger should pause. If not verify your installation. + diff --git a/web_m2x_options/__init__.py b/web_m2x_options/__init__.py new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/web_m2x_options/__openerp__.py b/web_m2x_options/__openerp__.py new file mode 100644 index 000000000000..37b7dbf4e770 --- /dev/null +++ b/web_m2x_options/__openerp__.py @@ -0,0 +1,14 @@ +# -*- coding: utf-8 -*- + +{ + "name": 'web_m2x_options', + "version": "8.0.0.2", + "depends": [ + 'base', + 'web', + ], + 'data': ['views/view.xml'], + "author": "0k.io,Odoo Community Association (OCA)", + "installable": True, + "active": False, +} diff --git a/web_m2x_options/static/description/icon.png b/web_m2x_options/static/description/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..3a0328b516c4980e8e44cdb63fd945757ddd132d GIT binary patch literal 9455 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 z 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 Xviia!U7SGha1wx#SCgwmn*{w2TRX*I literal 0 HcmV?d00001 diff --git a/web_m2x_options/static/description/index.html b/web_m2x_options/static/description/index.html new file mode 100644 index 000000000000..bf406ab1885f --- /dev/null +++ b/web_m2x_options/static/description/index.html @@ -0,0 +1,412 @@ + + + + + + +Add new options for many2one field + + + +
      +

      Add new options for many2one field

      + +
      +

      Description

      +

      This modules modifies "many2one" and "many2manytags" form widgets so as to add some new display +control options.

      +

      New: support many2manytags widget !

      +

      New: support global option management with ir.config_parameter !

      +

      Options provided includes possibility to remove "Create..." and/or "Create and +Edit..." entries from many2one drop down. You can also change default number of +proposition appearing in the drop-down. Or prevent the dialog box poping in +case of validation error.

      +

      If not specified, the module will avoid proposing any of the create options +if the current user have no permission rights to create the related object.

      +
      +
      +

      Requirements

      +

      Was tested on openerp 8.0, trunk, saas-5 branch. New way to import js file. (thanks to tfossoul)

      +
      +
      +

      New options

      +

      create boolean (Default: depends if user have create rights)

      +
      +Whether to display the "Create..." entry in dropdown panel.
      +

      create_edit boolean (Default: depends if user have create rights)

      +
      +Whether to display "Create and Edit..." entry in dropdown panel
      +

      m2o_dialog boolean (Default: depends if user have create rights)

      +
      +Whether to display the many2one dialog in case of validation error.
      +

      limit int (Default: openerp default value is 7)

      +
      +Number of displayed record in drop-down panel
      +
      +
      +

      ir.config_parameter options

      +

      Now you can disable "Create..." and "Create and Edit..." entry for all widgets in the odoo instance. +If you disable one option, you can enable it for particular field by setting "create: True" option directly on the field definition.

      +

      web_m2x_options.create boolean (Default: depends if user have create rights)

      +
      +Whether to display the "Create..." entry in dropdown panel for all fields in the odoo instance.
      +

      web_m2x_options.create_edit boolean (Default: depends if user have create rights)

      +
      +Whether to display "Create and Edit..." entry in dropdown panel for all fields in the odoo instance.
      +

      web_m2x_options.limit int (Default: openerp default value is 7)

      +
      +Number of displayed record in drop-down panel for all fields in the odoo instance
      +

      To add these parameters go to Configuration -> Technical -> Parameters -> System Parameters and add new parameters like:

      +
        +
      • web_m2x_options.create: False
      • +
      • web_m2x_options.create_edit: False
      • +
      • web_m2x_options.limit: 10
      • +
      +
      +
      +

      Example

      +

      Your XML form view definition could contain:

      +
      +...
      +<field name="partner_id" options="{'limit': 10, 'create': false, 'create_edit': false}"/>
      +...
      +
      +
      +
      +

      Note

      +

      Double check that you have no inherited view that remote options you set on a field ! +If nothing work, add a debugger in the first ligne of get_search_result method and enable debug mode in OpenERP. When you write something in a many2one field, javascript debugger should pause. If not verify your installation.

      +
      +
      + + diff --git a/web_m2x_options/static/src/js/form.js b/web_m2x_options/static/src/js/form.js new file mode 100644 index 000000000000..bc4d3bebd335 --- /dev/null +++ b/web_m2x_options/static/src/js/form.js @@ -0,0 +1,341 @@ +/*global openerp, _, $ */ + +openerp.web_m2x_options = function (instance) { + + "use strict"; + + var QWeb = instance.web.qweb, + _t = instance.web._t, + _lt = instance.web._lt; + + var OPTIONS = ['web_m2x_options.create', + 'web_m2x_options.create_edit', + 'web_m2x_options.limit', + 'web_m2x_options.search_more', + 'web_m2x_options.m2o_dialog',]; + + instance.web.form.FieldMany2One = instance.web.form.FieldMany2One.extend({ + + start: function() { + this._super.apply(this, arguments); + return this.get_options(); + }, + + get_options: function() { + var self = this; + if (!_.isUndefined(this.view) && _.isUndefined(this.view.ir_options_loaded)) { + this.view.ir_options_loaded = $.Deferred(); + this.view.ir_options = {}; + (new instance.web.Model("ir.config_parameter")) + .query(["key", "value"]).filter([['key', 'in', OPTIONS]]) + .all().then(function(records) { + _(records).each(function(record) { + self.view.ir_options[record.key] = record.value; + }); + self.view.ir_options_loaded.resolve(); + }); + return this.view.ir_options_loaded; + } + return $.when(); + }, + + is_option_set: function(option) { + if (_.isUndefined(option)) { + return false + } + var is_string = typeof option === 'string' + var is_bool = typeof option === 'boolean' + if (is_string) { + return option === 'true' || option === 'True' + } else if (is_bool) { + return option + } + return false + }, + + show_error_displayer: function () { + if(this.is_option_set(this.options.m2o_dialog) || + _.isUndefined(this.options.m2o_dialog) && this.is_option_set(this.view.ir_options['web_m2x_options.m2o_dialog']) || + this.can_create && _.isUndefined(this.options.m2o_dialog) && _.isUndefined(this.view.ir_options['web_m2x_options.m2o_dialog'])) { + new instance.web.form.M2ODialog(this).open(); + } + }, + + get_search_result: function (search_val) { + var Objects = new instance.web.Model(this.field.relation); + var def = $.Deferred(); + var self = this; + // add options limit used to change number of selections record + // returned. + if (_.isUndefined(this.view)) + return this._super.apply(this, arguments); + if (!_.isUndefined(this.view.ir_options['web_m2x_options.limit'])) { + this.limit = parseInt(this.view.ir_options['web_m2x_options.limit']); + } + + if (typeof this.options.limit === 'number') { + this.limit = this.options.limit; + } + + // add options search_more to force enable or disable search_more button + if (this.is_option_set(this.options.search_more) || _.isUndefined(this.options.search_more) && this.is_option_set(self.view.ir_options['web_m2x_options.search_more'])) { + this.search_more = true + } + + // add options field_color and colors to color item(s) depending on field_color value + this.field_color = this.options.field_color + this.colors = this.options.colors + + var dataset = new instance.web.DataSet(this, this.field.relation, + self.build_context()); + var blacklist = this.get_search_blacklist(); + this.last_query = search_val; + + var search_result = this.orderer.add(dataset.name_search( + search_val, + new instance.web.CompoundDomain( + self.build_domain(), [["id", "not in", blacklist]]), + 'ilike', this.limit + 1, + self.build_context())); + + var create_rights; + if (typeof this.options.create === "undefined" || + typeof this.options.create_edit === "undefined") { + create_rights = new instance.web.Model(this.field.relation).call( + "check_access_rights", ["create", false]); + } + + $.when(search_result, create_rights).then(function (data, can_create) { + + self.can_create = can_create; // for ``.show_error_displayer()`` + self.last_search = data; + // possible selections for the m2o + var values = _.map(data, function (x) { + x[1] = x[1].split("\n")[0]; + return { + label: _.str.escapeHTML(x[1]), + value: x[1], + name: x[1], + id: x[0], + }; + }); + + // Search result value colors + + if (self.colors && self.field_color) { + var value_ids = []; + for (var index in values) { + value_ids.push(values[index].id); + } + + // RPC request to get field_color from Objects + Objects.query([self.field_color]) + .filter([['id', 'in', value_ids]]) + .all().done(function (objects) { + for (var index in objects) { + for (var index_value in values) { + if (values[index_value].id == objects[index].id) { + // Find value in values by comparing ids + var value = values[index_value]; + + // Find color with field value as key + var color = self.colors[objects[index][self.field_color]] || 'black'; + value.label = ''+value.label+''; + break; + } + } + } + def.resolve(values); + }); + } + + // search more... if more results that max + + if (values.length > self.limit || self.search_more) { + values = values.slice(0, self.limit); + values.push({ + label: _t("Search More..."), + action: function () { + dataset.name_search( + search_val, self.build_domain(), + 'ilike', false).done(function (data) { + self._search_create_popup("search", data); + }); + }, + classname: 'oe_m2o_dropdown_option' + }); + } + + // quick create + + var raw_result = _(data.result).map(function (x) { + return x[1]; + }); + + if ((_.isUndefined(self.options.create) && _.isUndefined(self.view.ir_options['web_m2x_options.create']) && can_create) || + (_.isUndefined(self.options.create) && self.view.ir_options['web_m2x_options.create'] == "True") || + self.options.create) { + + if (search_val.length > 0 && + !_.include(raw_result, search_val)) { + + values.push({ + label: _.str.sprintf( + _t('Create "%s"'), + $('').text(search_val).html()), + action: function () { + self._quick_create(search_val); + }, + classname: 'oe_m2o_dropdown_option' + }); + } + } + + // create... + + if ((_.isUndefined(self.options.create_edit) && _.isUndefined(self.view.ir_options['web_m2x_options.create_edit']) && can_create) || + (_.isUndefined(self.options.create) && self.view.ir_options['web_m2x_options.create_edit'] == "True") || + self.options.create_edit) { + + values.push({ + label: _t("Create and Edit..."), + action: function () { + self._search_create_popup( + "form", undefined, + self._create_context(search_val)); + }, + classname: 'oe_m2o_dropdown_option' + }); + } + + // Check if colors specified to wait for RPC + if (!(self.field_color && self.colors)){ + def.resolve(values); + } + }); + + return def; + } + }); + + instance.web.form.FieldMany2ManyTags.include({ + + show_error_displayer: function () { + if ((typeof this.options.m2o_dialog === 'undefined' && this.can_create) || + this.options.m2o_dialog) { + new instance.web.form.M2ODialog(this).open(); + } + }, + + start: function() { + this._super.apply(this, arguments); + return this.get_options(); + }, + + get_options: function() { + var self = this; + if (_.isUndefined(this.view.ir_options_loaded)) { + this.view.ir_options_loaded = $.Deferred(); + this.view.ir_options = {}; + (new instance.web.Model("ir.config_parameter")) + .query(["key", "value"]).filter([['key', 'in', OPTIONS]]) + .all().then(function(records) { + _(records).each(function(record) { + self.view.ir_options[record.key] = record.value; + }); + self.view.ir_options_loaded.resolve(); + }); + } + return this.view.ir_options_loaded; + }, + + /** + * Call this method to search using a string. + */ + + get_search_result: function(search_val) { + var self = this; + + // add options limit used to change number of selections record + // returned. + + if (!_.isUndefined(this.view.ir_options['web_m2x_options.limit'])) { + this.limit = parseInt(this.view.ir_options['web_m2x_options.limit']); + } + + if (typeof this.options.limit === 'number') { + this.limit = this.options.limit; + } + + var dataset = new instance.web.DataSet(this, this.field.relation, self.build_context()); + var blacklist = this.get_search_blacklist(); + this.last_query = search_val; + + return this.orderer.add(dataset.name_search( + search_val, new instance.web.CompoundDomain(self.build_domain(), [["id", "not in", blacklist]]), + 'ilike', this.limit + 1, self.build_context())).then(function(data) { + self.last_search = data; + // possible selections for the m2o + var values = _.map(data, function(x) { + x[1] = x[1].split("\n")[0]; + return { + label: _.str.escapeHTML(x[1]), + value: x[1], + name: x[1], + id: x[0], + }; + }); + + // search more... if more results that max + if (values.length > self.limit) { + values = values.slice(0, self.limit); + values.push({ + label: _t("Search More..."), + action: function() { + dataset.name_search(search_val, self.build_domain(), 'ilike', false).done(function(data) { + self._search_create_popup("search", data); + }); + }, + classname: 'oe_m2o_dropdown_option' + }); + } + // quick create + + if ((_.isUndefined(self.options.create) && _.isUndefined(self.view.ir_options['web_m2x_options.create'])) || + (_.isUndefined(self.options.create) && self.view.ir_options['web_m2x_options.create'] == 'True') || + self.options.create) { + + var raw_result = _(data.result).map(function(x) {return x[1];}); + if (search_val.length > 0 && !_.include(raw_result, search_val)) { + values.push({ + label: _.str.sprintf(_t('Create "%s"'), + $('').text(search_val).html()), + action: function() { + self._quick_create(search_val); + }, + classname: 'oe_m2o_dropdown_option' + }); + } + } + + // create... + + if ((_.isUndefined(self.options.create_edit === 'undefined') && _.isUndefined(self.view.ir_options['web_m2x_options.create_edit'])) || + (_.isUndefined(self.options.create) && self.view.ir_options['web_m2x_options.create_edit'] == 'True') || + self.options.create_edit) { + + values.push({ + label: _t("Create and Edit..."), + action: function() { + self._search_create_popup("form", undefined, self._create_context(search_val)); + }, + classname: 'oe_m2o_dropdown_option' + }); + } + + return values; + }) + }, + }); +}; + diff --git a/web_m2x_options/views/view.xml b/web_m2x_options/views/view.xml new file mode 100644 index 000000000000..9628625b5103 --- /dev/null +++ b/web_m2x_options/views/view.xml @@ -0,0 +1,12 @@ + + + + + + + From 09d776209a65a62831a9004f0644622efe2a4b03 Mon Sep 17 00:00:00 2001 From: Holger Brunn Date: Fri, 10 Jul 2015 15:39:06 +0200 Subject: [PATCH 117/454] support 'open' on many2many_tags [ADD] support 'no_open_edit' on many2one [FIX] typos --- web_m2x_options/README.rst | 91 +++++++++++++++++++------ web_m2x_options/__init__.py | 1 + web_m2x_options/__openerp__.py | 4 ++ web_m2x_options/static/src/js/form.js | 24 +++++++ web_m2x_options/static/src/xml/base.xml | 13 ++++ 5 files changed, 111 insertions(+), 22 deletions(-) create mode 100644 web_m2x_options/static/src/xml/base.xml diff --git a/web_m2x_options/README.rst b/web_m2x_options/README.rst index be6e76039157..de0adaac3d33 100644 --- a/web_m2x_options/README.rst +++ b/web_m2x_options/README.rst @@ -1,35 +1,35 @@ +.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg + :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html + :alt: License: AGPL-3 + ================================== Add new options for many2one field ================================== - -Description ------------ - This modules modifies "many2one" and "many2manytags" form widgets so as to add some new display control options. -**New: support many2manytags widget !** - -**New: support global option management with ir.config_parameter !** - Options provided includes possibility to remove "Create..." and/or "Create and Edit..." entries from many2one drop down. You can also change default number of proposition appearing in the drop-down. Or prevent the dialog box poping in case of validation error. If not specified, the module will avoid proposing any of the create options -if the current user have no permission rights to create the related object. +if the current user has no permission rights to create the related object. +Usage +===== -Requirements ------------- +.. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas + :alt: Try me on Runbot + :target: https://runbot.odoo-community.org/runbot/162/8.0 -Was tested on openerp 8.0, trunk, saas-5 branch. New way to import js file. (thanks to tfossoul) +For further information, please visit: +* https://www.odoo.com/forum/help-1 -New options ------------ +in the field's options dict +--------------------------- ``create`` *boolean* (Default: depends if user have create rights) @@ -47,21 +47,27 @@ New options Number of displayed record in drop-down panel -``search_more`` *boolean* +``search_more`` *boolean* Used to force disable/enable search more button. - + ``field_color`` *string* A string to define the field used to define color. This option has to be used with colors. - + ``colors`` *dictionary* A dictionary to link field value with a HTML color. This option has to be used with field_color. - +``no_open_edit`` *boolean* (Default: value of ``no_open`` which is ``False`` if not set) + + Causes a many2one not to offer to click through in edit mode, but well in read mode + +``open`` *boolean* (Default: ``False``) + + Makes many2many_tags buttons that open the linked resource ir.config_parameter options --------------------------- @@ -107,9 +113,50 @@ Your XML form view definition could contain:: ... -Note ----- +Known issues +============ + +Double check that you have no inherited view that remove ``options`` you set on a field ! +If nothing works, add a debugger in the first line of ``get_search_result method`` and enable debug mode in Odoo. When you write something in a many2one field, javascript debugger should pause. If not verify your installation. + +Roadmap +======= + +- Instead of making the tags rectangle clickable, I think it's better to put the text as a clickable link, so we will get a consistent behaviour/aspect with other clickable elements (many2one...). +- In edit mode, it would be great to add an icon like the one on many2one fields to allow to open the many2many in a popup window. +- Include this feature as a configurable option via parameter to have this behaviour by default in all many2many tags. + +Bug Tracker +=========== + +Bugs are tracked on `GitHub Issues `_. +In case of trouble, please check there if your issue has already been reported. +If you spotted it first, help us smashing it by providing a detailed and welcomed feedback +`here `_. + +Credits +======= + +Contributors +------------ + +* David Coninckx +* Emanuel Cino +* Holger Brunn +* Nicolas JEUDY +* Yannick Vaucher + +Maintainer +---------- + +.. image:: https://odoo-community.org/logo.png + :alt: Odoo Community Association + :target: https://odoo-community.org + +This module is maintained by the OCA. -Double check that you have no inherited view that remote ``options`` you set on a field ! -If nothing work, add a debugger in the first ligne of ``get_search_result method`` and enable debug mode in OpenERP. When you write something in a many2one field, javascript debugger should pause. If not verify your installation. +OCA, or the Odoo Community Association, is a nonprofit organization whose +mission is to support the collaborative development of Odoo features and +promote its widespread use. +To contribute to this module, please visit http://odoo-community.org. diff --git a/web_m2x_options/__init__.py b/web_m2x_options/__init__.py index e69de29bb2d1..57d631c3f004 100644 --- a/web_m2x_options/__init__.py +++ b/web_m2x_options/__init__.py @@ -0,0 +1 @@ +# coding: utf-8 diff --git a/web_m2x_options/__openerp__.py b/web_m2x_options/__openerp__.py index 37b7dbf4e770..c87994c71a61 100644 --- a/web_m2x_options/__openerp__.py +++ b/web_m2x_options/__openerp__.py @@ -7,6 +7,10 @@ 'base', 'web', ], + 'qweb': [ + 'static/src/xml/base.xml', + ], + 'license': 'AGPL-3', 'data': ['views/view.xml'], "author": "0k.io,Odoo Community Association (OCA)", "installable": True, diff --git a/web_m2x_options/static/src/js/form.js b/web_m2x_options/static/src/js/form.js index bc4d3bebd335..7342794ea2e5 100644 --- a/web_m2x_options/static/src/js/form.js +++ b/web_m2x_options/static/src/js/form.js @@ -336,6 +336,30 @@ openerp.web_m2x_options = function (instance) { return values; }) }, + + render_value: function() + { + var self = this; + return jQuery.when(this._super.apply(this, arguments)) + .then(function() + { + if(self.options.open) + { + self.$el.find('.oe_tag') + .css('cursor', 'pointer') + .click(function(e) + { + var id = parseInt(jQuery(this).attr('data-id')); + self.do_action({ + type: 'ir.actions.act_window', + res_model: self.field.relation, + views: [[false, 'form']], + res_id: id, + }); + }); + } + }); + }, }); }; diff --git a/web_m2x_options/static/src/xml/base.xml b/web_m2x_options/static/src/xml/base.xml new file mode 100644 index 000000000000..9fbf425eaadc --- /dev/null +++ b/web_m2x_options/static/src/xml/base.xml @@ -0,0 +1,13 @@ + + + + + jQuery(this).attr('t-if', '!(widget.options.no_open || widget.options.no_open_edit)'); + + + + + jQuery(this).attr('t-att-data-id', 'el[0]'); + + + From df2e55637517d4104e0463f6086a2f2c793ee7c3 Mon Sep 17 00:00:00 2001 From: Antonio Espinosa Date: Mon, 16 Nov 2015 13:00:04 +0100 Subject: [PATCH 118/454] web_m2x_options check Many2one and Many2many options --- web_m2x_options/i18n/ar.po | 43 ++++++++++ web_m2x_options/i18n/de.po | 43 ++++++++++ web_m2x_options/i18n/es.po | 43 ++++++++++ web_m2x_options/i18n/fi.po | 43 ++++++++++ web_m2x_options/i18n/fr.po | 43 ++++++++++ web_m2x_options/i18n/it.po | 55 ++++++++++++ web_m2x_options/i18n/pt_BR.po | 43 ++++++++++ web_m2x_options/i18n/sl.po | 43 ++++++++++ web_m2x_options/i18n/tr.po | 44 ++++++++++ web_m2x_options/static/src/js/form.js | 117 +++++++++++++++----------- 10 files changed, 467 insertions(+), 50 deletions(-) create mode 100644 web_m2x_options/i18n/ar.po create mode 100644 web_m2x_options/i18n/de.po create mode 100644 web_m2x_options/i18n/es.po create mode 100644 web_m2x_options/i18n/fi.po create mode 100644 web_m2x_options/i18n/fr.po create mode 100644 web_m2x_options/i18n/it.po create mode 100644 web_m2x_options/i18n/pt_BR.po create mode 100644 web_m2x_options/i18n/sl.po create mode 100644 web_m2x_options/i18n/tr.po diff --git a/web_m2x_options/i18n/ar.po b/web_m2x_options/i18n/ar.po new file mode 100644 index 000000000000..1011622c21a8 --- /dev/null +++ b/web_m2x_options/i18n/ar.po @@ -0,0 +1,43 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * web_m2x_options +# +# Translators: +# SaFi J. , 2015 +msgid "" +msgstr "" +"Project-Id-Version: web (8.0)\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2016-02-26 02:05+0000\n" +"PO-Revision-Date: 2015-12-16 17:30+0000\n" +"Last-Translator: SaFi J. \n" +"Language-Team: Arabic (http://www.transifex.com/oca/OCA-web-8-0/language/ar/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: ar\n" +"Plural-Forms: nplurals=6; plural=n==0 ? 0 : n==1 ? 1 : n==2 ? 2 : n%100>=3 && n%100<=10 ? 3 : n%100>=11 && n%100<=99 ? 4 : 5;\n" + +#. module: web_m2x_options +#. openerp-web +#: code:addons/web_m2x_options/static/src/js/form.js:191 +#: code:addons/web_m2x_options/static/src/js/form.js:330 +#, python-format +msgid "Create \"%s\"" +msgstr "إنشاء \"%s\"" + +#. module: web_m2x_options +#. openerp-web +#: code:addons/web_m2x_options/static/src/js/form.js:213 +#: code:addons/web_m2x_options/static/src/js/form.js:351 +#, python-format +msgid "Create and Edit..." +msgstr "إنشاء وتحرير ..." + +#. module: web_m2x_options +#. openerp-web +#: code:addons/web_m2x_options/static/src/js/form.js:156 +#: code:addons/web_m2x_options/static/src/js/form.js:305 +#, python-format +msgid "Search More..." +msgstr "البحث عن المزيد ..." diff --git a/web_m2x_options/i18n/de.po b/web_m2x_options/i18n/de.po new file mode 100644 index 000000000000..112e2b911061 --- /dev/null +++ b/web_m2x_options/i18n/de.po @@ -0,0 +1,43 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * web_m2x_options +# +# Translators: +# Rudolf Schnapka , 2016 +msgid "" +msgstr "" +"Project-Id-Version: web (8.0)\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2016-02-26 02:05+0000\n" +"PO-Revision-Date: 2016-01-18 20:15+0000\n" +"Last-Translator: Rudolf Schnapka \n" +"Language-Team: German (http://www.transifex.com/oca/OCA-web-8-0/language/de/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: de\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#. module: web_m2x_options +#. openerp-web +#: code:addons/web_m2x_options/static/src/js/form.js:191 +#: code:addons/web_m2x_options/static/src/js/form.js:330 +#, python-format +msgid "Create \"%s\"" +msgstr "Anlegen \"%s" + +#. module: web_m2x_options +#. openerp-web +#: code:addons/web_m2x_options/static/src/js/form.js:213 +#: code:addons/web_m2x_options/static/src/js/form.js:351 +#, python-format +msgid "Create and Edit..." +msgstr "Anlegen und Bearbeiten" + +#. module: web_m2x_options +#. openerp-web +#: code:addons/web_m2x_options/static/src/js/form.js:156 +#: code:addons/web_m2x_options/static/src/js/form.js:305 +#, python-format +msgid "Search More..." +msgstr "Suche weitere..." diff --git a/web_m2x_options/i18n/es.po b/web_m2x_options/i18n/es.po new file mode 100644 index 000000000000..7a4764bae86a --- /dev/null +++ b/web_m2x_options/i18n/es.po @@ -0,0 +1,43 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * web_m2x_options +# +# Translators: +# Pedro M. Baeza , 2015 +msgid "" +msgstr "" +"Project-Id-Version: web (8.0)\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2016-02-26 02:05+0000\n" +"PO-Revision-Date: 2015-11-07 11:28+0000\n" +"Last-Translator: Pedro M. Baeza \n" +"Language-Team: Spanish (http://www.transifex.com/oca/OCA-web-8-0/language/es/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: es\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#. module: web_m2x_options +#. openerp-web +#: code:addons/web_m2x_options/static/src/js/form.js:191 +#: code:addons/web_m2x_options/static/src/js/form.js:330 +#, python-format +msgid "Create \"%s\"" +msgstr "Crear \"%s\"" + +#. module: web_m2x_options +#. openerp-web +#: code:addons/web_m2x_options/static/src/js/form.js:213 +#: code:addons/web_m2x_options/static/src/js/form.js:351 +#, python-format +msgid "Create and Edit..." +msgstr "Crear y editar..." + +#. module: web_m2x_options +#. openerp-web +#: code:addons/web_m2x_options/static/src/js/form.js:156 +#: code:addons/web_m2x_options/static/src/js/form.js:305 +#, python-format +msgid "Search More..." +msgstr "Buscar más..." diff --git a/web_m2x_options/i18n/fi.po b/web_m2x_options/i18n/fi.po new file mode 100644 index 000000000000..9dab4ae40247 --- /dev/null +++ b/web_m2x_options/i18n/fi.po @@ -0,0 +1,43 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * web_m2x_options +# +# Translators: +# Jarmo Kortetjärvi , 2016 +msgid "" +msgstr "" +"Project-Id-Version: web (8.0)\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2016-02-26 02:05+0000\n" +"PO-Revision-Date: 2016-02-01 09:52+0000\n" +"Last-Translator: Jarmo Kortetjärvi \n" +"Language-Team: Finnish (http://www.transifex.com/oca/OCA-web-8-0/language/fi/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: fi\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#. module: web_m2x_options +#. openerp-web +#: code:addons/web_m2x_options/static/src/js/form.js:191 +#: code:addons/web_m2x_options/static/src/js/form.js:330 +#, python-format +msgid "Create \"%s\"" +msgstr "Luo \"%s\"" + +#. module: web_m2x_options +#. openerp-web +#: code:addons/web_m2x_options/static/src/js/form.js:213 +#: code:addons/web_m2x_options/static/src/js/form.js:351 +#, python-format +msgid "Create and Edit..." +msgstr "Luo ja muokkaa..." + +#. module: web_m2x_options +#. openerp-web +#: code:addons/web_m2x_options/static/src/js/form.js:156 +#: code:addons/web_m2x_options/static/src/js/form.js:305 +#, python-format +msgid "Search More..." +msgstr "Hae lisää..." diff --git a/web_m2x_options/i18n/fr.po b/web_m2x_options/i18n/fr.po new file mode 100644 index 000000000000..448e0f4684ff --- /dev/null +++ b/web_m2x_options/i18n/fr.po @@ -0,0 +1,43 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * web_m2x_options +# +# Translators: +# Christophe CHAUVET , 2016 +msgid "" +msgstr "" +"Project-Id-Version: web (8.0)\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2016-05-06 15:50+0000\n" +"PO-Revision-Date: 2016-05-06 08:27+0000\n" +"Last-Translator: Christophe CHAUVET \n" +"Language-Team: French (http://www.transifex.com/oca/OCA-web-8-0/language/fr/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: fr\n" +"Plural-Forms: nplurals=2; plural=(n > 1);\n" + +#. module: web_m2x_options +#. openerp-web +#: code:addons/web_m2x_options/static/src/js/form.js:191 +#: code:addons/web_m2x_options/static/src/js/form.js:330 +#, python-format +msgid "Create \"%s\"" +msgstr "Creer \"%s\"" + +#. module: web_m2x_options +#. openerp-web +#: code:addons/web_m2x_options/static/src/js/form.js:213 +#: code:addons/web_m2x_options/static/src/js/form.js:351 +#, python-format +msgid "Create and Edit..." +msgstr "Créer et modifier..." + +#. module: web_m2x_options +#. openerp-web +#: code:addons/web_m2x_options/static/src/js/form.js:156 +#: code:addons/web_m2x_options/static/src/js/form.js:305 +#, python-format +msgid "Search More..." +msgstr "Rechercher plus..." diff --git a/web_m2x_options/i18n/it.po b/web_m2x_options/i18n/it.po new file mode 100644 index 000000000000..ce21776cee13 --- /dev/null +++ b/web_m2x_options/i18n/it.po @@ -0,0 +1,55 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * web_m2x_options +# +# Translators: +# Ahmet Altınışık , 2015 +# Antonio Trueba, 2016 +# Armando Vulcano Junior , 2015 +# Carles Antoli , 2015 +# Bole , 2015 +# FIRST AUTHOR , 2012,2014 +# Giacomo , 2015 +# Hotellook, 2014 +# Jarmo Kortetjärvi , 2016 +# Paolo Valier, 2016 +# Paolo Valier, 2016 +# Rudolf Schnapka , 2016 +# Thomas A. Jaeger, 2015 +msgid "" +msgstr "" +"Project-Id-Version: web (8.0)\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2016-04-28 07:09+0000\n" +"PO-Revision-Date: 2016-04-28 06:46+0000\n" +"Last-Translator: Paolo Valier\n" +"Language-Team: Italian (http://www.transifex.com/oca/OCA-web-8-0/language/it/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: it\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#. module: web_m2x_options +#. openerp-web +#: code:addons/web_m2x_options/static/src/js/form.js:191 +#: code:addons/web_m2x_options/static/src/js/form.js:330 +#, python-format +msgid "Create \"%s\"" +msgstr "Crea \"%s\"" + +#. module: web_m2x_options +#. openerp-web +#: code:addons/web_m2x_options/static/src/js/form.js:213 +#: code:addons/web_m2x_options/static/src/js/form.js:351 +#, python-format +msgid "Create and Edit..." +msgstr "Crea e Modifica..." + +#. module: web_m2x_options +#. openerp-web +#: code:addons/web_m2x_options/static/src/js/form.js:156 +#: code:addons/web_m2x_options/static/src/js/form.js:305 +#, python-format +msgid "Search More..." +msgstr "Cerca altro..." diff --git a/web_m2x_options/i18n/pt_BR.po b/web_m2x_options/i18n/pt_BR.po new file mode 100644 index 000000000000..8074af4c14d7 --- /dev/null +++ b/web_m2x_options/i18n/pt_BR.po @@ -0,0 +1,43 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * web_m2x_options +# +# Translators: +# danimaribeiro , 2016 +msgid "" +msgstr "" +"Project-Id-Version: web (8.0)\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2016-03-11 02:17+0000\n" +"PO-Revision-Date: 2016-03-05 16:20+0000\n" +"Last-Translator: danimaribeiro \n" +"Language-Team: Portuguese (Brazil) (http://www.transifex.com/oca/OCA-web-8-0/language/pt_BR/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: pt_BR\n" +"Plural-Forms: nplurals=2; plural=(n > 1);\n" + +#. module: web_m2x_options +#. openerp-web +#: code:addons/web_m2x_options/static/src/js/form.js:191 +#: code:addons/web_m2x_options/static/src/js/form.js:330 +#, python-format +msgid "Create \"%s\"" +msgstr "Criar \"%s\"" + +#. module: web_m2x_options +#. openerp-web +#: code:addons/web_m2x_options/static/src/js/form.js:213 +#: code:addons/web_m2x_options/static/src/js/form.js:351 +#, python-format +msgid "Create and Edit..." +msgstr "Criar e editar.." + +#. module: web_m2x_options +#. openerp-web +#: code:addons/web_m2x_options/static/src/js/form.js:156 +#: code:addons/web_m2x_options/static/src/js/form.js:305 +#, python-format +msgid "Search More..." +msgstr "Buscar mais..." diff --git a/web_m2x_options/i18n/sl.po b/web_m2x_options/i18n/sl.po new file mode 100644 index 000000000000..c63f36ed9d72 --- /dev/null +++ b/web_m2x_options/i18n/sl.po @@ -0,0 +1,43 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * web_m2x_options +# +# Translators: +# Matjaž Mozetič , 2015 +msgid "" +msgstr "" +"Project-Id-Version: web (8.0)\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2016-02-26 02:05+0000\n" +"PO-Revision-Date: 2015-11-08 05:46+0000\n" +"Last-Translator: Matjaž Mozetič \n" +"Language-Team: Slovenian (http://www.transifex.com/oca/OCA-web-8-0/language/sl/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: sl\n" +"Plural-Forms: nplurals=4; plural=(n%100==1 ? 0 : n%100==2 ? 1 : n%100==3 || n%100==4 ? 2 : 3);\n" + +#. module: web_m2x_options +#. openerp-web +#: code:addons/web_m2x_options/static/src/js/form.js:191 +#: code:addons/web_m2x_options/static/src/js/form.js:330 +#, python-format +msgid "Create \"%s\"" +msgstr "Ustvari \"%s\"" + +#. module: web_m2x_options +#. openerp-web +#: code:addons/web_m2x_options/static/src/js/form.js:213 +#: code:addons/web_m2x_options/static/src/js/form.js:351 +#, python-format +msgid "Create and Edit..." +msgstr "Ustvari in urejaj..." + +#. module: web_m2x_options +#. openerp-web +#: code:addons/web_m2x_options/static/src/js/form.js:156 +#: code:addons/web_m2x_options/static/src/js/form.js:305 +#, python-format +msgid "Search More..." +msgstr "Poišči več..." diff --git a/web_m2x_options/i18n/tr.po b/web_m2x_options/i18n/tr.po new file mode 100644 index 000000000000..c9418f2d1c2f --- /dev/null +++ b/web_m2x_options/i18n/tr.po @@ -0,0 +1,44 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * web_m2x_options +# +# Translators: +# Ahmet Altınışık , 2015 +# Ahmet Altınışık , 2015 +msgid "" +msgstr "" +"Project-Id-Version: web (8.0)\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2016-02-26 02:05+0000\n" +"PO-Revision-Date: 2015-12-30 21:53+0000\n" +"Last-Translator: Ahmet Altınışık \n" +"Language-Team: Turkish (http://www.transifex.com/oca/OCA-web-8-0/language/tr/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: tr\n" +"Plural-Forms: nplurals=2; plural=(n > 1);\n" + +#. module: web_m2x_options +#. openerp-web +#: code:addons/web_m2x_options/static/src/js/form.js:191 +#: code:addons/web_m2x_options/static/src/js/form.js:330 +#, python-format +msgid "Create \"%s\"" +msgstr "Oluştur \"%s\"" + +#. module: web_m2x_options +#. openerp-web +#: code:addons/web_m2x_options/static/src/js/form.js:213 +#: code:addons/web_m2x_options/static/src/js/form.js:351 +#, python-format +msgid "Create and Edit..." +msgstr "Oluştur ve düzenle..." + +#. module: web_m2x_options +#. openerp-web +#: code:addons/web_m2x_options/static/src/js/form.js:156 +#: code:addons/web_m2x_options/static/src/js/form.js:305 +#, python-format +msgid "Search More..." +msgstr "Daha Fazla..." diff --git a/web_m2x_options/static/src/js/form.js b/web_m2x_options/static/src/js/form.js index 7342794ea2e5..524197a57392 100644 --- a/web_m2x_options/static/src/js/form.js +++ b/web_m2x_options/static/src/js/form.js @@ -67,11 +67,11 @@ openerp.web_m2x_options = function (instance) { var self = this; // add options limit used to change number of selections record // returned. - if (_.isUndefined(this.view)) - return this._super.apply(this, arguments); - if (!_.isUndefined(this.view.ir_options['web_m2x_options.limit'])) { - this.limit = parseInt(this.view.ir_options['web_m2x_options.limit']); - } + if (_.isUndefined(this.view)) + return this._super.apply(this, arguments); + if (!_.isUndefined(this.view.ir_options['web_m2x_options.limit'])) { + this.limit = parseInt(this.view.ir_options['web_m2x_options.limit']); + } if (typeof this.options.limit === 'number') { this.limit = this.options.limit; @@ -99,8 +99,7 @@ openerp.web_m2x_options = function (instance) { self.build_context())); var create_rights; - if (typeof this.options.create === "undefined" || - typeof this.options.create_edit === "undefined") { + if (!(self.options && (self.options.no_create || self.options.no_create_edit))) { create_rights = new instance.web.Model(this.field.relation).call( "check_access_rights", ["create", false]); } @@ -119,7 +118,7 @@ openerp.web_m2x_options = function (instance) { id: x[0], }; }); - + // Search result value colors if (self.colors && self.field_color) { @@ -127,7 +126,7 @@ openerp.web_m2x_options = function (instance) { for (var index in values) { value_ids.push(values[index].id); } - + // RPC request to get field_color from Objects Objects.query([self.field_color]) .filter([['id', 'in', value_ids]]) @@ -137,7 +136,7 @@ openerp.web_m2x_options = function (instance) { if (values[index_value].id == objects[index].id) { // Find value in values by comparing ids var value = values[index_value]; - + // Find color with field value as key var color = self.colors[objects[index][self.field_color]] || 'black'; value.label = ''+value.label+''; @@ -171,10 +170,15 @@ openerp.web_m2x_options = function (instance) { var raw_result = _(data.result).map(function (x) { return x[1]; }); + var no_quick_create = ( + self.options && (self.options.no_create || + self.options.no_quick_create) + ) + var m2x_create_undef = _.isUndefined(self.view.ir_options['web_m2x_options.create']) + var m2x_create = self.view.ir_options['web_m2x_options.create'] == "True" - if ((_.isUndefined(self.options.create) && _.isUndefined(self.view.ir_options['web_m2x_options.create']) && can_create) || - (_.isUndefined(self.options.create) && self.view.ir_options['web_m2x_options.create'] == "True") || - self.options.create) { + if (!no_quick_create && ((m2x_create_undef && can_create) || + m2x_create)) { if (search_val.length > 0 && !_.include(raw_result, search_val)) { @@ -192,10 +196,15 @@ openerp.web_m2x_options = function (instance) { } // create... + var no_create_edit = ( + self.options && (self.options.no_create || + self.options.no_create_edit) + ) + var m2x_create_edit_undef = _.isUndefined(self.view.ir_options['web_m2x_options.create_edit']) + var m2x_create_edit = self.view.ir_options['web_m2x_options.create_edit'] == "True" - if ((_.isUndefined(self.options.create_edit) && _.isUndefined(self.view.ir_options['web_m2x_options.create_edit']) && can_create) || - (_.isUndefined(self.options.create) && self.view.ir_options['web_m2x_options.create_edit'] == "True") || - self.options.create_edit) { + if (!no_create_edit && ((m2x_create_edit_undef && can_create) || + m2x_create_edit)) { values.push({ label: _t("Create and Edit..."), @@ -207,7 +216,7 @@ openerp.web_m2x_options = function (instance) { classname: 'oe_m2o_dropdown_option' }); } - + // Check if colors specified to wait for RPC if (!(self.field_color && self.colors)){ def.resolve(values); @@ -226,28 +235,28 @@ openerp.web_m2x_options = function (instance) { new instance.web.form.M2ODialog(this).open(); } }, - - start: function() { - this._super.apply(this, arguments); - return this.get_options(); - }, - - get_options: function() { - var self = this; - if (_.isUndefined(this.view.ir_options_loaded)) { - this.view.ir_options_loaded = $.Deferred(); - this.view.ir_options = {}; - (new instance.web.Model("ir.config_parameter")) - .query(["key", "value"]).filter([['key', 'in', OPTIONS]]) - .all().then(function(records) { - _(records).each(function(record) { - self.view.ir_options[record.key] = record.value; - }); - self.view.ir_options_loaded.resolve(); - }); - } - return this.view.ir_options_loaded; - }, + + start: function() { + this._super.apply(this, arguments); + return this.get_options(); + }, + + get_options: function() { + var self = this; + if (_.isUndefined(this.view.ir_options_loaded)) { + this.view.ir_options_loaded = $.Deferred(); + this.view.ir_options = {}; + (new instance.web.Model("ir.config_parameter")) + .query(["key", "value"]).filter([['key', 'in', OPTIONS]]) + .all().then(function(records) { + _(records).each(function(record) { + self.view.ir_options[record.key] = record.value; + }); + self.view.ir_options_loaded.resolve(); + }); + } + return this.view.ir_options_loaded; + }, /** * Call this method to search using a string. @@ -258,10 +267,10 @@ openerp.web_m2x_options = function (instance) { // add options limit used to change number of selections record // returned. - - if (!_.isUndefined(this.view.ir_options['web_m2x_options.limit'])) { - this.limit = parseInt(this.view.ir_options['web_m2x_options.limit']); - } + + if (!_.isUndefined(this.view.ir_options['web_m2x_options.limit'])) { + this.limit = parseInt(this.view.ir_options['web_m2x_options.limit']); + } if (typeof this.options.limit === 'number') { this.limit = this.options.limit; @@ -300,10 +309,14 @@ openerp.web_m2x_options = function (instance) { }); } // quick create + var no_quick_create = ( + self.options && (self.options.no_create || + self.options.no_quick_create) + ) + var m2x_create_undef = _.isUndefined(self.view.ir_options['web_m2x_options.create']) + var m2x_create = self.view.ir_options['web_m2x_options.create'] == "True" - if ((_.isUndefined(self.options.create) && _.isUndefined(self.view.ir_options['web_m2x_options.create'])) || - (_.isUndefined(self.options.create) && self.view.ir_options['web_m2x_options.create'] == 'True') || - self.options.create) { + if (!no_quick_create && (m2x_create_undef || m2x_create)) { var raw_result = _(data.result).map(function(x) {return x[1];}); if (search_val.length > 0 && !_.include(raw_result, search_val)) { @@ -319,10 +332,14 @@ openerp.web_m2x_options = function (instance) { } // create... - - if ((_.isUndefined(self.options.create_edit === 'undefined') && _.isUndefined(self.view.ir_options['web_m2x_options.create_edit'])) || - (_.isUndefined(self.options.create) && self.view.ir_options['web_m2x_options.create_edit'] == 'True') || - self.options.create_edit) { + var no_create_edit = ( + self.options && (self.options.no_create || + self.options.no_create_edit) + ) + var m2x_create_edit_undef = _.isUndefined(self.view.ir_options['web_m2x_options.create_edit']) + var m2x_create_edit = self.view.ir_options['web_m2x_options.create_edit'] == "True" + + if (!no_create_edit && (m2x_create_edit_undef || m2x_create_edit)) { values.push({ label: _t("Create and Edit..."), From c43e9886eea82018a2e08ea7d4320eacbf37038f Mon Sep 17 00:00:00 2001 From: Antonio Espinosa Date: Wed, 10 Feb 2016 17:05:51 +0100 Subject: [PATCH 119/454] Limit name_search to 160 like Odoo core does --- web_m2x_options/__openerp__.py | 2 +- web_m2x_options/static/src/js/form.js | 10 ++++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/web_m2x_options/__openerp__.py b/web_m2x_options/__openerp__.py index c87994c71a61..8a3331574bce 100644 --- a/web_m2x_options/__openerp__.py +++ b/web_m2x_options/__openerp__.py @@ -2,7 +2,7 @@ { "name": 'web_m2x_options', - "version": "8.0.0.2", + "version": "8.0.0.2.0", "depends": [ 'base', 'web', diff --git a/web_m2x_options/static/src/js/form.js b/web_m2x_options/static/src/js/form.js index 524197a57392..9fe51d23b056 100644 --- a/web_m2x_options/static/src/js/form.js +++ b/web_m2x_options/static/src/js/form.js @@ -155,9 +155,12 @@ openerp.web_m2x_options = function (instance) { values.push({ label: _t("Search More..."), action: function () { + // limit = 80 for improving performance, similar + // to Odoo implementation here: + // https://github.com/odoo/odoo/commit/8c3cdce539d87775b59b3f2d5ceb433f995821bf dataset.name_search( search_val, self.build_domain(), - 'ilike', false).done(function (data) { + 'ilike', 80).done(function (data) { self._search_create_popup("search", data); }); }, @@ -301,7 +304,10 @@ openerp.web_m2x_options = function (instance) { values.push({ label: _t("Search More..."), action: function() { - dataset.name_search(search_val, self.build_domain(), 'ilike', false).done(function(data) { + // limit = 80 for improving performance, similar + // to Odoo implementation here: + // https://github.com/odoo/odoo/commit/8c3cdce539d87775b59b3f2d5ceb433f995821bf + dataset.name_search(search_val, self.build_domain(), 'ilike', 80).done(function(data) { self._search_create_popup("search", data); }); }, From af2a37cbf544437d580431c69564c2cfb5b3b34a Mon Sep 17 00:00:00 2001 From: Zakaria Makrelouf Date: Sun, 11 Sep 2016 12:10:19 +0100 Subject: [PATCH 120/454] Migration of module web_m2x_options. Adapt JS file to the new JS API and make the module installable [MIG] adapt form.js to the new API. [FIX] Fix bug mentioned in pull #262. [MIG] Make the module installable. --- web_m2x_options/README.rst | 1 + web_m2x_options/__openerp__.py | 7 +- web_m2x_options/i18n/ar.po | 12 +- web_m2x_options/i18n/de.po | 12 +- web_m2x_options/i18n/es.po | 12 +- web_m2x_options/i18n/fi.po | 12 +- web_m2x_options/i18n/fr.po | 12 +- web_m2x_options/i18n/it.po | 12 +- web_m2x_options/i18n/pt_BR.po | 12 +- web_m2x_options/i18n/sl.po | 12 +- web_m2x_options/i18n/tr.po | 12 +- web_m2x_options/static/src/js/form.js | 225 ++++++++++++++---------- web_m2x_options/static/src/xml/base.xml | 2 +- 13 files changed, 190 insertions(+), 153 deletions(-) diff --git a/web_m2x_options/README.rst b/web_m2x_options/README.rst index de0adaac3d33..dff75f05fe73 100644 --- a/web_m2x_options/README.rst +++ b/web_m2x_options/README.rst @@ -145,6 +145,7 @@ Contributors * Holger Brunn * Nicolas JEUDY * Yannick Vaucher +* Zakaria Makrelouf Maintainer ---------- diff --git a/web_m2x_options/__openerp__.py b/web_m2x_options/__openerp__.py index 8a3331574bce..94c1a525bd55 100644 --- a/web_m2x_options/__openerp__.py +++ b/web_m2x_options/__openerp__.py @@ -2,7 +2,7 @@ { "name": 'web_m2x_options', - "version": "8.0.0.2.0", + "version": "9.0.1.0.0", "depends": [ 'base', 'web', @@ -12,7 +12,6 @@ ], 'license': 'AGPL-3', 'data': ['views/view.xml'], - "author": "0k.io,Odoo Community Association (OCA)", - "installable": True, - "active": False, + "author": "ACSONE SA/NV, 0k.io,Odoo Community Association (OCA)", + 'installable': True, } diff --git a/web_m2x_options/i18n/ar.po b/web_m2x_options/i18n/ar.po index 1011622c21a8..124f84ceecdc 100644 --- a/web_m2x_options/i18n/ar.po +++ b/web_m2x_options/i18n/ar.po @@ -20,24 +20,24 @@ msgstr "" #. module: web_m2x_options #. openerp-web -#: code:addons/web_m2x_options/static/src/js/form.js:191 -#: code:addons/web_m2x_options/static/src/js/form.js:330 +#: code:addons/web_m2x_options/static/src/js/form.js:219 +#: code:addons/web_m2x_options/static/src/js/form.js:373 #, python-format msgid "Create \"%s\"" msgstr "إنشاء \"%s\"" #. module: web_m2x_options #. openerp-web -#: code:addons/web_m2x_options/static/src/js/form.js:213 -#: code:addons/web_m2x_options/static/src/js/form.js:351 +#: code:addons/web_m2x_options/static/src/js/form.js:237 +#: code:addons/web_m2x_options/static/src/js/form.js:392 #, python-format msgid "Create and Edit..." msgstr "إنشاء وتحرير ..." #. module: web_m2x_options #. openerp-web -#: code:addons/web_m2x_options/static/src/js/form.js:156 -#: code:addons/web_m2x_options/static/src/js/form.js:305 +#: code:addons/web_m2x_options/static/src/js/form.js:188 +#: code:addons/web_m2x_options/static/src/js/form.js:349 #, python-format msgid "Search More..." msgstr "البحث عن المزيد ..." diff --git a/web_m2x_options/i18n/de.po b/web_m2x_options/i18n/de.po index 112e2b911061..40eb8cacde07 100644 --- a/web_m2x_options/i18n/de.po +++ b/web_m2x_options/i18n/de.po @@ -20,24 +20,24 @@ msgstr "" #. module: web_m2x_options #. openerp-web -#: code:addons/web_m2x_options/static/src/js/form.js:191 -#: code:addons/web_m2x_options/static/src/js/form.js:330 +#: code:addons/web_m2x_options/static/src/js/form.js:219 +#: code:addons/web_m2x_options/static/src/js/form.js:373 #, python-format msgid "Create \"%s\"" msgstr "Anlegen \"%s" #. module: web_m2x_options #. openerp-web -#: code:addons/web_m2x_options/static/src/js/form.js:213 -#: code:addons/web_m2x_options/static/src/js/form.js:351 +#: code:addons/web_m2x_options/static/src/js/form.js:237 +#: code:addons/web_m2x_options/static/src/js/form.js:392 #, python-format msgid "Create and Edit..." msgstr "Anlegen und Bearbeiten" #. module: web_m2x_options #. openerp-web -#: code:addons/web_m2x_options/static/src/js/form.js:156 -#: code:addons/web_m2x_options/static/src/js/form.js:305 +#: code:addons/web_m2x_options/static/src/js/form.js:188 +#: code:addons/web_m2x_options/static/src/js/form.js:349 #, python-format msgid "Search More..." msgstr "Suche weitere..." diff --git a/web_m2x_options/i18n/es.po b/web_m2x_options/i18n/es.po index 7a4764bae86a..bd3b1e51bc9d 100644 --- a/web_m2x_options/i18n/es.po +++ b/web_m2x_options/i18n/es.po @@ -20,24 +20,24 @@ msgstr "" #. module: web_m2x_options #. openerp-web -#: code:addons/web_m2x_options/static/src/js/form.js:191 -#: code:addons/web_m2x_options/static/src/js/form.js:330 +#: code:addons/web_m2x_options/static/src/js/form.js:219 +#: code:addons/web_m2x_options/static/src/js/form.js:373 #, python-format msgid "Create \"%s\"" msgstr "Crear \"%s\"" #. module: web_m2x_options #. openerp-web -#: code:addons/web_m2x_options/static/src/js/form.js:213 -#: code:addons/web_m2x_options/static/src/js/form.js:351 +#: code:addons/web_m2x_options/static/src/js/form.js:237 +#: code:addons/web_m2x_options/static/src/js/form.js:392 #, python-format msgid "Create and Edit..." msgstr "Crear y editar..." #. module: web_m2x_options #. openerp-web -#: code:addons/web_m2x_options/static/src/js/form.js:156 -#: code:addons/web_m2x_options/static/src/js/form.js:305 +#: code:addons/web_m2x_options/static/src/js/form.js:188 +#: code:addons/web_m2x_options/static/src/js/form.js:349 #, python-format msgid "Search More..." msgstr "Buscar más..." diff --git a/web_m2x_options/i18n/fi.po b/web_m2x_options/i18n/fi.po index 9dab4ae40247..b374d7eb9458 100644 --- a/web_m2x_options/i18n/fi.po +++ b/web_m2x_options/i18n/fi.po @@ -20,24 +20,24 @@ msgstr "" #. module: web_m2x_options #. openerp-web -#: code:addons/web_m2x_options/static/src/js/form.js:191 -#: code:addons/web_m2x_options/static/src/js/form.js:330 +#: code:addons/web_m2x_options/static/src/js/form.js:219 +#: code:addons/web_m2x_options/static/src/js/form.js:373 #, python-format msgid "Create \"%s\"" msgstr "Luo \"%s\"" #. module: web_m2x_options #. openerp-web -#: code:addons/web_m2x_options/static/src/js/form.js:213 -#: code:addons/web_m2x_options/static/src/js/form.js:351 +#: code:addons/web_m2x_options/static/src/js/form.js:237 +#: code:addons/web_m2x_options/static/src/js/form.js:392 #, python-format msgid "Create and Edit..." msgstr "Luo ja muokkaa..." #. module: web_m2x_options #. openerp-web -#: code:addons/web_m2x_options/static/src/js/form.js:156 -#: code:addons/web_m2x_options/static/src/js/form.js:305 +#: code:addons/web_m2x_options/static/src/js/form.js:188 +#: code:addons/web_m2x_options/static/src/js/form.js:349 #, python-format msgid "Search More..." msgstr "Hae lisää..." diff --git a/web_m2x_options/i18n/fr.po b/web_m2x_options/i18n/fr.po index 448e0f4684ff..3be5ae233eab 100644 --- a/web_m2x_options/i18n/fr.po +++ b/web_m2x_options/i18n/fr.po @@ -20,24 +20,24 @@ msgstr "" #. module: web_m2x_options #. openerp-web -#: code:addons/web_m2x_options/static/src/js/form.js:191 -#: code:addons/web_m2x_options/static/src/js/form.js:330 +#: code:addons/web_m2x_options/static/src/js/form.js:219 +#: code:addons/web_m2x_options/static/src/js/form.js:373 #, python-format msgid "Create \"%s\"" msgstr "Creer \"%s\"" #. module: web_m2x_options #. openerp-web -#: code:addons/web_m2x_options/static/src/js/form.js:213 -#: code:addons/web_m2x_options/static/src/js/form.js:351 +#: code:addons/web_m2x_options/static/src/js/form.js:237 +#: code:addons/web_m2x_options/static/src/js/form.js:392 #, python-format msgid "Create and Edit..." msgstr "Créer et modifier..." #. module: web_m2x_options #. openerp-web -#: code:addons/web_m2x_options/static/src/js/form.js:156 -#: code:addons/web_m2x_options/static/src/js/form.js:305 +#: code:addons/web_m2x_options/static/src/js/form.js:188 +#: code:addons/web_m2x_options/static/src/js/form.js:349 #, python-format msgid "Search More..." msgstr "Rechercher plus..." diff --git a/web_m2x_options/i18n/it.po b/web_m2x_options/i18n/it.po index ce21776cee13..c8db1568fdf7 100644 --- a/web_m2x_options/i18n/it.po +++ b/web_m2x_options/i18n/it.po @@ -32,24 +32,24 @@ msgstr "" #. module: web_m2x_options #. openerp-web -#: code:addons/web_m2x_options/static/src/js/form.js:191 -#: code:addons/web_m2x_options/static/src/js/form.js:330 +#: code:addons/web_m2x_options/static/src/js/form.js:219 +#: code:addons/web_m2x_options/static/src/js/form.js:373 #, python-format msgid "Create \"%s\"" msgstr "Crea \"%s\"" #. module: web_m2x_options #. openerp-web -#: code:addons/web_m2x_options/static/src/js/form.js:213 -#: code:addons/web_m2x_options/static/src/js/form.js:351 +#: code:addons/web_m2x_options/static/src/js/form.js:237 +#: code:addons/web_m2x_options/static/src/js/form.js:392 #, python-format msgid "Create and Edit..." msgstr "Crea e Modifica..." #. module: web_m2x_options #. openerp-web -#: code:addons/web_m2x_options/static/src/js/form.js:156 -#: code:addons/web_m2x_options/static/src/js/form.js:305 +#: code:addons/web_m2x_options/static/src/js/form.js:188 +#: code:addons/web_m2x_options/static/src/js/form.js:349 #, python-format msgid "Search More..." msgstr "Cerca altro..." diff --git a/web_m2x_options/i18n/pt_BR.po b/web_m2x_options/i18n/pt_BR.po index 8074af4c14d7..cf28995e3eed 100644 --- a/web_m2x_options/i18n/pt_BR.po +++ b/web_m2x_options/i18n/pt_BR.po @@ -20,24 +20,24 @@ msgstr "" #. module: web_m2x_options #. openerp-web -#: code:addons/web_m2x_options/static/src/js/form.js:191 -#: code:addons/web_m2x_options/static/src/js/form.js:330 +#: code:addons/web_m2x_options/static/src/js/form.js:219 +#: code:addons/web_m2x_options/static/src/js/form.js:373 #, python-format msgid "Create \"%s\"" msgstr "Criar \"%s\"" #. module: web_m2x_options #. openerp-web -#: code:addons/web_m2x_options/static/src/js/form.js:213 -#: code:addons/web_m2x_options/static/src/js/form.js:351 +#: code:addons/web_m2x_options/static/src/js/form.js:237 +#: code:addons/web_m2x_options/static/src/js/form.js:392 #, python-format msgid "Create and Edit..." msgstr "Criar e editar.." #. module: web_m2x_options #. openerp-web -#: code:addons/web_m2x_options/static/src/js/form.js:156 -#: code:addons/web_m2x_options/static/src/js/form.js:305 +#: code:addons/web_m2x_options/static/src/js/form.js:188 +#: code:addons/web_m2x_options/static/src/js/form.js:349 #, python-format msgid "Search More..." msgstr "Buscar mais..." diff --git a/web_m2x_options/i18n/sl.po b/web_m2x_options/i18n/sl.po index c63f36ed9d72..7192762e128e 100644 --- a/web_m2x_options/i18n/sl.po +++ b/web_m2x_options/i18n/sl.po @@ -20,24 +20,24 @@ msgstr "" #. module: web_m2x_options #. openerp-web -#: code:addons/web_m2x_options/static/src/js/form.js:191 -#: code:addons/web_m2x_options/static/src/js/form.js:330 +#: code:addons/web_m2x_options/static/src/js/form.js:219 +#: code:addons/web_m2x_options/static/src/js/form.js:373 #, python-format msgid "Create \"%s\"" msgstr "Ustvari \"%s\"" #. module: web_m2x_options #. openerp-web -#: code:addons/web_m2x_options/static/src/js/form.js:213 -#: code:addons/web_m2x_options/static/src/js/form.js:351 +#: code:addons/web_m2x_options/static/src/js/form.js:237 +#: code:addons/web_m2x_options/static/src/js/form.js:392 #, python-format msgid "Create and Edit..." msgstr "Ustvari in urejaj..." #. module: web_m2x_options #. openerp-web -#: code:addons/web_m2x_options/static/src/js/form.js:156 -#: code:addons/web_m2x_options/static/src/js/form.js:305 +#: code:addons/web_m2x_options/static/src/js/form.js:188 +#: code:addons/web_m2x_options/static/src/js/form.js:349 #, python-format msgid "Search More..." msgstr "Poišči več..." diff --git a/web_m2x_options/i18n/tr.po b/web_m2x_options/i18n/tr.po index c9418f2d1c2f..2b9f46fdd2ee 100644 --- a/web_m2x_options/i18n/tr.po +++ b/web_m2x_options/i18n/tr.po @@ -21,24 +21,24 @@ msgstr "" #. module: web_m2x_options #. openerp-web -#: code:addons/web_m2x_options/static/src/js/form.js:191 -#: code:addons/web_m2x_options/static/src/js/form.js:330 +#: code:addons/web_m2x_options/static/src/js/form.js:219 +#: code:addons/web_m2x_options/static/src/js/form.js:373 #, python-format msgid "Create \"%s\"" msgstr "Oluştur \"%s\"" #. module: web_m2x_options #. openerp-web -#: code:addons/web_m2x_options/static/src/js/form.js:213 -#: code:addons/web_m2x_options/static/src/js/form.js:351 +#: code:addons/web_m2x_options/static/src/js/form.js:237 +#: code:addons/web_m2x_options/static/src/js/form.js:392 #, python-format msgid "Create and Edit..." msgstr "Oluştur ve düzenle..." #. module: web_m2x_options #. openerp-web -#: code:addons/web_m2x_options/static/src/js/form.js:156 -#: code:addons/web_m2x_options/static/src/js/form.js:305 +#: code:addons/web_m2x_options/static/src/js/form.js:188 +#: code:addons/web_m2x_options/static/src/js/form.js:349 #, python-format msgid "Search More..." msgstr "Daha Fazla..." diff --git a/web_m2x_options/static/src/js/form.js b/web_m2x_options/static/src/js/form.js index 9fe51d23b056..8e97ad3ecb1d 100644 --- a/web_m2x_options/static/src/js/form.js +++ b/web_m2x_options/static/src/js/form.js @@ -1,12 +1,17 @@ -/*global openerp, _, $ */ - -openerp.web_m2x_options = function (instance) { +/* Copyright 2016 0k.io,ACSONE SA/NV + * * License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). */ +odoo.define('web_m2x_options.web_m2x_options', function (require) { "use strict"; - var QWeb = instance.web.qweb, - _t = instance.web._t, - _lt = instance.web._lt; + var $ = require("$"); + var core = require('web.core'), + data = require('web.data'), + Dialog = require('web.Dialog'), + Model = require('web.Model'), + form_relational = require('web.form_relational'), + _ = require('_'), + _t = core._t; var OPTIONS = ['web_m2x_options.create', 'web_m2x_options.create_edit', @@ -14,7 +19,40 @@ openerp.web_m2x_options = function (instance) { 'web_m2x_options.search_more', 'web_m2x_options.m2o_dialog',]; - instance.web.form.FieldMany2One = instance.web.form.FieldMany2One.extend({ + var M2ODialog = Dialog.extend({ + template: "M2ODialog", + init: function(parent) { + this.name = parent.string; + this._super(parent, { + title: _.str.sprintf(_t("Create a %s"), parent.string), + size: 'medium', + buttons: [ + {text: _t('Create'), classes: 'btn-primary', click: function() { + if (this.$("input").val() !== ''){ + this.getParent()._quick_create(this.$("input").val()); + this.close(); + } else { + e.preventDefault(); + this.$("input").focus(); + } + }}, + + {text: _t('Create and edit'), classes: 'btn-primary', close: true, click: function() { + this.getParent()._search_create_popup("form", undefined, this.getParent()._create_context(this.$("input").val())); + }}, + + {text: _t('Cancel'), close: true} + ] + }); + }, + start: function() { + var text = _.str.sprintf(_t("You are creating a new %s, are you sure it does not exist yet?"), this.name); + this.$("p").text(text); + this.$("input").val(this.getParent().$input.val()); + }, + }); + + form_relational.FieldMany2One.include({ start: function() { this._super.apply(this, arguments); @@ -26,7 +64,7 @@ openerp.web_m2x_options = function (instance) { if (!_.isUndefined(this.view) && _.isUndefined(this.view.ir_options_loaded)) { this.view.ir_options_loaded = $.Deferred(); this.view.ir_options = {}; - (new instance.web.Model("ir.config_parameter")) + (new Model("ir.config_parameter")) .query(["key", "value"]).filter([['key', 'in', OPTIONS]]) .all().then(function(records) { _(records).each(function(record) { @@ -57,12 +95,12 @@ openerp.web_m2x_options = function (instance) { if(this.is_option_set(this.options.m2o_dialog) || _.isUndefined(this.options.m2o_dialog) && this.is_option_set(this.view.ir_options['web_m2x_options.m2o_dialog']) || this.can_create && _.isUndefined(this.options.m2o_dialog) && _.isUndefined(this.view.ir_options['web_m2x_options.m2o_dialog'])) { - new instance.web.form.M2ODialog(this).open(); + new M2ODialog(this).open(); } }, get_search_result: function (search_val) { - var Objects = new instance.web.Model(this.field.relation); + var Objects = new Model(this.field.relation); var def = $.Deferred(); var self = this; // add options limit used to change number of selections record @@ -77,30 +115,25 @@ openerp.web_m2x_options = function (instance) { this.limit = this.options.limit; } - // add options search_more to force enable or disable search_more button - if (this.is_option_set(this.options.search_more) || _.isUndefined(this.options.search_more) && this.is_option_set(self.view.ir_options['web_m2x_options.search_more'])) { - this.search_more = true - } - // add options field_color and colors to color item(s) depending on field_color value this.field_color = this.options.field_color this.colors = this.options.colors - var dataset = new instance.web.DataSet(this, this.field.relation, + var dataset = new data.DataSet(this, this.field.relation, self.build_context()); var blacklist = this.get_search_blacklist(); this.last_query = search_val; var search_result = this.orderer.add(dataset.name_search( search_val, - new instance.web.CompoundDomain( + new data.CompoundDomain( self.build_domain(), [["id", "not in", blacklist]]), 'ilike', this.limit + 1, self.build_context())); var create_rights; - if (!(self.options && (self.options.no_create || self.options.no_create_edit))) { - create_rights = new instance.web.Model(this.field.relation).call( + if (!(self.options && (self.is_option_set(self.options.create) || self.is_option_set(self.options.create_edit)))) { + create_rights = new Model(this.field.relation).call( "check_access_rights", ["create", false]); } @@ -120,13 +153,11 @@ openerp.web_m2x_options = function (instance) { }); // Search result value colors - if (self.colors && self.field_color) { var value_ids = []; for (var index in values) { value_ids.push(values[index].id); } - // RPC request to get field_color from Objects Objects.query([self.field_color]) .filter([['id', 'in', value_ids]]) @@ -136,7 +167,6 @@ openerp.web_m2x_options = function (instance) { if (values[index_value].id == objects[index].id) { // Find value in values by comparing ids var value = values[index_value]; - // Find color with field value as key var color = self.colors[objects[index][self.field_color]] || 'black'; value.label = ''+value.label+''; @@ -149,8 +179,11 @@ openerp.web_m2x_options = function (instance) { } // search more... if more results that max + var can_search_more = (self.options && self.is_option_set(self.options.search_more)), + search_more_undef = _.isUndefined(self.options.search_more) && _.isUndefined(self.view.ir_options['web_m2x_options.search_more']), + search_more = self.is_option_set(self.view.ir_options['web_m2x_options.search_more']); - if (values.length > self.limit || self.search_more) { + if (values.length > self.limit && (can_search_more || search_more_undef || search_more)) { values = values.slice(0, self.limit); values.push({ label: _t("Search More..."), @@ -164,7 +197,7 @@ openerp.web_m2x_options = function (instance) { self._search_create_popup("search", data); }); }, - classname: 'oe_m2o_dropdown_option' + classname: 'oe_m2o_dropdown_option o_m2o_dropdown_option' }); } @@ -173,16 +206,12 @@ openerp.web_m2x_options = function (instance) { var raw_result = _(data.result).map(function (x) { return x[1]; }); - var no_quick_create = ( - self.options && (self.options.no_create || - self.options.no_quick_create) - ) - var m2x_create_undef = _.isUndefined(self.view.ir_options['web_m2x_options.create']) - var m2x_create = self.view.ir_options['web_m2x_options.create'] == "True" - - if (!no_quick_create && ((m2x_create_undef && can_create) || - m2x_create)) { - + var quick_create = self.is_option_set(self.options.create) || self.is_option_set(self.options.quick_create), + quick_create_undef = _.isUndefined(self.options.create) && _.isUndefined(self.options.quick_create), + m2x_create_undef = _.isUndefined(self.view.ir_options['web_m2x_options.create']), + m2x_create = self.is_option_set(self.view.ir_options['web_m2x_options.create']); + var show_create = (!self.options && (m2x_create_undef || m2x_create)) || (self.options && (quick_create || (quick_create_undef && (m2x_create_undef || m2x_create)))); + if (show_create){ if (search_val.length > 0 && !_.include(raw_result, search_val)) { @@ -193,22 +222,18 @@ openerp.web_m2x_options = function (instance) { action: function () { self._quick_create(search_val); }, - classname: 'oe_m2o_dropdown_option' + classname: 'oe_m2o_dropdown_option o_m2o_dropdown_option' }); } } // create... - var no_create_edit = ( - self.options && (self.options.no_create || - self.options.no_create_edit) - ) - var m2x_create_edit_undef = _.isUndefined(self.view.ir_options['web_m2x_options.create_edit']) - var m2x_create_edit = self.view.ir_options['web_m2x_options.create_edit'] == "True" - - if (!no_create_edit && ((m2x_create_edit_undef && can_create) || - m2x_create_edit)) { - + var create_edit = self.is_option_set(self.options.create) || self.is_option_set(self.options.create_edit), + create_edit_undef = _.isUndefined(self.options.create) && _.isUndefined(self.options.create_edit), + m2x_create_edit_undef = _.isUndefined(self.view.ir_options['web_m2x_options.create_edit']), + m2x_create_edit = self.is_option_set(self.view.ir_options['web_m2x_options.create_edit']); + var show_create_edit = (!self.options && (m2x_create_edit_undef || m2x_create_edit)) || (self.options && (create_edit || (create_edit_undef && (m2x_create_edit_undef || m2x_create_edit)))); + if (show_create_edit){ values.push({ label: _t("Create and Edit..."), action: function () { @@ -216,10 +241,9 @@ openerp.web_m2x_options = function (instance) { "form", undefined, self._create_context(search_val)); }, - classname: 'oe_m2o_dropdown_option' + classname: 'oe_m2o_dropdown_option o_m2o_dropdown_option' }); } - // Check if colors specified to wait for RPC if (!(self.field_color && self.colors)){ def.resolve(values); @@ -230,12 +254,19 @@ openerp.web_m2x_options = function (instance) { } }); - instance.web.form.FieldMany2ManyTags.include({ - + form_relational.FieldMany2ManyTags.include({ + events: { + 'click .o_delete': function(e) { + this.remove_id($(e.target).parent().data('id')); + }, + 'click .badge': 'open_badge', + 'mousedown .o_colorpicker span': 'update_color', + 'focusout .o_colorpicker': 'close_color_picker', + }, show_error_displayer: function () { if ((typeof this.options.m2o_dialog === 'undefined' && this.can_create) || this.options.m2o_dialog) { - new instance.web.form.M2ODialog(this).open(); + new M2ODialog(this).open(); } }, @@ -249,7 +280,7 @@ openerp.web_m2x_options = function (instance) { if (_.isUndefined(this.view.ir_options_loaded)) { this.view.ir_options_loaded = $.Deferred(); this.view.ir_options = {}; - (new instance.web.Model("ir.config_parameter")) + (new Model("ir.config_parameter")) .query(["key", "value"]).filter([['key', 'in', OPTIONS]]) .all().then(function(records) { _(records).each(function(record) { @@ -261,6 +292,20 @@ openerp.web_m2x_options = function (instance) { return this.view.ir_options_loaded; }, + is_option_set: function(option) { + if (_.isUndefined(option)) { + return false + } + var is_string = typeof option === 'string' + var is_bool = typeof option === 'boolean' + if (is_string) { + return option === 'true' || option === 'True' + } else if (is_bool) { + return option + } + return false + }, + /** * Call this method to search using a string. */ @@ -279,12 +324,12 @@ openerp.web_m2x_options = function (instance) { this.limit = this.options.limit; } - var dataset = new instance.web.DataSet(this, this.field.relation, self.build_context()); + var dataset = new data.DataSet(this, this.field.relation, self.build_context()); var blacklist = this.get_search_blacklist(); this.last_query = search_val; return this.orderer.add(dataset.name_search( - search_val, new instance.web.CompoundDomain(self.build_domain(), [["id", "not in", blacklist]]), + search_val, new data.CompoundDomain(self.build_domain(), [["id", "not in", blacklist]]), 'ilike', this.limit + 1, self.build_context())).then(function(data) { self.last_search = data; // possible selections for the m2o @@ -304,6 +349,7 @@ openerp.web_m2x_options = function (instance) { values.push({ label: _t("Search More..."), action: function() { + // limit = 80 for improving performance, similar // to Odoo implementation here: // https://github.com/odoo/odoo/commit/8c3cdce539d87775b59b3f2d5ceb433f995821bf @@ -311,18 +357,16 @@ openerp.web_m2x_options = function (instance) { self._search_create_popup("search", data); }); }, - classname: 'oe_m2o_dropdown_option' + classname: 'oe_m2o_dropdown_option o_m2o_dropdown_option' }); } // quick create - var no_quick_create = ( - self.options && (self.options.no_create || - self.options.no_quick_create) - ) - var m2x_create_undef = _.isUndefined(self.view.ir_options['web_m2x_options.create']) - var m2x_create = self.view.ir_options['web_m2x_options.create'] == "True" - - if (!no_quick_create && (m2x_create_undef || m2x_create)) { + var quick_create = self.is_option_set(self.options.create) || self.is_option_set(self.options.quick_create), + quick_create_undef = _.isUndefined(self.options.create) && _.isUndefined(self.options.quick_create), + m2x_create_undef = _.isUndefined(self.view.ir_options['web_m2x_options.create']), + m2x_create = self.is_option_set(self.view.ir_options['web_m2x_options.create']); + var show_create = (!self.options && (m2x_create_undef || m2x_create)) || (self.options && (quick_create || (quick_create_undef && (m2x_create_undef || m2x_create)))); + if (show_create){ var raw_result = _(data.result).map(function(x) {return x[1];}); if (search_val.length > 0 && !_.include(raw_result, search_val)) { @@ -332,27 +376,25 @@ openerp.web_m2x_options = function (instance) { action: function() { self._quick_create(search_val); }, - classname: 'oe_m2o_dropdown_option' + classname: 'oe_m2o_dropdown_option o_m2o_dropdown_option' }); } } // create... - var no_create_edit = ( - self.options && (self.options.no_create || - self.options.no_create_edit) - ) - var m2x_create_edit_undef = _.isUndefined(self.view.ir_options['web_m2x_options.create_edit']) - var m2x_create_edit = self.view.ir_options['web_m2x_options.create_edit'] == "True" - - if (!no_create_edit && (m2x_create_edit_undef || m2x_create_edit)) { + var create_edit = self.is_option_set(self.options.create) || self.is_option_set(self.options.create_edit), + create_edit_undef = _.isUndefined(self.options.create) && _.isUndefined(self.options.create_edit), + m2x_create_edit_undef = _.isUndefined(self.view.ir_options['web_m2x_options.create_edit']), + m2x_create_edit = self.is_option_set(self.view.ir_options['web_m2x_options.create_edit']); + var show_create_edit = (!self.options && (m2x_create_edit_undef || m2x_create_edit)) || (self.options && (create_edit || (create_edit_undef && (m2x_create_edit_undef || m2x_create_edit)))); + if (show_create_edit){ values.push({ label: _t("Create and Edit..."), action: function() { self._search_create_popup("form", undefined, self._create_context(search_val)); }, - classname: 'oe_m2o_dropdown_option' + classname: 'oe_m2o_dropdown_option o_m2o_dropdown_option' }); } @@ -360,29 +402,24 @@ openerp.web_m2x_options = function (instance) { }) }, - render_value: function() - { + open_badge: function(ev){ var self = this; - return jQuery.when(this._super.apply(this, arguments)) - .then(function() - { - if(self.options.open) - { - self.$el.find('.oe_tag') - .css('cursor', 'pointer') - .click(function(e) - { - var id = parseInt(jQuery(this).attr('data-id')); - self.do_action({ - type: 'ir.actions.act_window', - res_model: self.field.relation, - views: [[false, 'form']], - res_id: id, - }); + var open = (self.options && self.is_option_set(self.options.open)); + if(open){ + self.mutex.exec(function(){ + var id = parseInt($(ev.handleObj.selector).attr('data-id')); + self.do_action({ + type: 'ir.actions.act_window', + res_model: self.field.relation, + views: [[false, 'form']], + res_id: id, + target: "new" }); - } - }); + }.bind(this)); + }else{ + self.open_color_picker(ev); + } }, - }); -}; + }); +}); diff --git a/web_m2x_options/static/src/xml/base.xml b/web_m2x_options/static/src/xml/base.xml index 9fbf425eaadc..8b9421d190ac 100644 --- a/web_m2x_options/static/src/xml/base.xml +++ b/web_m2x_options/static/src/xml/base.xml @@ -6,7 +6,7 @@ - + jQuery(this).attr('t-att-data-id', 'el[0]'); From 3a0c10a8580b623addebd63d982636ef5b8eebf0 Mon Sep 17 00:00:00 2001 From: "Laurent Mignon (ACSONE)" Date: Mon, 24 Oct 2016 16:10:19 +0200 Subject: [PATCH 121/454] Makes the module compatible with Odoo community --- web_m2x_options/static/src/js/form.js | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/web_m2x_options/static/src/js/form.js b/web_m2x_options/static/src/js/form.js index 8e97ad3ecb1d..f2a281725b4b 100644 --- a/web_m2x_options/static/src/js/form.js +++ b/web_m2x_options/static/src/js/form.js @@ -19,6 +19,11 @@ odoo.define('web_m2x_options.web_m2x_options', function (require) { 'web_m2x_options.search_more', 'web_m2x_options.m2o_dialog',]; + // In odoo 9.c FielMany2One is not exposed by form_relational + // To bypass this limitation we use the widget registry to get the + // reference to the FielMany2One widget. + var FieldMany2One = core.form_widget_registry.get('many2one'); + var M2ODialog = Dialog.extend({ template: "M2ODialog", init: function(parent) { @@ -52,7 +57,7 @@ odoo.define('web_m2x_options.web_m2x_options', function (require) { }, }); - form_relational.FieldMany2One.include({ + FieldMany2One.include({ start: function() { this._super.apply(this, arguments); @@ -188,12 +193,12 @@ odoo.define('web_m2x_options.web_m2x_options', function (require) { values.push({ label: _t("Search More..."), action: function () { - // limit = 80 for improving performance, similar + // limit = 160 for improving performance, similar // to Odoo implementation here: - // https://github.com/odoo/odoo/commit/8c3cdce539d87775b59b3f2d5ceb433f995821bf + // https://github.com/odoo/odoo/blob/feeac2a4f1cd777770dd2b42534904ac71f23e46/addons/web/static/src/js/views/form_common.js#L213 dataset.name_search( search_val, self.build_domain(), - 'ilike', 80).done(function (data) { + 'ilike', 160).done(function (data) { self._search_create_popup("search", data); }); }, From 1368eb03c9d0f2254b685f3b83f810d1a4d74aed Mon Sep 17 00:00:00 2001 From: Zakaria Makrelouf Date: Thu, 2 Feb 2017 13:30:29 +0100 Subject: [PATCH 122/454] web_m2x_options: s/ev.handleObj.selector/currentTarget * many2many with `options={'open': True}` it always open the first element with this fix it will open the right one --- web_m2x_options/static/src/js/form.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web_m2x_options/static/src/js/form.js b/web_m2x_options/static/src/js/form.js index f2a281725b4b..4b8d0ad13eea 100644 --- a/web_m2x_options/static/src/js/form.js +++ b/web_m2x_options/static/src/js/form.js @@ -412,7 +412,7 @@ odoo.define('web_m2x_options.web_m2x_options', function (require) { var open = (self.options && self.is_option_set(self.options.open)); if(open){ self.mutex.exec(function(){ - var id = parseInt($(ev.handleObj.selector).attr('data-id')); + var id = parseInt($(ev.currentTarget).data('id')); self.do_action({ type: 'ir.actions.act_window', res_model: self.field.relation, From f638b430baa8086790ae7944ab9c44cf44c92135 Mon Sep 17 00:00:00 2001 From: Jairo Llopis Date: Wed, 8 Mar 2017 19:19:19 +0100 Subject: [PATCH 123/454] Fix Qweb templates. (#561) * [FIX][web_m2x_options] Fix Qweb templates. They were trying to replace non-existing elements, and this was being logged to console: Can't find "a.oe_m2o_cm_button" when extending template FieldMany2One Can't find "span.badge" when extending template FieldMany2ManyTag * Raise version correctly. * [FIX] Make many2many_tags tag deletion work again * Correct replacement of event Instead of overwriting all events from upstream widget, better just overwrite the one you need and inherit the rest. --- web_m2x_options/README.rst | 3 +- web_m2x_options/__openerp__.py | 5 +- web_m2x_options/i18n/ar.po | 66 +++++++++++++++---- web_m2x_options/i18n/de.po | 69 ++++++++++++++++---- web_m2x_options/i18n/es.po | 66 +++++++++++++++---- web_m2x_options/i18n/fi.po | 66 +++++++++++++++---- web_m2x_options/i18n/fr.po | 66 +++++++++++++++---- web_m2x_options/i18n/hr.po | 86 +++++++++++++++++++++++++ web_m2x_options/i18n/it.po | 78 +++++++++++++++------- web_m2x_options/i18n/nl_NL.po | 85 ++++++++++++++++++++++++ web_m2x_options/i18n/pt_BR.po | 68 +++++++++++++++---- web_m2x_options/i18n/sl.po | 66 +++++++++++++++---- web_m2x_options/i18n/tr.po | 67 +++++++++++++++---- web_m2x_options/static/src/js/form.js | 10 +-- web_m2x_options/static/src/xml/base.xml | 16 ++--- 15 files changed, 677 insertions(+), 140 deletions(-) create mode 100644 web_m2x_options/i18n/hr.po create mode 100644 web_m2x_options/i18n/nl_NL.po diff --git a/web_m2x_options/README.rst b/web_m2x_options/README.rst index dff75f05fe73..98cefc3c2dc6 100644 --- a/web_m2x_options/README.rst +++ b/web_m2x_options/README.rst @@ -116,7 +116,7 @@ Your XML form view definition could contain:: Known issues ============ -Double check that you have no inherited view that remove ``options`` you set on a field ! +Double check that you have no inherited view that remove ``options`` you set on a field ! If nothing works, add a debugger in the first line of ``get_search_result method`` and enable debug mode in Odoo. When you write something in a many2one field, javascript debugger should pause. If not verify your installation. Roadmap @@ -146,6 +146,7 @@ Contributors * Nicolas JEUDY * Yannick Vaucher * Zakaria Makrelouf +* Jairo Llopis Maintainer ---------- diff --git a/web_m2x_options/__openerp__.py b/web_m2x_options/__openerp__.py index 94c1a525bd55..7206c3ca0331 100644 --- a/web_m2x_options/__openerp__.py +++ b/web_m2x_options/__openerp__.py @@ -2,7 +2,7 @@ { "name": 'web_m2x_options', - "version": "9.0.1.0.0", + "version": "9.0.1.1.0", "depends": [ 'base', 'web', @@ -12,6 +12,7 @@ ], 'license': 'AGPL-3', 'data': ['views/view.xml'], - "author": "ACSONE SA/NV, 0k.io,Odoo Community Association (OCA)", + "author": "ACSONE SA/NV, 0k.io, Tecnativa, " + "Odoo Community Association (OCA)", 'installable': True, } diff --git a/web_m2x_options/i18n/ar.po b/web_m2x_options/i18n/ar.po index 124f84ceecdc..6253ba90233d 100644 --- a/web_m2x_options/i18n/ar.po +++ b/web_m2x_options/i18n/ar.po @@ -3,15 +3,15 @@ # * web_m2x_options # # Translators: -# SaFi J. , 2015 +# OCA Transbot , 2017 msgid "" msgstr "" -"Project-Id-Version: web (8.0)\n" +"Project-Id-Version: Odoo Server 10.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2016-02-26 02:05+0000\n" -"PO-Revision-Date: 2015-12-16 17:30+0000\n" -"Last-Translator: SaFi J. \n" -"Language-Team: Arabic (http://www.transifex.com/oca/OCA-web-8-0/language/ar/)\n" +"POT-Creation-Date: 2018-01-03 03:50+0000\n" +"PO-Revision-Date: 2018-01-03 03:50+0000\n" +"Last-Translator: OCA Transbot , 2017\n" +"Language-Team: Arabic (https://www.transifex.com/oca/teams/23907/ar/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" @@ -20,24 +20,66 @@ msgstr "" #. module: web_m2x_options #. openerp-web -#: code:addons/web_m2x_options/static/src/js/form.js:219 -#: code:addons/web_m2x_options/static/src/js/form.js:373 +#: code:addons/web_m2x_options/static/src/xml/base.xml:8 +#, python-format +msgid "!(widget.options.no_open || widget.options.no_open_edit)" +msgstr "" + +#. module: web_m2x_options +#. openerp-web +#: code:addons/web_m2x_options/static/src/js/form.js:47 +#, python-format +msgid "Cancel" +msgstr "إلغاء" + +#. module: web_m2x_options +#. openerp-web +#: code:addons/web_m2x_options/static/src/js/form.js:33 +#, python-format +msgid "Create" +msgstr "" + +#. module: web_m2x_options +#. openerp-web +#: code:addons/web_m2x_options/static/src/js/form.js:232 +#: code:addons/web_m2x_options/static/src/js/form.js:382 #, python-format msgid "Create \"%s\"" msgstr "إنشاء \"%s\"" #. module: web_m2x_options #. openerp-web -#: code:addons/web_m2x_options/static/src/js/form.js:237 -#: code:addons/web_m2x_options/static/src/js/form.js:392 +#: code:addons/web_m2x_options/static/src/js/form.js:30 +#, python-format +msgid "Create a %s" +msgstr "" + +#. module: web_m2x_options +#. openerp-web +#: code:addons/web_m2x_options/static/src/js/form.js:250 +#: code:addons/web_m2x_options/static/src/js/form.js:401 #, python-format msgid "Create and Edit..." msgstr "إنشاء وتحرير ..." #. module: web_m2x_options #. openerp-web -#: code:addons/web_m2x_options/static/src/js/form.js:188 -#: code:addons/web_m2x_options/static/src/js/form.js:349 +#: code:addons/web_m2x_options/static/src/js/form.js:43 +#, python-format +msgid "Create and edit" +msgstr "" + +#. module: web_m2x_options +#. openerp-web +#: code:addons/web_m2x_options/static/src/js/form.js:201 +#: code:addons/web_m2x_options/static/src/js/form.js:358 #, python-format msgid "Search More..." msgstr "البحث عن المزيد ..." + +#. module: web_m2x_options +#. openerp-web +#: code:addons/web_m2x_options/static/src/js/form.js:52 +#, python-format +msgid "You are creating a new %s, are you sure it does not exist yet?" +msgstr "" diff --git a/web_m2x_options/i18n/de.po b/web_m2x_options/i18n/de.po index 40eb8cacde07..da119936d9a9 100644 --- a/web_m2x_options/i18n/de.po +++ b/web_m2x_options/i18n/de.po @@ -3,15 +3,16 @@ # * web_m2x_options # # Translators: -# Rudolf Schnapka , 2016 +# OCA Transbot , 2017 +# Rudolf Schnapka , 2018 msgid "" msgstr "" -"Project-Id-Version: web (8.0)\n" +"Project-Id-Version: Odoo Server 10.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2016-02-26 02:05+0000\n" -"PO-Revision-Date: 2016-01-18 20:15+0000\n" -"Last-Translator: Rudolf Schnapka \n" -"Language-Team: German (http://www.transifex.com/oca/OCA-web-8-0/language/de/)\n" +"POT-Creation-Date: 2018-01-03 03:50+0000\n" +"PO-Revision-Date: 2018-01-03 03:50+0000\n" +"Last-Translator: Rudolf Schnapka , 2018\n" +"Language-Team: German (https://www.transifex.com/oca/teams/23907/de/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" @@ -20,24 +21,68 @@ msgstr "" #. module: web_m2x_options #. openerp-web -#: code:addons/web_m2x_options/static/src/js/form.js:219 -#: code:addons/web_m2x_options/static/src/js/form.js:373 +#: code:addons/web_m2x_options/static/src/xml/base.xml:8 +#, python-format +msgid "!(widget.options.no_open || widget.options.no_open_edit)" +msgstr "!(widget.options.no_open || widget.options.no_open_edit)" + +#. module: web_m2x_options +#. openerp-web +#: code:addons/web_m2x_options/static/src/js/form.js:47 +#, python-format +msgid "Cancel" +msgstr "Abbrechen" + +#. module: web_m2x_options +#. openerp-web +#: code:addons/web_m2x_options/static/src/js/form.js:33 +#, python-format +msgid "Create" +msgstr "Anlegen" + +#. module: web_m2x_options +#. openerp-web +#: code:addons/web_m2x_options/static/src/js/form.js:232 +#: code:addons/web_m2x_options/static/src/js/form.js:382 #, python-format msgid "Create \"%s\"" msgstr "Anlegen \"%s" #. module: web_m2x_options #. openerp-web -#: code:addons/web_m2x_options/static/src/js/form.js:237 -#: code:addons/web_m2x_options/static/src/js/form.js:392 +#: code:addons/web_m2x_options/static/src/js/form.js:30 +#, python-format +msgid "Create a %s" +msgstr "Eine %s anlegen" + +#. module: web_m2x_options +#. openerp-web +#: code:addons/web_m2x_options/static/src/js/form.js:250 +#: code:addons/web_m2x_options/static/src/js/form.js:401 #, python-format msgid "Create and Edit..." msgstr "Anlegen und Bearbeiten" #. module: web_m2x_options #. openerp-web -#: code:addons/web_m2x_options/static/src/js/form.js:188 -#: code:addons/web_m2x_options/static/src/js/form.js:349 +#: code:addons/web_m2x_options/static/src/js/form.js:43 +#, python-format +msgid "Create and edit" +msgstr "Anlegen und bearbeiten" + +#. module: web_m2x_options +#. openerp-web +#: code:addons/web_m2x_options/static/src/js/form.js:201 +#: code:addons/web_m2x_options/static/src/js/form.js:358 #, python-format msgid "Search More..." msgstr "Suche weitere..." + +#. module: web_m2x_options +#. openerp-web +#: code:addons/web_m2x_options/static/src/js/form.js:52 +#, python-format +msgid "You are creating a new %s, are you sure it does not exist yet?" +msgstr "" +"Sie legen eine neue %s an, sind Sie sicher, dass diese nicht bereits " +"vorhanden ist?" diff --git a/web_m2x_options/i18n/es.po b/web_m2x_options/i18n/es.po index bd3b1e51bc9d..0c2c9feb215b 100644 --- a/web_m2x_options/i18n/es.po +++ b/web_m2x_options/i18n/es.po @@ -3,15 +3,15 @@ # * web_m2x_options # # Translators: -# Pedro M. Baeza , 2015 +# OCA Transbot , 2017 msgid "" msgstr "" -"Project-Id-Version: web (8.0)\n" +"Project-Id-Version: Odoo Server 10.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2016-02-26 02:05+0000\n" -"PO-Revision-Date: 2015-11-07 11:28+0000\n" -"Last-Translator: Pedro M. Baeza \n" -"Language-Team: Spanish (http://www.transifex.com/oca/OCA-web-8-0/language/es/)\n" +"POT-Creation-Date: 2018-01-03 03:50+0000\n" +"PO-Revision-Date: 2018-01-03 03:50+0000\n" +"Last-Translator: OCA Transbot , 2017\n" +"Language-Team: Spanish (https://www.transifex.com/oca/teams/23907/es/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" @@ -20,24 +20,66 @@ msgstr "" #. module: web_m2x_options #. openerp-web -#: code:addons/web_m2x_options/static/src/js/form.js:219 -#: code:addons/web_m2x_options/static/src/js/form.js:373 +#: code:addons/web_m2x_options/static/src/xml/base.xml:8 +#, python-format +msgid "!(widget.options.no_open || widget.options.no_open_edit)" +msgstr "" + +#. module: web_m2x_options +#. openerp-web +#: code:addons/web_m2x_options/static/src/js/form.js:47 +#, python-format +msgid "Cancel" +msgstr "Cancelar" + +#. module: web_m2x_options +#. openerp-web +#: code:addons/web_m2x_options/static/src/js/form.js:33 +#, python-format +msgid "Create" +msgstr "Crear" + +#. module: web_m2x_options +#. openerp-web +#: code:addons/web_m2x_options/static/src/js/form.js:232 +#: code:addons/web_m2x_options/static/src/js/form.js:382 #, python-format msgid "Create \"%s\"" msgstr "Crear \"%s\"" #. module: web_m2x_options #. openerp-web -#: code:addons/web_m2x_options/static/src/js/form.js:237 -#: code:addons/web_m2x_options/static/src/js/form.js:392 +#: code:addons/web_m2x_options/static/src/js/form.js:30 +#, python-format +msgid "Create a %s" +msgstr "Crear un %s" + +#. module: web_m2x_options +#. openerp-web +#: code:addons/web_m2x_options/static/src/js/form.js:250 +#: code:addons/web_m2x_options/static/src/js/form.js:401 #, python-format msgid "Create and Edit..." msgstr "Crear y editar..." #. module: web_m2x_options #. openerp-web -#: code:addons/web_m2x_options/static/src/js/form.js:188 -#: code:addons/web_m2x_options/static/src/js/form.js:349 +#: code:addons/web_m2x_options/static/src/js/form.js:43 +#, python-format +msgid "Create and edit" +msgstr "Crear y editar" + +#. module: web_m2x_options +#. openerp-web +#: code:addons/web_m2x_options/static/src/js/form.js:201 +#: code:addons/web_m2x_options/static/src/js/form.js:358 #, python-format msgid "Search More..." msgstr "Buscar más..." + +#. module: web_m2x_options +#. openerp-web +#: code:addons/web_m2x_options/static/src/js/form.js:52 +#, python-format +msgid "You are creating a new %s, are you sure it does not exist yet?" +msgstr "Está creando un nuevo %s, ¿está seguro de no existe ya?" diff --git a/web_m2x_options/i18n/fi.po b/web_m2x_options/i18n/fi.po index b374d7eb9458..0d5a5c6cc520 100644 --- a/web_m2x_options/i18n/fi.po +++ b/web_m2x_options/i18n/fi.po @@ -3,15 +3,15 @@ # * web_m2x_options # # Translators: -# Jarmo Kortetjärvi , 2016 +# OCA Transbot , 2017 msgid "" msgstr "" -"Project-Id-Version: web (8.0)\n" +"Project-Id-Version: Odoo Server 10.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2016-02-26 02:05+0000\n" -"PO-Revision-Date: 2016-02-01 09:52+0000\n" -"Last-Translator: Jarmo Kortetjärvi \n" -"Language-Team: Finnish (http://www.transifex.com/oca/OCA-web-8-0/language/fi/)\n" +"POT-Creation-Date: 2018-01-03 03:50+0000\n" +"PO-Revision-Date: 2018-01-03 03:50+0000\n" +"Last-Translator: OCA Transbot , 2017\n" +"Language-Team: Finnish (https://www.transifex.com/oca/teams/23907/fi/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" @@ -20,24 +20,66 @@ msgstr "" #. module: web_m2x_options #. openerp-web -#: code:addons/web_m2x_options/static/src/js/form.js:219 -#: code:addons/web_m2x_options/static/src/js/form.js:373 +#: code:addons/web_m2x_options/static/src/xml/base.xml:8 +#, python-format +msgid "!(widget.options.no_open || widget.options.no_open_edit)" +msgstr "" + +#. module: web_m2x_options +#. openerp-web +#: code:addons/web_m2x_options/static/src/js/form.js:47 +#, python-format +msgid "Cancel" +msgstr "Peru" + +#. module: web_m2x_options +#. openerp-web +#: code:addons/web_m2x_options/static/src/js/form.js:33 +#, python-format +msgid "Create" +msgstr "" + +#. module: web_m2x_options +#. openerp-web +#: code:addons/web_m2x_options/static/src/js/form.js:232 +#: code:addons/web_m2x_options/static/src/js/form.js:382 #, python-format msgid "Create \"%s\"" msgstr "Luo \"%s\"" #. module: web_m2x_options #. openerp-web -#: code:addons/web_m2x_options/static/src/js/form.js:237 -#: code:addons/web_m2x_options/static/src/js/form.js:392 +#: code:addons/web_m2x_options/static/src/js/form.js:30 +#, python-format +msgid "Create a %s" +msgstr "" + +#. module: web_m2x_options +#. openerp-web +#: code:addons/web_m2x_options/static/src/js/form.js:250 +#: code:addons/web_m2x_options/static/src/js/form.js:401 #, python-format msgid "Create and Edit..." msgstr "Luo ja muokkaa..." #. module: web_m2x_options #. openerp-web -#: code:addons/web_m2x_options/static/src/js/form.js:188 -#: code:addons/web_m2x_options/static/src/js/form.js:349 +#: code:addons/web_m2x_options/static/src/js/form.js:43 +#, python-format +msgid "Create and edit" +msgstr "" + +#. module: web_m2x_options +#. openerp-web +#: code:addons/web_m2x_options/static/src/js/form.js:201 +#: code:addons/web_m2x_options/static/src/js/form.js:358 #, python-format msgid "Search More..." msgstr "Hae lisää..." + +#. module: web_m2x_options +#. openerp-web +#: code:addons/web_m2x_options/static/src/js/form.js:52 +#, python-format +msgid "You are creating a new %s, are you sure it does not exist yet?" +msgstr "" diff --git a/web_m2x_options/i18n/fr.po b/web_m2x_options/i18n/fr.po index 3be5ae233eab..31647daf9534 100644 --- a/web_m2x_options/i18n/fr.po +++ b/web_m2x_options/i18n/fr.po @@ -3,15 +3,15 @@ # * web_m2x_options # # Translators: -# Christophe CHAUVET , 2016 +# OCA Transbot , 2017 msgid "" msgstr "" -"Project-Id-Version: web (8.0)\n" +"Project-Id-Version: Odoo Server 10.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2016-05-06 15:50+0000\n" -"PO-Revision-Date: 2016-05-06 08:27+0000\n" -"Last-Translator: Christophe CHAUVET \n" -"Language-Team: French (http://www.transifex.com/oca/OCA-web-8-0/language/fr/)\n" +"POT-Creation-Date: 2018-01-03 03:50+0000\n" +"PO-Revision-Date: 2018-01-03 03:50+0000\n" +"Last-Translator: OCA Transbot , 2017\n" +"Language-Team: French (https://www.transifex.com/oca/teams/23907/fr/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" @@ -20,24 +20,66 @@ msgstr "" #. module: web_m2x_options #. openerp-web -#: code:addons/web_m2x_options/static/src/js/form.js:219 -#: code:addons/web_m2x_options/static/src/js/form.js:373 +#: code:addons/web_m2x_options/static/src/xml/base.xml:8 +#, python-format +msgid "!(widget.options.no_open || widget.options.no_open_edit)" +msgstr "" + +#. module: web_m2x_options +#. openerp-web +#: code:addons/web_m2x_options/static/src/js/form.js:47 +#, python-format +msgid "Cancel" +msgstr "Annuler" + +#. module: web_m2x_options +#. openerp-web +#: code:addons/web_m2x_options/static/src/js/form.js:33 +#, python-format +msgid "Create" +msgstr "" + +#. module: web_m2x_options +#. openerp-web +#: code:addons/web_m2x_options/static/src/js/form.js:232 +#: code:addons/web_m2x_options/static/src/js/form.js:382 #, python-format msgid "Create \"%s\"" msgstr "Creer \"%s\"" #. module: web_m2x_options #. openerp-web -#: code:addons/web_m2x_options/static/src/js/form.js:237 -#: code:addons/web_m2x_options/static/src/js/form.js:392 +#: code:addons/web_m2x_options/static/src/js/form.js:30 +#, python-format +msgid "Create a %s" +msgstr "" + +#. module: web_m2x_options +#. openerp-web +#: code:addons/web_m2x_options/static/src/js/form.js:250 +#: code:addons/web_m2x_options/static/src/js/form.js:401 #, python-format msgid "Create and Edit..." msgstr "Créer et modifier..." #. module: web_m2x_options #. openerp-web -#: code:addons/web_m2x_options/static/src/js/form.js:188 -#: code:addons/web_m2x_options/static/src/js/form.js:349 +#: code:addons/web_m2x_options/static/src/js/form.js:43 +#, python-format +msgid "Create and edit" +msgstr "" + +#. module: web_m2x_options +#. openerp-web +#: code:addons/web_m2x_options/static/src/js/form.js:201 +#: code:addons/web_m2x_options/static/src/js/form.js:358 #, python-format msgid "Search More..." msgstr "Rechercher plus..." + +#. module: web_m2x_options +#. openerp-web +#: code:addons/web_m2x_options/static/src/js/form.js:52 +#, python-format +msgid "You are creating a new %s, are you sure it does not exist yet?" +msgstr "" diff --git a/web_m2x_options/i18n/hr.po b/web_m2x_options/i18n/hr.po new file mode 100644 index 000000000000..644c0b4ba912 --- /dev/null +++ b/web_m2x_options/i18n/hr.po @@ -0,0 +1,86 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * web_m2x_options +# +# Translators: +# Bole , 2017 +# OCA Transbot , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2018-01-03 03:50+0000\n" +"PO-Revision-Date: 2018-01-03 03:50+0000\n" +"Last-Translator: OCA Transbot , 2017\n" +"Language-Team: Croatian (https://www.transifex.com/oca/teams/23907/hr/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: hr\n" +"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n" + +#. module: web_m2x_options +#. openerp-web +#: code:addons/web_m2x_options/static/src/xml/base.xml:8 +#, python-format +msgid "!(widget.options.no_open || widget.options.no_open_edit)" +msgstr "!(opcije isključuju otvaranje ili uređivanje)" + +#. module: web_m2x_options +#. openerp-web +#: code:addons/web_m2x_options/static/src/js/form.js:47 +#, python-format +msgid "Cancel" +msgstr "Otkaži" + +#. module: web_m2x_options +#. openerp-web +#: code:addons/web_m2x_options/static/src/js/form.js:33 +#, python-format +msgid "Create" +msgstr "Kreiraj" + +#. module: web_m2x_options +#. openerp-web +#: code:addons/web_m2x_options/static/src/js/form.js:232 +#: code:addons/web_m2x_options/static/src/js/form.js:382 +#, python-format +msgid "Create \"%s\"" +msgstr "Kreiraj \" %s\"" + +#. module: web_m2x_options +#. openerp-web +#: code:addons/web_m2x_options/static/src/js/form.js:30 +#, python-format +msgid "Create a %s" +msgstr "Kreiraj %s" + +#. module: web_m2x_options +#. openerp-web +#: code:addons/web_m2x_options/static/src/js/form.js:250 +#: code:addons/web_m2x_options/static/src/js/form.js:401 +#, python-format +msgid "Create and Edit..." +msgstr "Kreiraj i uredi..." + +#. module: web_m2x_options +#. openerp-web +#: code:addons/web_m2x_options/static/src/js/form.js:43 +#, python-format +msgid "Create and edit" +msgstr "Kreiraj i uredi" + +#. module: web_m2x_options +#. openerp-web +#: code:addons/web_m2x_options/static/src/js/form.js:201 +#: code:addons/web_m2x_options/static/src/js/form.js:358 +#, python-format +msgid "Search More..." +msgstr "Traži dalje..." + +#. module: web_m2x_options +#. openerp-web +#: code:addons/web_m2x_options/static/src/js/form.js:52 +#, python-format +msgid "You are creating a new %s, are you sure it does not exist yet?" +msgstr "Želite kreirati novi %s, jeste li sigurni da već ne postoji?" diff --git a/web_m2x_options/i18n/it.po b/web_m2x_options/i18n/it.po index c8db1568fdf7..47e767833181 100644 --- a/web_m2x_options/i18n/it.po +++ b/web_m2x_options/i18n/it.po @@ -3,27 +3,15 @@ # * web_m2x_options # # Translators: -# Ahmet Altınışık , 2015 -# Antonio Trueba, 2016 -# Armando Vulcano Junior , 2015 -# Carles Antoli , 2015 -# Bole , 2015 -# FIRST AUTHOR , 2012,2014 -# Giacomo , 2015 -# Hotellook, 2014 -# Jarmo Kortetjärvi , 2016 -# Paolo Valier, 2016 -# Paolo Valier, 2016 -# Rudolf Schnapka , 2016 -# Thomas A. Jaeger, 2015 +# OCA Transbot , 2017 msgid "" msgstr "" -"Project-Id-Version: web (8.0)\n" +"Project-Id-Version: Odoo Server 10.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2016-04-28 07:09+0000\n" -"PO-Revision-Date: 2016-04-28 06:46+0000\n" -"Last-Translator: Paolo Valier\n" -"Language-Team: Italian (http://www.transifex.com/oca/OCA-web-8-0/language/it/)\n" +"POT-Creation-Date: 2018-01-03 03:50+0000\n" +"PO-Revision-Date: 2018-01-03 03:50+0000\n" +"Last-Translator: OCA Transbot , 2017\n" +"Language-Team: Italian (https://www.transifex.com/oca/teams/23907/it/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" @@ -32,24 +20,66 @@ msgstr "" #. module: web_m2x_options #. openerp-web -#: code:addons/web_m2x_options/static/src/js/form.js:219 -#: code:addons/web_m2x_options/static/src/js/form.js:373 +#: code:addons/web_m2x_options/static/src/xml/base.xml:8 +#, python-format +msgid "!(widget.options.no_open || widget.options.no_open_edit)" +msgstr "" + +#. module: web_m2x_options +#. openerp-web +#: code:addons/web_m2x_options/static/src/js/form.js:47 +#, python-format +msgid "Cancel" +msgstr "Annulla" + +#. module: web_m2x_options +#. openerp-web +#: code:addons/web_m2x_options/static/src/js/form.js:33 +#, python-format +msgid "Create" +msgstr "" + +#. module: web_m2x_options +#. openerp-web +#: code:addons/web_m2x_options/static/src/js/form.js:232 +#: code:addons/web_m2x_options/static/src/js/form.js:382 #, python-format msgid "Create \"%s\"" msgstr "Crea \"%s\"" #. module: web_m2x_options #. openerp-web -#: code:addons/web_m2x_options/static/src/js/form.js:237 -#: code:addons/web_m2x_options/static/src/js/form.js:392 +#: code:addons/web_m2x_options/static/src/js/form.js:30 +#, python-format +msgid "Create a %s" +msgstr "" + +#. module: web_m2x_options +#. openerp-web +#: code:addons/web_m2x_options/static/src/js/form.js:250 +#: code:addons/web_m2x_options/static/src/js/form.js:401 #, python-format msgid "Create and Edit..." msgstr "Crea e Modifica..." #. module: web_m2x_options #. openerp-web -#: code:addons/web_m2x_options/static/src/js/form.js:188 -#: code:addons/web_m2x_options/static/src/js/form.js:349 +#: code:addons/web_m2x_options/static/src/js/form.js:43 +#, python-format +msgid "Create and edit" +msgstr "" + +#. module: web_m2x_options +#. openerp-web +#: code:addons/web_m2x_options/static/src/js/form.js:201 +#: code:addons/web_m2x_options/static/src/js/form.js:358 #, python-format msgid "Search More..." msgstr "Cerca altro..." + +#. module: web_m2x_options +#. openerp-web +#: code:addons/web_m2x_options/static/src/js/form.js:52 +#, python-format +msgid "You are creating a new %s, are you sure it does not exist yet?" +msgstr "" diff --git a/web_m2x_options/i18n/nl_NL.po b/web_m2x_options/i18n/nl_NL.po new file mode 100644 index 000000000000..1f7da2402d17 --- /dev/null +++ b/web_m2x_options/i18n/nl_NL.po @@ -0,0 +1,85 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * web_m2x_options +# +# Translators: +# Peter Hageman , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-07-01 03:35+0000\n" +"PO-Revision-Date: 2017-07-01 03:35+0000\n" +"Last-Translator: Peter Hageman , 2017\n" +"Language-Team: Dutch (Netherlands) (https://www.transifex.com/oca/teams/23907/nl_NL/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: nl_NL\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#. module: web_m2x_options +#. openerp-web +#: code:addons/web_m2x_options/static/src/xml/base.xml:8 +#, python-format +msgid "!(widget.options.no_open || widget.options.no_open_edit)" +msgstr "" + +#. module: web_m2x_options +#. openerp-web +#: code:addons/web_m2x_options/static/src/js/form.js:47 +#, python-format +msgid "Cancel" +msgstr "Annuleer" + +#. module: web_m2x_options +#. openerp-web +#: code:addons/web_m2x_options/static/src/js/form.js:33 +#, python-format +msgid "Create" +msgstr "Aanmaken" + +#. module: web_m2x_options +#. openerp-web +#: code:addons/web_m2x_options/static/src/js/form.js:224 +#: code:addons/web_m2x_options/static/src/js/form.js:374 +#, python-format +msgid "Create \"%s\"" +msgstr "" + +#. module: web_m2x_options +#. openerp-web +#: code:addons/web_m2x_options/static/src/js/form.js:30 +#, python-format +msgid "Create a %s" +msgstr "" + +#. module: web_m2x_options +#. openerp-web +#: code:addons/web_m2x_options/static/src/js/form.js:242 +#: code:addons/web_m2x_options/static/src/js/form.js:393 +#, python-format +msgid "Create and Edit..." +msgstr "" + +#. module: web_m2x_options +#. openerp-web +#: code:addons/web_m2x_options/static/src/js/form.js:43 +#, python-format +msgid "Create and edit" +msgstr "" + +#. module: web_m2x_options +#. openerp-web +#: code:addons/web_m2x_options/static/src/js/form.js:193 +#: code:addons/web_m2x_options/static/src/js/form.js:350 +#, python-format +msgid "Search More..." +msgstr "" + +#. module: web_m2x_options +#. openerp-web +#: code:addons/web_m2x_options/static/src/js/form.js:52 +#, python-format +msgid "You are creating a new %s, are you sure it does not exist yet?" +msgstr "" diff --git a/web_m2x_options/i18n/pt_BR.po b/web_m2x_options/i18n/pt_BR.po index cf28995e3eed..538bfc7e7930 100644 --- a/web_m2x_options/i18n/pt_BR.po +++ b/web_m2x_options/i18n/pt_BR.po @@ -3,15 +3,16 @@ # * web_m2x_options # # Translators: -# danimaribeiro , 2016 +# OCA Transbot , 2017 +# Rodrigo de Almeida Sottomaior Macedo , 2017 msgid "" msgstr "" -"Project-Id-Version: web (8.0)\n" +"Project-Id-Version: Odoo Server 10.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2016-03-11 02:17+0000\n" -"PO-Revision-Date: 2016-03-05 16:20+0000\n" -"Last-Translator: danimaribeiro \n" -"Language-Team: Portuguese (Brazil) (http://www.transifex.com/oca/OCA-web-8-0/language/pt_BR/)\n" +"POT-Creation-Date: 2018-01-03 03:50+0000\n" +"PO-Revision-Date: 2018-01-03 03:50+0000\n" +"Last-Translator: Rodrigo de Almeida Sottomaior Macedo , 2017\n" +"Language-Team: Portuguese (Brazil) (https://www.transifex.com/oca/teams/23907/pt_BR/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" @@ -20,24 +21,67 @@ msgstr "" #. module: web_m2x_options #. openerp-web -#: code:addons/web_m2x_options/static/src/js/form.js:219 -#: code:addons/web_m2x_options/static/src/js/form.js:373 +#: code:addons/web_m2x_options/static/src/xml/base.xml:8 +#, python-format +msgid "!(widget.options.no_open || widget.options.no_open_edit)" +msgstr "!(widget.options.no_open || widget.options.no_open_edit)" + +#. module: web_m2x_options +#. openerp-web +#: code:addons/web_m2x_options/static/src/js/form.js:47 +#, python-format +msgid "Cancel" +msgstr "Cancelar" + +#. module: web_m2x_options +#. openerp-web +#: code:addons/web_m2x_options/static/src/js/form.js:33 +#, python-format +msgid "Create" +msgstr "Criar" + +#. module: web_m2x_options +#. openerp-web +#: code:addons/web_m2x_options/static/src/js/form.js:232 +#: code:addons/web_m2x_options/static/src/js/form.js:382 #, python-format msgid "Create \"%s\"" msgstr "Criar \"%s\"" #. module: web_m2x_options #. openerp-web -#: code:addons/web_m2x_options/static/src/js/form.js:237 -#: code:addons/web_m2x_options/static/src/js/form.js:392 +#: code:addons/web_m2x_options/static/src/js/form.js:30 +#, python-format +msgid "Create a %s" +msgstr "Criar um %s" + +#. module: web_m2x_options +#. openerp-web +#: code:addons/web_m2x_options/static/src/js/form.js:250 +#: code:addons/web_m2x_options/static/src/js/form.js:401 #, python-format msgid "Create and Edit..." msgstr "Criar e editar.." #. module: web_m2x_options #. openerp-web -#: code:addons/web_m2x_options/static/src/js/form.js:188 -#: code:addons/web_m2x_options/static/src/js/form.js:349 +#: code:addons/web_m2x_options/static/src/js/form.js:43 +#, python-format +msgid "Create and edit" +msgstr "Criar e editar" + +#. module: web_m2x_options +#. openerp-web +#: code:addons/web_m2x_options/static/src/js/form.js:201 +#: code:addons/web_m2x_options/static/src/js/form.js:358 #, python-format msgid "Search More..." msgstr "Buscar mais..." + +#. module: web_m2x_options +#. openerp-web +#: code:addons/web_m2x_options/static/src/js/form.js:52 +#, python-format +msgid "You are creating a new %s, are you sure it does not exist yet?" +msgstr "" +"Você está criando um novo %s, você tem certeza de que ainda não existe?" diff --git a/web_m2x_options/i18n/sl.po b/web_m2x_options/i18n/sl.po index 7192762e128e..a4e3ae1f3184 100644 --- a/web_m2x_options/i18n/sl.po +++ b/web_m2x_options/i18n/sl.po @@ -3,15 +3,15 @@ # * web_m2x_options # # Translators: -# Matjaž Mozetič , 2015 +# OCA Transbot , 2017 msgid "" msgstr "" -"Project-Id-Version: web (8.0)\n" +"Project-Id-Version: Odoo Server 10.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2016-02-26 02:05+0000\n" -"PO-Revision-Date: 2015-11-08 05:46+0000\n" -"Last-Translator: Matjaž Mozetič \n" -"Language-Team: Slovenian (http://www.transifex.com/oca/OCA-web-8-0/language/sl/)\n" +"POT-Creation-Date: 2018-01-03 03:50+0000\n" +"PO-Revision-Date: 2018-01-03 03:50+0000\n" +"Last-Translator: OCA Transbot , 2017\n" +"Language-Team: Slovenian (https://www.transifex.com/oca/teams/23907/sl/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" @@ -20,24 +20,66 @@ msgstr "" #. module: web_m2x_options #. openerp-web -#: code:addons/web_m2x_options/static/src/js/form.js:219 -#: code:addons/web_m2x_options/static/src/js/form.js:373 +#: code:addons/web_m2x_options/static/src/xml/base.xml:8 +#, python-format +msgid "!(widget.options.no_open || widget.options.no_open_edit)" +msgstr "" + +#. module: web_m2x_options +#. openerp-web +#: code:addons/web_m2x_options/static/src/js/form.js:47 +#, python-format +msgid "Cancel" +msgstr "Preklic" + +#. module: web_m2x_options +#. openerp-web +#: code:addons/web_m2x_options/static/src/js/form.js:33 +#, python-format +msgid "Create" +msgstr "" + +#. module: web_m2x_options +#. openerp-web +#: code:addons/web_m2x_options/static/src/js/form.js:232 +#: code:addons/web_m2x_options/static/src/js/form.js:382 #, python-format msgid "Create \"%s\"" msgstr "Ustvari \"%s\"" #. module: web_m2x_options #. openerp-web -#: code:addons/web_m2x_options/static/src/js/form.js:237 -#: code:addons/web_m2x_options/static/src/js/form.js:392 +#: code:addons/web_m2x_options/static/src/js/form.js:30 +#, python-format +msgid "Create a %s" +msgstr "" + +#. module: web_m2x_options +#. openerp-web +#: code:addons/web_m2x_options/static/src/js/form.js:250 +#: code:addons/web_m2x_options/static/src/js/form.js:401 #, python-format msgid "Create and Edit..." msgstr "Ustvari in urejaj..." #. module: web_m2x_options #. openerp-web -#: code:addons/web_m2x_options/static/src/js/form.js:188 -#: code:addons/web_m2x_options/static/src/js/form.js:349 +#: code:addons/web_m2x_options/static/src/js/form.js:43 +#, python-format +msgid "Create and edit" +msgstr "" + +#. module: web_m2x_options +#. openerp-web +#: code:addons/web_m2x_options/static/src/js/form.js:201 +#: code:addons/web_m2x_options/static/src/js/form.js:358 #, python-format msgid "Search More..." msgstr "Poišči več..." + +#. module: web_m2x_options +#. openerp-web +#: code:addons/web_m2x_options/static/src/js/form.js:52 +#, python-format +msgid "You are creating a new %s, are you sure it does not exist yet?" +msgstr "" diff --git a/web_m2x_options/i18n/tr.po b/web_m2x_options/i18n/tr.po index 2b9f46fdd2ee..584219f2c764 100644 --- a/web_m2x_options/i18n/tr.po +++ b/web_m2x_options/i18n/tr.po @@ -3,16 +3,15 @@ # * web_m2x_options # # Translators: -# Ahmet Altınışık , 2015 -# Ahmet Altınışık , 2015 +# OCA Transbot , 2017 msgid "" msgstr "" -"Project-Id-Version: web (8.0)\n" +"Project-Id-Version: Odoo Server 10.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2016-02-26 02:05+0000\n" -"PO-Revision-Date: 2015-12-30 21:53+0000\n" -"Last-Translator: Ahmet Altınışık \n" -"Language-Team: Turkish (http://www.transifex.com/oca/OCA-web-8-0/language/tr/)\n" +"POT-Creation-Date: 2018-01-03 03:50+0000\n" +"PO-Revision-Date: 2018-01-03 03:50+0000\n" +"Last-Translator: OCA Transbot , 2017\n" +"Language-Team: Turkish (https://www.transifex.com/oca/teams/23907/tr/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" @@ -21,24 +20,66 @@ msgstr "" #. module: web_m2x_options #. openerp-web -#: code:addons/web_m2x_options/static/src/js/form.js:219 -#: code:addons/web_m2x_options/static/src/js/form.js:373 +#: code:addons/web_m2x_options/static/src/xml/base.xml:8 +#, python-format +msgid "!(widget.options.no_open || widget.options.no_open_edit)" +msgstr "" + +#. module: web_m2x_options +#. openerp-web +#: code:addons/web_m2x_options/static/src/js/form.js:47 +#, python-format +msgid "Cancel" +msgstr "İptal" + +#. module: web_m2x_options +#. openerp-web +#: code:addons/web_m2x_options/static/src/js/form.js:33 +#, python-format +msgid "Create" +msgstr "" + +#. module: web_m2x_options +#. openerp-web +#: code:addons/web_m2x_options/static/src/js/form.js:232 +#: code:addons/web_m2x_options/static/src/js/form.js:382 #, python-format msgid "Create \"%s\"" msgstr "Oluştur \"%s\"" #. module: web_m2x_options #. openerp-web -#: code:addons/web_m2x_options/static/src/js/form.js:237 -#: code:addons/web_m2x_options/static/src/js/form.js:392 +#: code:addons/web_m2x_options/static/src/js/form.js:30 +#, python-format +msgid "Create a %s" +msgstr "" + +#. module: web_m2x_options +#. openerp-web +#: code:addons/web_m2x_options/static/src/js/form.js:250 +#: code:addons/web_m2x_options/static/src/js/form.js:401 #, python-format msgid "Create and Edit..." msgstr "Oluştur ve düzenle..." #. module: web_m2x_options #. openerp-web -#: code:addons/web_m2x_options/static/src/js/form.js:188 -#: code:addons/web_m2x_options/static/src/js/form.js:349 +#: code:addons/web_m2x_options/static/src/js/form.js:43 +#, python-format +msgid "Create and edit" +msgstr "" + +#. module: web_m2x_options +#. openerp-web +#: code:addons/web_m2x_options/static/src/js/form.js:201 +#: code:addons/web_m2x_options/static/src/js/form.js:358 #, python-format msgid "Search More..." msgstr "Daha Fazla..." + +#. module: web_m2x_options +#. openerp-web +#: code:addons/web_m2x_options/static/src/js/form.js:52 +#, python-format +msgid "You are creating a new %s, are you sure it does not exist yet?" +msgstr "" diff --git a/web_m2x_options/static/src/js/form.js b/web_m2x_options/static/src/js/form.js index 4b8d0ad13eea..4fb83da338e9 100644 --- a/web_m2x_options/static/src/js/form.js +++ b/web_m2x_options/static/src/js/form.js @@ -260,13 +260,9 @@ odoo.define('web_m2x_options.web_m2x_options', function (require) { }); form_relational.FieldMany2ManyTags.include({ - events: { - 'click .o_delete': function(e) { - this.remove_id($(e.target).parent().data('id')); - }, - 'click .badge': 'open_badge', - 'mousedown .o_colorpicker span': 'update_color', - 'focusout .o_colorpicker': 'close_color_picker', + init: function () { + this.events["click .badge"] = "open_badge"; + return this._super.apply(this, arguments); }, show_error_displayer: function () { if ((typeof this.options.m2o_dialog === 'undefined' && this.can_create) || diff --git a/web_m2x_options/static/src/xml/base.xml b/web_m2x_options/static/src/xml/base.xml index 8b9421d190ac..094e942eada0 100644 --- a/web_m2x_options/static/src/xml/base.xml +++ b/web_m2x_options/static/src/xml/base.xml @@ -1,13 +1,11 @@ + + - - - jQuery(this).attr('t-if', '!(widget.options.no_open || widget.options.no_open_edit)'); + + + !(widget.options.no_open || widget.options.no_open_edit) + - - - - jQuery(this).attr('t-att-data-id', 'el[0]'); - - From 5e9f1f731b27ef529d1d53e2cd6193b35619a64c Mon Sep 17 00:00:00 2001 From: David Vidal Date: Tue, 16 May 2017 12:55:02 +0200 Subject: [PATCH 124/454] [MIG] web_m2x_options: migrated to 10.0 --- web_m2x_options/README.rst | 4 ++++ .../{__openerp__.py => __manifest__.py} | 2 +- web_m2x_options/static/src/js/form.js | 2 -- web_m2x_options/static/src/xml/base.xml | 6 ++++-- web_m2x_options/views/view.xml | 17 +++++++++-------- 5 files changed, 18 insertions(+), 13 deletions(-) rename web_m2x_options/{__openerp__.py => __manifest__.py} (92%) diff --git a/web_m2x_options/README.rst b/web_m2x_options/README.rst index 98cefc3c2dc6..f0e78aa44650 100644 --- a/web_m2x_options/README.rst +++ b/web_m2x_options/README.rst @@ -6,6 +6,9 @@ Add new options for many2one field ================================== +Description +----------- + This modules modifies "many2one" and "many2manytags" form widgets so as to add some new display control options. @@ -147,6 +150,7 @@ Contributors * Yannick Vaucher * Zakaria Makrelouf * Jairo Llopis +* David Vidal Maintainer ---------- diff --git a/web_m2x_options/__openerp__.py b/web_m2x_options/__manifest__.py similarity index 92% rename from web_m2x_options/__openerp__.py rename to web_m2x_options/__manifest__.py index 7206c3ca0331..ac436e6a6911 100644 --- a/web_m2x_options/__openerp__.py +++ b/web_m2x_options/__manifest__.py @@ -2,7 +2,7 @@ { "name": 'web_m2x_options', - "version": "9.0.1.1.0", + "version": "10.0.1.0.0", "depends": [ 'base', 'web', diff --git a/web_m2x_options/static/src/js/form.js b/web_m2x_options/static/src/js/form.js index 4fb83da338e9..13ec3a6e5d43 100644 --- a/web_m2x_options/static/src/js/form.js +++ b/web_m2x_options/static/src/js/form.js @@ -4,13 +4,11 @@ odoo.define('web_m2x_options.web_m2x_options', function (require) { "use strict"; - var $ = require("$"); var core = require('web.core'), data = require('web.data'), Dialog = require('web.Dialog'), Model = require('web.Model'), form_relational = require('web.form_relational'), - _ = require('_'), _t = core._t; var OPTIONS = ['web_m2x_options.create', diff --git a/web_m2x_options/static/src/xml/base.xml b/web_m2x_options/static/src/xml/base.xml index 094e942eada0..c095218bfe29 100644 --- a/web_m2x_options/static/src/xml/base.xml +++ b/web_m2x_options/static/src/xml/base.xml @@ -4,8 +4,10 @@ - - !(widget.options.no_open || widget.options.no_open_edit) + + + !(widget.options.no_open || widget.options.no_open_edit) + diff --git a/web_m2x_options/views/view.xml b/web_m2x_options/views/view.xml index 9628625b5103..85d435c1e140 100644 --- a/web_m2x_options/views/view.xml +++ b/web_m2x_options/views/view.xml @@ -1,12 +1,13 @@ - - - -