diff --git a/addons/web/__openerp__.py b/addons/web/__openerp__.py index 38e3328bf8b..44a3caaf8ec 100644 --- a/addons/web/__openerp__.py +++ b/addons/web/__openerp__.py @@ -23,6 +23,7 @@ This module provides the core of the OpenERP Web Client. "static/lib/jquery.validate/jquery.validate.js", "static/lib/jquery.ba-bbq/jquery.ba-bbq.js", "static/lib/spinjs/spin.js", + "static/lib/jquery.autosize/jquery.autosize.js", "static/lib/jquery.blockUI/jquery.blockUI.js", "static/lib/jquery.ui/js/jquery-ui-1.8.17.custom.min.js", "static/lib/jquery.ui.timepicker/js/jquery-ui-timepicker-addon.js", @@ -37,8 +38,7 @@ This module provides the core of the OpenERP Web Client. "static/lib/underscore/underscore.string.js", "static/lib/backbone/backbone.js", "static/lib/cleditor/jquery.cleditor.js", - "static/lib/py.js/lib/py.js", - "static/lib/jquery.autosize/jquery.autosize.js", + "static/lib/py.js/lib/py.js", "static/src/js/boot.js", "static/src/js/corelib.js", "static/src/js/coresetup.js", @@ -68,60 +68,5 @@ This module provides the core of the OpenERP Web Client. ], 'qweb' : [ "static/src/xml/*.xml", - 'static/lib/datejs/globalization/en-US.js', - 'static/lib/datejs/core.js', - 'static/lib/datejs/parser.js', - 'static/lib/datejs/sugarpak.js', - 'static/lib/datejs/extras.js', - 'static/lib/jquery/jquery-1.7.2.js', - 'static/lib/jquery.MD5/jquery.md5.js', - 'static/lib/jquery.form/jquery.form.js', - 'static/lib/jquery.validate/jquery.validate.js', - 'static/lib/jquery.ba-bbq/jquery.ba-bbq.js', - 'static/lib/spinjs/spin.js', - 'static/lib/jquery.blockUI/jquery.blockUI.js', - 'static/lib/jquery.ui/js/jquery-ui-1.8.17.custom.min.js', - 'static/lib/jquery.ui.timepicker/js/jquery-ui-timepicker-addon.js', - 'static/lib/jquery.ui.notify/js/jquery.notify.js', - 'static/lib/jquery.deferred-queue/jquery.deferred-queue.js', - 'static/lib/jquery.scrollTo/jquery.scrollTo-min.js', - 'static/lib/jquery.tipsy/jquery.tipsy.js', - 'static/lib/jquery.textext/jquery.textext.js', - 'static/lib/jquery.timeago/jquery.timeago.js', - 'static/lib/qweb/qweb2.js', - 'static/lib/underscore/underscore.js', - 'static/lib/underscore/underscore.string.js', - 'static/lib/backbone/backbone.js', - 'static/lib/cleditor/jquery.cleditor.js', - 'static/lib/py.js/lib/py.js', - 'static/src/js/boot.js', - 'static/src/js/corelib.js', - 'static/src/js/coresetup.js', - 'static/src/js/dates.js', - 'static/src/js/formats.js', - 'static/src/js/chrome.js', - 'static/src/js/views.js', - 'static/src/js/data.js', - 'static/src/js/data_export.js', - 'static/src/js/data_import.js', - 'static/src/js/search.js', - 'static/src/js/view_form.js', - 'static/src/js/view_list.js', - 'static/src/js/view_list_editable.js', - 'static/src/js/view_tree.js', - ], - 'css': [ - 'static/lib/jquery.ui.bootstrap/css/custom-theme/jquery-ui-1.8.16.custom.css', - 'static/lib/jquery.ui.timepicker/css/jquery-ui-timepicker-addon.css', - 'static/lib/jquery.ui.notify/css/ui.notify.css', - 'static/lib/jquery.tipsy/tipsy.css', - 'static/lib/jquery.textext/jquery.textext.css', - 'static/src/css/base.css', - 'static/src/css/data_export.css', - 'static/src/css/data_import.css', - 'static/lib/cleditor/jquery.cleditor.css', - ], - 'qweb': [ - 'static/src/xml/*.xml', ], } diff --git a/addons/web/common/http.py b/addons/web/common/http.py index 9c3664c8da0..6dc99f2c997 100644 --- a/addons/web/common/http.py +++ b/addons/web/common/http.py @@ -461,7 +461,7 @@ class Root(object): only used in case the list of databases is requested by the server, will be filtered by this pattern """ - def __init__(self, options, openerp_addons_namespace=True): + def __init__(self, options): self.config = options if not hasattr(self.config, 'connector'): @@ -474,7 +474,7 @@ class Root(object): self.httpsession_cookie = 'httpsessionid' self.addons = {} - static_dirs = self._load_addons(openerp_addons_namespace) + static_dirs = self._load_addons() if options.serve_static: app = werkzeug.wsgi.SharedDataMiddleware( self.dispatch, static_dirs) self.dispatch = DisableCacheMiddleware(app) @@ -520,7 +520,7 @@ class Root(object): return response(environ, start_response) - def _load_addons(self, openerp_addons_namespace=True): + def _load_addons(self): """ Loads all addons at the specified addons path, returns a mapping of static URLs to the corresponding directories @@ -535,7 +535,7 @@ class Root(object): manifest = ast.literal_eval(open(manifest_path).read()) manifest['addons_path'] = addons_path _logger.debug("Loading %s", module) - if openerp_addons_namespace: + if 'openerp.addons' in sys.modules: m = __import__('openerp.addons.' + module) else: m = __import__(module) diff --git a/addons/web/static/lib/jquery.autosize/jquery.autosize.js b/addons/web/static/lib/jquery.autosize/jquery.autosize.js index 29729d2fd42..9d972e96a57 100644 --- a/addons/web/static/lib/jquery.autosize/jquery.autosize.js +++ b/addons/web/static/lib/jquery.autosize/jquery.autosize.js @@ -59,7 +59,12 @@ } else { mirror = $(copy).data('ismirror', true).addClass(className || 'autosizejs')[0]; - resize = $ta.css('resize') === 'none' ? 'none' : 'horizontal'; + // Changed allowed resize only in edit mode by VTA (31/8/2012) + if ($ta.attr('disabled')) { + $ta.css('resize', 'none'); + } + // Changed horizontal to vertical by VTA (31/8/2012) + resize = $ta.css('resize') === 'none' ? 'none' : 'vertical'; $ta.data('mirror', $(mirror)).css({ overflow: hidden, diff --git a/addons/web/static/src/css/base.css b/addons/web/static/src/css/base.css index 06a37a54727..dd168653f03 100644 --- a/addons/web/static/src/css/base.css +++ b/addons/web/static/src/css/base.css @@ -85,7 +85,7 @@ text-shadow: 0 1px 1px rgba(255, 255, 255, 0.5); /* http://www.quirksmode.org/dom/inputfile.html * http://stackoverflow.com/questions/2855589/replace-input-type-file-by-an-image - */ */ + */ } .openerp :-moz-placeholder { color: #afafb6 !important; @@ -503,6 +503,7 @@ -webkit-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3); border: none; + margin-bottom: 10px; } .openerp .oe_avatar + div { margin-left: 5px; @@ -575,6 +576,9 @@ background: #7c7bad; color: #eeeeee; } +.openerp .oe_tags { + margin-bottom: 1px; +} .openerp .oe_tags.oe_inline { min-width: 250px; } @@ -2157,7 +2161,7 @@ .openerp .oe_form td.oe_form_group_cell_label label { line-height: 18px; display: block; - min-width: 160px; + min-width: 140px; } .openerp .oe_form td.oe_form_group_cell + .oe_form_group_cell { padding-left: 6px; diff --git a/addons/web/static/src/css/base.sass b/addons/web/static/src/css/base.sass index c238ef6ee07..537988e9c4a 100644 --- a/addons/web/static/src/css/base.sass +++ b/addons/web/static/src/css/base.sass @@ -422,6 +422,7 @@ $sheet-max-width: 860px @include radius(3px) @include box-shadow(0 1px 3px rgba(0, 0, 0, 0.3)) border: none + margin-bottom: 10px .oe_avatar + div margin-left: 5px .oe_image_small > img @@ -475,6 +476,7 @@ $sheet-max-width: 860px .text-core .text-wrap .text-dropdown .text-list .text-suggestion em font-style: italic text-decoration: none + margin-bottom: 1px // }}} // Tooltips {{{ &.oe_tooltip @@ -1650,7 +1652,7 @@ $sheet-max-width: 860px label line-height: 18px display: block - min-width: 160px + min-width: 140px td.oe_form_group_cell + .oe_form_group_cell padding-left: 6px .oe_form_group diff --git a/addons/web/static/src/js/corelib.js b/addons/web/static/src/js/corelib.js index 8a28c0a8a4d..c74c2d5dc03 100644 --- a/addons/web/static/src/js/corelib.js +++ b/addons/web/static/src/js/corelib.js @@ -1323,12 +1323,6 @@ instance.web.JsonRPC = instance.web.CallbackEnabled.extend({ deferred.resolve(response["result"], textStatus, jqXHR); } else if (response.error.data.type === "session_invalid") { self.uid = false; - // TODO deprecate or use a deferred on login.do_ask_login() - self.on_session_invalid(function() { - self.rpc(url, payload.params, - function() { deferred.resolve.apply(deferred, arguments); }, - function() { deferred.reject.apply(deferred, arguments); }); - }); } else { deferred.reject(response.error, $.Event()); } diff --git a/addons/web/static/src/js/coresetup.js b/addons/web/static/src/js/coresetup.js index 38cf57387d1..0c10d40f0ca 100644 --- a/addons/web/static/src/js/coresetup.js +++ b/addons/web/static/src/js/coresetup.js @@ -113,20 +113,6 @@ instance.web.Session = instance.web.JsonRPC.extend( /** @lends instance.web.Sess this.set_cookie('session_id', ''); return this.rpc("/web/session/destroy", {}); }, - on_session_valid: function() { - }, - /** - * Called when a rpc call fail due to an invalid session. - * By default, it's a noop - */ - on_session_invalid: function(retry_callback) { - }, - /** - * Fetches a cookie stored by an openerp session - * - * @private - * @param name the cookie's name - */ get_cookie: function (name) { if (!this.name) { return null; } var nameEQ = this.name + '|' + name + '='; @@ -160,9 +146,8 @@ instance.web.Session = instance.web.JsonRPC.extend( /** @lends instance.web.Sess /** * Load additional web addons of that instance and init them * - * @param {Boolean} [no_session_valid_signal=false] prevents load_module from triggering ``on_session_valid``. */ - load_modules: function(no_session_valid_signal) { + load_modules: function() { var self = this; return this.rpc('/web/session/modules', {}).pipe(function(result) { var lang = self.user_context.lang, @@ -195,9 +180,6 @@ instance.web.Session = instance.web.JsonRPC.extend( /** @lends instance.web.Sess return loaded.then(function() { self.on_modules_loaded(); self.trigger('module_loaded'); - if (!no_session_valid_signal) { - self.on_session_valid(); - } }); }); }, diff --git a/addons/web/static/src/js/view_form.js b/addons/web/static/src/js/view_form.js index 2034bfb741f..7975906e100 100644 --- a/addons/web/static/src/js/view_form.js +++ b/addons/web/static/src/js/view_form.js @@ -2195,7 +2195,8 @@ instance.web.DateTimeWidget = instance.web.Widget.extend({ changeMonth: true, changeYear: true, showWeek: true, - showButtonPanel: true + showButtonPanel: true, + firstDay: Date.CultureInfo.firstDayOfWeek }); this.$el.find('img.oe_datepicker_trigger').click(function() { if (self.get("effective_readonly") || self.picker('widget').is(':visible')) { @@ -2324,12 +2325,16 @@ instance.web.form.FieldDate = instance.web.form.FieldDatetime.extend({ instance.web.form.FieldText = instance.web.form.AbstractField.extend(instance.web.form.ReinitializeFieldMixin, { template: 'FieldText', + init: function (field_manager, node) { + this._super(field_manager, node); + }, initialize_content: function() { + var self = this; this.$textarea = this.$el.find('textarea'); this.default_height = this.$textarea.css('height'); if (!this.get("effective_readonly")) { this.$textarea.change(_.bind(function() { - this.set({'value': instance.web.parse_value(this.$textarea.val(), this)}); + self.set({'value': instance.web.parse_value(self.$textarea.val(), self)}); }, this)); } else { this.$textarea.attr('disabled', 'disabled'); @@ -2342,14 +2347,17 @@ instance.web.form.FieldText = instance.web.form.AbstractField.extend(instance.we this.setupFocus(this.$textarea); }, set_value: function(value_) { - this._super.apply(this, arguments); + this._super(value_); this.render_value(); + $(window).resize(); }, render_value: function() { var show_value = instance.web.format_value(this.get('value'), this, ''); + if (show_value === '') { + this.$textarea.css('height', parseInt(this.default_height)+"px"); + } this.$textarea.val(show_value); - this.$textarea.autosize(); - this.$textarea.css('height', parseInt(this.default_height)+"px"); + this.$textarea.autosize(); }, is_syntax_valid: function() { if (!this.get("effective_readonly")) { @@ -2379,13 +2387,6 @@ instance.web.form.FieldText = instance.web.form.AbstractField.extend(instance.we */ instance.web.form.FieldTextHtml = instance.web.form.AbstractField.extend(instance.web.form.ReinitializeFieldMixin, { template: 'FieldTextHtml', - init: function() { - this._super.apply(this, arguments); - if (this.field.type !== 'html') { - throw new Error(_.str.sprintf( - _t("Error with field %s, it is not allowed to use the widget 'html' with any other field type than 'html'"), this.string)); - } - }, initialize_content: function() { var self = this; if (! this.get("effective_readonly")) { diff --git a/addons/web/static/src/xml/base.xml b/addons/web/static/src/xml/base.xml index d97cc57f5ea..623d87bea31 100644 --- a/addons/web/static/src/xml/base.xml +++ b/addons/web/static/src/xml/base.xml @@ -726,12 +726,14 @@
- +
- +
- or Discard + + or + Discard
@@ -817,7 +819,7 @@