[MERGE] from trunk

bzr revid: fva@openerp.com-20121008155410-0ixzq3fbgotalbx4
This commit is contained in:
Frédéric van der Essen
2012-10-08 17:54:10 +02:00
8 changed files with 109 additions and 37 deletions
+7
View File
@@ -1,6 +1,13 @@
OpenERP Web
-----------
The OpenERP Web Client supports the following web browsers:
* Internet Explorer 9+
* Google Chrome 22+
* Firefox 13+
* Any browser using the latest version of Chrome Frame
To build the documentation use:
$ make doc
+21 -1
View File
@@ -568,7 +568,27 @@ html_template = """<!DOCTYPE html>
});
</script>
</head>
<body></body>
<body>
<!--[if lte IE 8]>
<script type="text/javascript"
src="http://ajax.googleapis.com/ajax/libs/chrome-frame/1/CFInstall.min.js"></script>
<script>
var test = function() {
CFInstall.check({
mode: "overlay"
});
};
if (window.localStorage && false) {
if (! localStorage.getItem("hasShownGFramePopup")) {
test();
localStorage.setItem("hasShownGFramePopup", true);
}
} else {
test();
}
</script>
<![endif]-->
</body>
</html>
"""
+4 -4
View File
@@ -2299,16 +2299,16 @@
margin-bottom: 32px;
text-align: justify;
}
.openerp .oe_form_editable .oe_form .oe_form_field_integer {
.openerp .oe_form_editable .oe_form .oe_form_field_integer input {
width: 6em !important;
}
.openerp .oe_form_editable .oe_form .oe_form_field_float {
.openerp .oe_form_editable .oe_form .oe_form_field_float input {
width: 7em !important;
}
.openerp .oe_form_editable .oe_form .oe_form_field_date {
.openerp .oe_form_editable .oe_form .oe_form_field_date input {
width: 7.5em !important;
}
.openerp .oe_form_editable .oe_form .oe_form_field_datetime {
.openerp .oe_form_editable .oe_form .oe_form_field_datetime input {
width: 11.5em !important;
}
.openerp .oe_hidden_input_file {
+4 -4
View File
@@ -1825,13 +1825,13 @@ $sheet-max-width: 860px
.oe_form_editable
.oe_form
.oe_form_field_integer
.oe_form_field_integer input
width: 6em !important
.oe_form_field_float
.oe_form_field_float input
width: 7em !important
.oe_form_field_date
.oe_form_field_date input
width: 7.5em !important
.oe_form_field_datetime
.oe_form_field_datetime input
width: 11.5em !important
// }}}
// FormView.fields_binary {{{
+52 -20
View File
@@ -846,10 +846,6 @@ instance.web.FormView = instance.web.View.extend(instance.web.form.FieldManagerM
}
if (form_invalid) {
self.set({'display_invalid_fields': true});
for (var g in self.fields) {
if (!self.fields.hasOwnProperty(g)) { continue; }
self.fields[g]._check_css_flags();
}
first_invalid_field.focus();
self.on_invalid();
return $.Deferred().reject();
@@ -2102,6 +2098,8 @@ instance.web.form.AbstractField = instance.web.form.FormWidget.extend(instance.w
this._set_required();
}
this._check_visibility();
this.field_manager.off("change:display_invalid_fields", this, this._check_css_flags);
this.field_manager.on("change:display_invalid_fields", this, this._check_css_flags);
this._check_css_flags();
},
/**
@@ -2167,11 +2165,12 @@ instance.web.form.ReinitializeWidgetMixin = {
this.initialize_field();
},
initialize_field: function() {
this.on("change:effective_readonly", this, function() {
this.destroy_content();
this.renderElement();
this.initialize_content();
});
this.on("change:effective_readonly", this, this.reinitialize);
this.initialize_content();
},
reinitialize: function() {
this.destroy_content();
this.renderElement();
this.initialize_content();
},
/**
@@ -2192,9 +2191,10 @@ instance.web.form.ReinitializeWidgetMixin = {
instance.web.form.ReinitializeFieldMixin = _.extend({}, instance.web.form.ReinitializeWidgetMixin, {
initialize_field: function() {
instance.web.form.ReinitializeWidgetMixin.initialize_field.call(this);
this.on("change:effective_readonly", this, function() {
this.render_value();
});
this.render_value();
},
reinitialize: function() {
instance.web.form.ReinitializeWidgetMixin.reinitialize.call(this);
this.render_value();
},
/**
@@ -2230,7 +2230,7 @@ instance.web.form.FieldChar = instance.web.form.AbstractField.extend(instance.we
if (this.password) {
show_value = new Array(show_value.length + 1).join('*');
}
this.$el.text(show_value);
this.$(".oe_form_char_content").text(show_value);
}
},
is_syntax_valid: function() {
@@ -2961,7 +2961,7 @@ instance.web.form.FieldMany2One = instance.web.form.AbstractField.extend(instanc
title: _t("Open: ") + self.string
}
);
pop.on_write_completed.add_last(function() {
pop.on('on_write_complete', self, function(){
self.display_value = {};
self.render_value();
self.focus();
@@ -4110,9 +4110,7 @@ instance.web.form.Many2ManyListView = instance.web.ListView.extend(/** @lends in
title: _t("Open: ") + this.m2m_field.string,
readonly: this.getParent().get("effective_readonly")
});
pop.on_write_completed.add_last(function() {
self.reload_content();
});
pop.on('on_write_complete', self, self.reload_content);
}
});
@@ -4359,7 +4357,9 @@ instance.web.form.AbstractFormPopup = instance.web.Widget.extend({
};
this.dataset.write_function = function(id, data, options, sup) {
var fct = self.options.write_function || sup;
return fct.call(this, id, data, options).then(self.on_write_completed);
return fct.call(this, id, data, options).then(function() {
self.trigger('on_write_complete');
});
};
this.dataset.parent_view = this.options.parent_view;
this.dataset.child_name = this.options.child_name;
@@ -4379,7 +4379,6 @@ instance.web.form.AbstractFormPopup = instance.web.Widget.extend({
this.$buttonpane = dialog.$el.dialog("widget").find(".ui-dialog-buttonpane").html("");
this.start();
},
on_write_completed: function() {},
setup_form_view: function() {
var self = this;
if (this.row_id) {
@@ -4992,6 +4991,38 @@ instance.web.form.FieldStatus = instance.web.form.AbstractField.extend({
},
});
instance.web.form.FieldMonetary = instance.web.form.FieldFloat.extend({
template: "FieldMonetary",
init: function() {
this._super.apply(this, arguments);
this.set({"currency": false});
if (this.options.currency_field) {
this.field_manager.on("field_changed:" + this.options.currency_field, this, function() {
this.set({"currency": this.field_manager.get_field_value(this.options.currency_field)});
});
}
this.on("change:currency", this, this.get_currency_info);
this.get_currency_info();
this.ci_dm = new instance.web.DropMisordered();
},
start: function() {
var tmp = this._super();
this.on("change:currency_info", this, this.reinitialize);
return tmp;
},
get_currency_info: function() {
var self = this;
if (this.get("currency") === false) {
this.set({"currency_info": null});
return;
}
return this.ci_dm.add(new instance.web.Model("res.currency").query(["symbol", "position"])
.filter([["id", "=", self.get("currency")]]).first()).pipe(function(res) {
self.set({"currency_info": res});
});
},
});
/**
* Registry of form fields, called by :js:`instance.web.FormView`.
*
@@ -5022,7 +5053,8 @@ instance.web.form.widgets = new instance.web.Registry({
'progressbar': 'instance.web.form.FieldProgressBar',
'image': 'instance.web.form.FieldBinaryImage',
'binary': 'instance.web.form.FieldBinaryFile',
'statusbar': 'instance.web.form.FieldStatus'
'statusbar': 'instance.web.form.FieldStatus',
'monetary': 'instance.web.form.FieldMonetary',
});
/**
+4 -4
View File
@@ -1059,11 +1059,11 @@ instance.web.Sidebar = instance.web.Widget.extend({
action_id: item.action.id,
context: additional_context
}).then(function(result) {
result.result.context = _.extend(result.result.context || {},
result.context = _.extend(result.context || {},
additional_context);
result.result.flags = result.result.flags || {};
result.result.flags.new_window = true;
self.do_action(result.result, function () {
result.flags = result.flags || {};
result.flags.new_window = true;
self.do_action(result, function () {
// reload view
self.getParent().reload();
});
+16 -1
View File
@@ -916,7 +916,7 @@
</t>
<t t-name="FieldChar">
<span t-att-class="'oe_form_field '+widget.widget_class" t-att-style="widget.node.attrs.style">
<t t-if="!widget.get('effective_readonly')">
<t t-if="!widget.get('effective_readonly')">
<input t-att-type="widget.password ? 'password' : 'text'"
t-att-id="widget.id_for_label"
t-att-tabindex="widget.node.attrs.tabindex"
@@ -925,6 +925,9 @@
t-att-maxlength="widget.field.size"
/><img class="oe_field_translate oe_input_icon" t-if="widget.field.translate" t-att-src='_s + "/web/static/src/img/icons/terp-translate.png"' width="16" height="16" border="0"/>
</t>
<t t-if="widget.get('effective_readonly')">
<span class="oe_form_char_content"></span>
</t>
</span>
</t>
<t t-name="FieldEmail">
@@ -1717,4 +1720,16 @@
<button class="oe_form_m2o_sc_button oe_button">Add All Info...</button>
<button class="oe_form_m2o_cancel_button oe_button">Cancel</button>
</t>
<t t-name="FieldMonetary" t-extend="FieldChar">
<t t-jquery="t:first" t-operation="before">
<t t-if="widget.get('currency_info') and widget.get('currency_info').position === 'before'">
<t t-esc="widget.get('currency_info').symbol"/>
</t>
</t>
<t t-jquery="t:last" t-operation="after">
<t t-if="widget.get('currency_info') and widget.get('currency_info').position === 'after'">
<t t-esc="widget.get('currency_info').symbol"/>
</t>
</t>
</t>
</templates>
+1 -3
View File
@@ -211,9 +211,7 @@ instance.web_gantt.GanttView = instance.web.View.extend({
on_task_display: function(task) {
var self = this;
var pop = new instance.web.form.FormOpenPopup(self);
pop.on_write_completed.add_last(function() {
self.reload();
});
pop.on('on_write_complete',self,self.reload);
pop.show_element(
self.dataset.model,
task.id,