diff --git a/README.web b/README.web index 72393bacd34..4c84cefdb22 100644 --- a/README.web +++ b/README.web @@ -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 diff --git a/addons/web/controllers/main.py b/addons/web/controllers/main.py index d93aef6526c..85e9bc076be 100644 --- a/addons/web/controllers/main.py +++ b/addons/web/controllers/main.py @@ -568,7 +568,27 @@ html_template = """ }); - + + + """ diff --git a/addons/web/static/src/css/base.css b/addons/web/static/src/css/base.css index 61809f2ef7c..c8f1567bee9 100644 --- a/addons/web/static/src/css/base.css +++ b/addons/web/static/src/css/base.css @@ -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 { diff --git a/addons/web/static/src/css/base.sass b/addons/web/static/src/css/base.sass index 41b75bec5c3..823ced4e24f 100644 --- a/addons/web/static/src/css/base.sass +++ b/addons/web/static/src/css/base.sass @@ -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 {{{ diff --git a/addons/web/static/src/js/view_form.js b/addons/web/static/src/js/view_form.js index b41039361c0..6a16c06095d 100644 --- a/addons/web/static/src/js/view_form.js +++ b/addons/web/static/src/js/view_form.js @@ -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', }); /** diff --git a/addons/web/static/src/js/views.js b/addons/web/static/src/js/views.js index 21f539fed1b..b98d6d4802b 100644 --- a/addons/web/static/src/js/views.js +++ b/addons/web/static/src/js/views.js @@ -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(); }); diff --git a/addons/web/static/src/xml/base.xml b/addons/web/static/src/xml/base.xml index bf55db8d7c2..5e8e430e771 100644 --- a/addons/web/static/src/xml/base.xml +++ b/addons/web/static/src/xml/base.xml @@ -916,7 +916,7 @@ - + + + + @@ -1717,4 +1720,16 @@ + + + + + + + + + + + + diff --git a/addons/web_gantt/static/src/js/gantt.js b/addons/web_gantt/static/src/js/gantt.js index 00e057258f1..0d600712d4a 100644 --- a/addons/web_gantt/static/src/js/gantt.js +++ b/addons/web_gantt/static/src/js/gantt.js @@ -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,