[MERGE] trunk

bzr revid: fme@openerp.com-20120903124956-vr66hh28c7pkuwkr
This commit is contained in:
Fabien Meghazi
2012-09-03 14:49:56 +02:00
10 changed files with 44 additions and 108 deletions
+2 -57
View File
@@ -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',
],
}
+4 -4
View File
@@ -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)
@@ -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,
+6 -2
View File
@@ -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;
+3 -1
View File
@@ -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
-6
View File
@@ -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());
}
+1 -19
View File
@@ -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();
}
});
});
},
+13 -12
View File
@@ -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")) {
+8 -5
View File
@@ -726,12 +726,14 @@
<t t-if="widget.options.action_buttons !== false">
<span class="oe_form_buttons_view">
<div style="display: inline-block;"> <!-- required for the bounce effect on button -->
<button type="button" class="oe_button oe_form_button_edit">Edit</button>
<button type="button" class="oe_button oe_form_button_edit" accesskey="E">Edit</button>
</div>
<button type="button" class="oe_button oe_form_button_create">Create</button>
<button type="button" class="oe_button oe_form_button_create" accesskey="C">Create</button>
</span>
<span class="oe_form_buttons_edit">
<button type="button" class="oe_button oe_form_button_save oe_highlight">Save</button> <span class="oe_fade">or</span> <a href="#" class="oe_bold oe_form_button_cancel">Discard</a>
<button type="button" class="oe_button oe_form_button_save oe_highlight" accesskey="S">Save</button>
<span class="oe_fade">or</span>
<a href="#" class="oe_bold oe_form_button_cancel" accesskey="D">Discard</a>
</span>
</t>
</div>
@@ -817,7 +819,7 @@
<div class="oe_clear">
<ul t-attf-class="oe_notebook #{classnames}">
<li t-foreach="pages" t-as="page" t-att-modifiers="page.modifiers">
<a t-attf-href="##{page.id}">
<a t-attf-href="##{page.id}" t-att-accesskey="page.accesskey">
<t t-esc="page.string"/>
</a>
</li>
@@ -1165,7 +1167,8 @@
<button type="button" class="oe_button oe_form_button"
t-att-style="widget.node.attrs.style"
t-att-tabindex="widget.node.attrs.tabindex"
t-att-autofocus="widget.node.attrs.autofocus">
t-att-autofocus="widget.node.attrs.autofocus"
t-att-accesskey="widget.node.attrs.accesskey">
<img t-if="widget.node.attrs.icon" t-att-src="_s + widget.node.attrs.icon" width="16" height="16"/>
<span t-if="widget.string"><t t-esc="widget.string"/></span>
</button>
+1 -1
View File
@@ -105,7 +105,7 @@ if __name__ == "__main__":
else:
logging.basicConfig(level=getattr(logging, options.log_level.upper()))
app = web.common.http.Root(options, openerp_addons_namespace=False)
app = web.common.http.Root(options)
if options.proxy_mode:
app = werkzeug.contrib.fixers.ProxyFix(app)