diff options
| author | Christophe Simonis <chs@odoo.com> | 2017-04-13 15:31:27 +0200 |
|---|---|---|
| committer | Christophe Simonis <chs@odoo.com> | 2017-04-13 15:31:27 +0200 |
| commit | b0992d082da329abd7b0711b64a3706f9f5ee4fc (patch) | |
| tree | 09c013e2f1f9efdf310e59916ea21d9da849a44e /addons/web | |
| parent | f3cff93f5c95d0007e8e4b54e4c7a1e803b4ea5b (diff) | |
| parent | 8f30e707e53d020b127908ae1eeb34c6ea9b04b3 (diff) | |
[MERGE] forward port branch saas-14 up to 8f30e707e53
Diffstat (limited to 'addons/web')
| -rw-r--r-- | addons/web/controllers/main.py | 4 | ||||
| -rw-r--r-- | addons/web/static/src/js/widgets/data_export.js | 12 | ||||
| -rw-r--r-- | addons/web/static/src/less/data_export.less | 14 | ||||
| -rw-r--r-- | addons/web/views/database_manager.html | 6 |
4 files changed, 24 insertions, 12 deletions
diff --git a/addons/web/controllers/main.py b/addons/web/controllers/main.py index 4db03e463eb..39c0c34983c 100644 --- a/addons/web/controllers/main.py +++ b/addons/web/controllers/main.py @@ -654,6 +654,8 @@ class Database(http.Controller): @http.route('/web/database/create', type='http', auth="none", methods=['POST'], csrf=False) def create(self, master_pwd, name, lang, password, **post): try: + if not re.match('^[a-zA-Z][a-zA-Z0-9_]+$', name): + raise Exception(_('Invalid database name. Only alphanumerical characters and underscore are allowed.')) # country code could be = "False" which is actually True in python country_code = post.get('country_code') or False dispatch_rpc('db', 'create_database', [master_pwd, name, bool(post.get('demo')), lang, password, post['login'], country_code]) @@ -666,6 +668,8 @@ class Database(http.Controller): @http.route('/web/database/duplicate', type='http', auth="none", methods=['POST'], csrf=False) def duplicate(self, master_pwd, name, new_name): try: + if not re.match('^[a-zA-Z][a-zA-Z0-9_]+$', new_name): + raise Exception(_('Invalid database name. Only alphanumerical characters and underscore are allowed.')) dispatch_rpc('db', 'duplicate_database', [master_pwd, name, new_name]) return http.local_redirect('/web/database/manager') except Exception, e: diff --git a/addons/web/static/src/js/widgets/data_export.js b/addons/web/static/src/js/widgets/data_export.js index d3135f86ba6..c74b89af11b 100644 --- a/addons/web/static/src/js/widgets/data_export.js +++ b/addons/web/static/src/js/widgets/data_export.js @@ -207,9 +207,15 @@ var DataExport = Dialog.extend({ this.records = {}; this.dataset = dataset; this.exports = new data.DataSetSearch(this, 'ir.exports', this.dataset.get_context()); - + this.row_index = 0; this.row_index_level = 0; + + // The default for the ".modal_content" element is "max-height: 100%;" + // but we want it to always expand to "height: 100%;" for this modal. + // This can be achieved thanks to LESS modification without touching + // the ".modal-content" rules... but not with Internet explorer (11). + this.$modal.find(".modal-content").css("height", "100%"); }, start: function() { var self = this; @@ -261,7 +267,7 @@ var DataExport = Dialog.extend({ function do_setup_export_formats(formats) { var $fmts = self.$('.o_export_format'); - + _.each(formats, function(format, i) { var $radio = $('<input/>', {type: 'radio', value: format.tag, name: 'o_export_format_name'}); var $label = $('<label/>', {html: format.label}); @@ -362,7 +368,7 @@ var DataExport = Dialog.extend({ }, on_show_data: function(records, expansion) { var self = this; - + if(expansion) { this.$('.o_export_tree_item[data-id="' + expansion + '"]') .addClass('open') diff --git a/addons/web/static/src/less/data_export.less b/addons/web/static/src/less/data_export.less index 3f596bea27d..01a1da80134 100644 --- a/addons/web/static/src/less/data_export.less +++ b/addons/web/static/src/less/data_export.less @@ -1,8 +1,8 @@ .o_web_client .o_export { - - .o-flex(0, 1, 1000px); + .o-flex(1, 1, auto); .o-flex-display(); .o-flex-flow(column, nowrap); + min-height: 0; > p, > .row { .o-flex(0, 0, auto); @@ -28,8 +28,9 @@ } .o_export_panel { - .o-flex(1, 0, 0); + .o-flex(1, 1, auto); position: relative; + min-height: 0; > div { height: 100%; @@ -59,9 +60,10 @@ .o_left_field_panel, .o_fields_list { border: 1px solid @odoo-brand-lightsecondary; overflow: auto; - .o-flex(1, 0, 0); + .o-flex(1, 1, auto); + min-height: 0; } - + .o_export_tree_item { cursor: pointer; position: relative; @@ -72,7 +74,7 @@ background-color: @odoo-brand-primary; color: white; } - + .o_expand_parent { .o-position-absolute(@top: 4px, @left: 5px); } diff --git a/addons/web/views/database_manager.html b/addons/web/views/database_manager.html index e86fb9901a8..7f91bc73907 100644 --- a/addons/web/views/database_manager.html +++ b/addons/web/views/database_manager.html @@ -60,7 +60,7 @@ <div class="row"> <div class="col-md-12"> <label for="name" class="control-label">Database Name</label> - <input id="name" type="text" name="name" class="form-control" required="required" autocomplete="off"/> + <input id="name" type="text" name="name" class="form-control" required="required" autocomplete="off" pattern="^[a-zA-Z][a-zA-Z0-9_]+$" title="Only alphanumerical characters and underscore are allowed"/> </div> </div> </div> @@ -210,7 +210,7 @@ </div> <div class="form-group"> <label for="name" class="control-label">Database Name</label> - <input id="name" type="text" name="name" class="form-control" required="required"/> + <input id="name" type="text" name="name" class="form-control" required="required" pattern="^[a-zA-Z][a-zA-Z0-9_]+$" title="Only alphanumerical characters and underscore are allowed"/> </div> <div class="form-group"> <label for="copy">This database might have been moved or copied.</label> @@ -283,7 +283,7 @@ </div> <div class="form-group"> <label for="new_name" class="control-label">New Name</label> - <input id="new_name" type="text" name="new_name" class="form-control" required="required"/> + <input id="new_name" type="text" name="new_name" class="form-control" required="required" pattern="^[a-zA-Z][a-zA-Z0-9_]+$" title="Only alphanumerical characters and underscore are allowed"/> </div> </div> <div class="modal-footer"> |
