[IMP] Improved typos in warning

bzr revid: ggh@tinyerp.com-20130429102855-jrixaqvo4xqc2fix
This commit is contained in:
ggh-openerp 2013-04-29 15:58:55 +05:30
parent ae9b17ed1e
commit b15a01ff1e
2 changed files with 80 additions and 38 deletions

View File

@ -251,9 +251,9 @@ instance.web.CrashManager = instance.web.Class.extend({
if (handler) { if (handler) {
new (handler)(this, error).display(); new (handler)(this, error).display();
return; return;
}; }
if (error.data.name === "openerp.addons.web.session SessionExpiredException") { if (error.data.name === "openerp.addons.web.session SessionExpiredException") {
this.show_warning({type: "Session Expired", data: { message: "Your OpenERP session expired. Please refresh the current web page." }}); this.show_warning({type: "Session Expired", data: { message: _t("Your OpenERP session expired. Please refresh the current web page.") }});
return; return;
} }
if (error.data.exception_type === "except_osv" || error.data.exception_type === "warning" if (error.data.exception_type === "except_osv" || error.data.exception_type === "warning"
@ -530,16 +530,11 @@ instance.web.DatabaseManager = instance.web.Widget.extend({
'login': 'admin', 'login': 'admin',
'password': form_obj['create_admin_pwd'], 'password': form_obj['create_admin_pwd'],
'login_successful': function() { 'login_successful': function() {
var action = { var url = '/?db=' + form_obj['db_name'];
type: "ir.actions.client", if (self.session.debug) {
tag: 'reload', url += '&debug';
params: { }
url_search : { instance.web.redirect(url);
db: form_obj['db_name'],
},
}
};
self.do_action(action);
}, },
}, },
_push_me: false, _push_me: false,
@ -1374,7 +1369,7 @@ instance.web.WebClient = instance.web.Client.extend({
if (browser_offset !== user_offset) { if (browser_offset !== user_offset) {
var $icon = $(QWeb.render('WebClient.timezone_systray')); var $icon = $(QWeb.render('WebClient.timezone_systray'));
$icon.on('click', function() { $icon.on('click', function() {
var notification = self.do_warn(_t("Timezone mismatch"), QWeb.render('WebClient.timezone_notification', { var notification = self.do_warn(_t("Timezone Mismatch"), QWeb.render('WebClient.timezone_notification', {
user_timezone: instance.session.user_context.tz || 'UTC', user_timezone: instance.session.user_context.tz || 'UTC',
user_offset: user_offset, user_offset: user_offset,
browser_offset: browser_offset, browser_offset: browser_offset,

View File

@ -765,7 +765,11 @@ instance.web.FormView = instance.web.View.extend(instance.web.form.FieldManagerM
this.has_been_loaded.done(function() { this.has_been_loaded.done(function() {
if (self.datarecord.id && confirm(_t("Do you really want to delete this record?"))) { if (self.datarecord.id && confirm(_t("Do you really want to delete this record?"))) {
self.dataset.unlink([self.datarecord.id]).done(function() { self.dataset.unlink([self.datarecord.id]).done(function() {
self.execute_pager_action('next'); if (self.dataset.size()) {
self.execute_pager_action('next');
} else {
self.do_action('history_back');
}
def.resolve(); def.resolve();
}); });
} else { } else {
@ -802,6 +806,8 @@ instance.web.FormView = instance.web.View.extend(instance.web.form.FieldManagerM
if (save_obj.error) if (save_obj.error)
return $.Deferred().reject(); return $.Deferred().reject();
return $.when.apply($, save_obj.ret); return $.when.apply($, save_obj.ret);
}).done(function() {
self.$el.removeClass('oe_form_dirty');
}); });
}, },
_process_save: function(save_obj) { _process_save: function(save_obj) {
@ -1021,7 +1027,7 @@ instance.web.FormView = instance.web.View.extend(instance.web.form.FieldManagerM
return value; return value;
} }
var fields = _.chain(this.fields) var fields = _.chain(this.fields)
.map(function (field, name) { .map(function (field) {
var value = field.get_value(); var value = field.get_value();
// ignore fields which are empty, invisible, readonly, o2m // ignore fields which are empty, invisible, readonly, o2m
// or m2m // or m2m
@ -1036,7 +1042,7 @@ instance.web.FormView = instance.web.View.extend(instance.web.form.FieldManagerM
} }
return { return {
name: name, name: field.name,
string: field.string, string: field.string,
value: value, value: value,
displayed: display(field, value), displayed: display(field, value),
@ -1047,10 +1053,10 @@ instance.web.FormView = instance.web.View.extend(instance.web.form.FieldManagerM
.value(); .value();
var conditions = _.chain(self.fields) var conditions = _.chain(self.fields)
.filter(function (field) { return field.field.change_default; }) .filter(function (field) { return field.field.change_default; })
.map(function (field, name) { .map(function (field) {
var value = field.get_value(); var value = field.get_value();
return { return {
name: name, name: field.name,
string: field.string, string: field.string,
value: value, value: value,
displayed: display(field, value), displayed: display(field, value),
@ -1444,6 +1450,9 @@ instance.web.form.FormRenderingEngine = instance.web.form.FormRenderingEngineInt
$(this).children().each(function() { $(this).children().each(function() {
var $td = $(this), var $td = $(this),
$child = $td.children(':first'); $child = $td.children(':first');
if ($child.attr('cell-class')) {
$td.addClass($child.attr('cell-class'));
}
switch ($child[0].tagName.toLowerCase()) { switch ($child[0].tagName.toLowerCase()) {
case 'separator': case 'separator':
break; break;
@ -1520,7 +1529,7 @@ instance.web.form.FormRenderingEngine = instance.web.form.FormRenderingEngineInt
if (! page.__ic) if (! page.__ic)
return; return;
page.__ic.on("change:effective_invisible", null, function() { page.__ic.on("change:effective_invisible", null, function() {
if (!page.__ic.get('effective_invisible')) { if (!page.__ic.get('effective_invisible') && page.autofocus) {
$new_notebook.tabs('select', i); $new_notebook.tabs('select', i);
return; return;
} }
@ -2126,7 +2135,7 @@ instance.web.form.AbstractField = instance.web.form.FormWidget.extend(instance.w
value without triggering a re-rendering. value without triggering a re-rendering.
*/ */
internal_set_value: function(value_) { internal_set_value: function(value_) {
var tmp = this.no_render; var tmp = this.no_rerender;
this.no_rerender = true; this.no_rerender = true;
this.set({'value': value_}); this.set({'value': value_});
this.no_rerender = tmp; this.no_rerender = tmp;
@ -2296,7 +2305,8 @@ instance.web.form.FieldChar = instance.web.form.AbstractField.extend(instance.we
return this.get('value') === '' || this._super(); return this.get('value') === '' || this._super();
}, },
focus: function() { focus: function() {
this.$('input:first')[0].focus(); var input = this.$('input:first')[0];
return input ? input.focus() : false;
}, },
set_dimensions: function (height, width) { set_dimensions: function (height, width) {
this._super(height, width); this._super(height, width);
@ -2333,7 +2343,7 @@ instance.web.form.FieldEmail = instance.web.form.FieldChar.extend({
}, },
on_button_clicked: function() { on_button_clicked: function() {
if (!this.get('value') || !this.is_syntax_valid()) { if (!this.get('value') || !this.is_syntax_valid()) {
this.do_warn(_t("E-mail error"), _t("Can't send email to invalid e-mail address")); this.do_warn(_t("E-mail Error"), _t("Can't send email to invalid e-mail address"));
} else { } else {
location.href = 'mailto:' + this.get('value'); location.href = 'mailto:' + this.get('value');
} }
@ -2363,7 +2373,7 @@ instance.web.form.FieldUrl = instance.web.form.FieldChar.extend({
}, },
on_button_clicked: function() { on_button_clicked: function() {
if (!this.get('value')) { if (!this.get('value')) {
this.do_warn(_t("Resource error"), _t("This resource is empty")); this.do_warn(_t("Resource Error"), _t("This resource is empty"));
} else { } else {
var url = $.trim(this.get('value')); var url = $.trim(this.get('value'));
if(/^www\./i.test(url)) if(/^www\./i.test(url))
@ -2393,7 +2403,8 @@ instance.web.form.FieldFloat = instance.web.form.FieldChar.extend({
this._super.apply(this, [value_]); this._super.apply(this, [value_]);
}, },
focus: function () { focus: function () {
this.$('input:first').select(); var $input = this.$('input:first');
return $input.length ? $input.select() : false;
} }
}); });
@ -2413,6 +2424,42 @@ instance.web.DateTimeWidget = instance.web.Widget.extend({
this.$input = this.$el.find('input.oe_datepicker_master'); this.$input = this.$el.find('input.oe_datepicker_master');
this.$input_picker = this.$el.find('input.oe_datepicker_container'); this.$input_picker = this.$el.find('input.oe_datepicker_container');
$.datepicker.setDefaults({
clearText: _t('Clear'),
clearStatus: _t('Erase the current date'),
closeText: _t('Done'),
closeStatus: _t('Close without change'),
prevText: _t('<Prev'),
prevStatus: _t('Show the previous month'),
nextText: _t('Next>'),
nextStatus: _t('Show the next month'),
currentText: _t('Today'),
currentStatus: _t('Show the current month'),
monthNames: Date.CultureInfo.monthNames,
monthNamesShort: Date.CultureInfo.abbreviatedMonthNames,
monthStatus: _t('Show a different month'),
yearStatus: _t('Show a different year'),
weekHeader: _t('Wk'),
weekStatus: _t('Week of the year'),
dayNames: Date.CultureInfo.dayNames,
dayNamesShort: Date.CultureInfo.abbreviatedDayNames,
dayNamesMin: Date.CultureInfo.shortestDayNames,
dayStatus: _t('Set DD as first week day'),
dateStatus: _t('Select D, M d'),
firstDay: Date.CultureInfo.firstDayOfWeek,
initStatus: _t('Select a date'),
isRTL: false
});
$.timepicker.setDefaults({
timeOnlyTitle: _t('Choose Time'),
timeText: _t('Time'),
hourText: _t('Hour'),
minuteText: _t('Minute'),
secondText: _t('Second'),
currentText: _t('Now'),
closeText: _t('Done')
});
this.picker({ this.picker({
onClose: this.on_picker_select, onClose: this.on_picker_select,
onSelect: this.on_picker_select, onSelect: this.on_picker_select,
@ -2539,9 +2586,8 @@ instance.web.form.FieldDatetime = instance.web.form.AbstractField.extend(instanc
return this.get('value') === '' || this._super(); return this.get('value') === '' || this._super();
}, },
focus: function() { focus: function() {
if (this.datewidget && this.datewidget.$input) { var input = this.datewidget && this.datewidget.$input[0];
this.datewidget.$input[0].focus(); return input ? input.focus() : false;
}
}, },
set_dimensions: function (height, width) { set_dimensions: function (height, width) {
this._super(height, width); this._super(height, width);
@ -2622,9 +2668,8 @@ instance.web.form.FieldText = instance.web.form.AbstractField.extend(instance.we
return this.get('value') === '' || this._super(); return this.get('value') === '' || this._super();
}, },
focus: function($el) { focus: function($el) {
if (!this.get("effective_readonly") && this.$textarea) { var input = !this.get("effective_readonly") && this.$textarea && this.$textarea[0];
this.$textarea[0].focus(); return input ? input.focus() : false;
}
}, },
set_dimensions: function (height, width) { set_dimensions: function (height, width) {
this._super(height, width); this._super(height, width);
@ -2707,7 +2752,8 @@ instance.web.form.FieldBoolean = instance.web.form.AbstractField.extend({
this.$checkbox[0].checked = this.get('value'); this.$checkbox[0].checked = this.get('value');
}, },
focus: function() { focus: function() {
this.$checkbox[0].focus(); var input = this.$checkbox && this.$checkbox[0];
return input ? input.focus() : false;
} }
}); });
@ -2793,7 +2839,8 @@ instance.web.form.FieldSelection = instance.web.form.AbstractField.extend(instan
} }
}, },
focus: function() { focus: function() {
this.$('select:first')[0].focus(); var input = this.$('select:first')[0];
return input ? input.focus() : false;
}, },
set_dimensions: function (height, width) { set_dimensions: function (height, width) {
this._super(height, width); this._super(height, width);
@ -3336,7 +3383,7 @@ instance.web.form.FieldMany2One = instance.web.form.AbstractField.extend(instanc
} }
if (! no_recurse) { if (! no_recurse) {
var dataset = new instance.web.DataSetStatic(this, this.field.relation, self.build_context()); var dataset = new instance.web.DataSetStatic(this, this.field.relation, self.build_context());
dataset.name_get([self.get("value")]).done(function(data) { this.alive(dataset.name_get([self.get("value")])).done(function(data) {
self.display_value["" + self.get("value")] = data[0][1]; self.display_value["" + self.get("value")] = data[0][1];
self.render_value(true); self.render_value(true);
}); });
@ -3401,9 +3448,8 @@ instance.web.form.FieldMany2One = instance.web.form.AbstractField.extend(instanc
return ! this.get("value"); return ! this.get("value");
}, },
focus: function () { focus: function () {
if (!this.get('effective_readonly')) { var input = !this.get('effective_readonly') && this.$input && this.$input[0];
this.$input && this.$input[0].focus(); return input ? input.focus() : false;
}
}, },
_quick_create: function() { _quick_create: function() {
this.no_ed = true; this.no_ed = true;
@ -4263,7 +4309,8 @@ instance.web.form.FieldMany2ManyTags = instance.web.form.AbstractField.extend(in
this.set({'value': _.uniq(this.get('value').concat([id]))}); this.set({'value': _.uniq(this.get('value').concat([id]))});
}, },
focus: function () { focus: function () {
this.$text[0].focus(); var input = this.$text && this.$text[0];
return input ? input.focus() : false;
}, },
set_dimensions: function (height, width) { set_dimensions: function (height, width) {
this._super(height, width); this._super(height, width);
@ -5311,7 +5358,7 @@ instance.web.form.FieldMany2ManyBinaryMultiFiles = instance.web.form.AbstractFie
} }
if (result.error || !result.id ) { if (result.error || !result.id ) {
this.do_warn( _t('Uploading error'), result.error); this.do_warn( _t('Uploading Error'), result.error);
delete this.data[0]; delete this.data[0];
} else { } else {
if (this.data[0] && this.data[0].filename == result.filename && this.data[0].upload) { if (this.data[0] && this.data[0].filename == result.filename && this.data[0].upload) {