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 14496fe3522..c8f1567bee9 100644 --- a/addons/web/static/src/css/base.css +++ b/addons/web/static/src/css/base.css @@ -68,10 +68,13 @@ background-color: #f0f0f0; } .openerp thead th { - border-right: 1px dotted #afafb6; + border-left: 1px solid #dfdfdf; } -.openerp thead th:last-child { - border-right: none; +.openerp thead th:first-child { + border-left: none; +} +.openerp thead th.null { + border-left: none; } .openerp th, .openerp td { padding: 0; @@ -515,27 +518,11 @@ .openerp .oe_webclient .oe_star_on { color: gold; } -.openerp header { - position: relative; - border-bottom: 1px solid #cacaca; - padding-left: 2px; - background-color: #fcfcfc; - background-image: -webkit-gradient(linear, left top, left bottom, from(#fcfcfc), to(#dedede)); - background-image: -webkit-linear-gradient(top, #fcfcfc, #dedede); - background-image: -moz-linear-gradient(top, #fcfcfc, #dedede); - background-image: -ms-linear-gradient(top, #fcfcfc, #dedede); - background-image: -o-linear-gradient(top, #fcfcfc, #dedede); - background-image: linear-gradient(to bottom, #fcfcfc, #dedede); +.openerp p.oe_grey { + max-width: 650px; } -.openerp header > span { - margin-left: 4px; -} -.openerp header ul { - display: inline-block; - float: right; -} -.openerp header .oe_button { - margin: 3px 2px 1px; +.openerp .oe_grey { + color: #aaaaaa; } .openerp .oe_tag { border: 1px solid #afafb6; @@ -2037,6 +2024,31 @@ .openerp .oe_application .oe_form_sheet .oe_notebook_page { padding: 0 16px; } +.openerp .oe_form header { + position: relative; + border-bottom: 1px solid #cacaca; + padding-left: 2px; + background-color: #fcfcfc; + background-image: -webkit-gradient(linear, left top, left bottom, from(#fcfcfc), to(#dedede)); + background-image: -webkit-linear-gradient(top, #fcfcfc, #dedede); + background-image: -moz-linear-gradient(top, #fcfcfc, #dedede); + background-image: -ms-linear-gradient(top, #fcfcfc, #dedede); + background-image: -o-linear-gradient(top, #fcfcfc, #dedede); + background-image: linear-gradient(to bottom, #fcfcfc, #dedede); +} +.openerp .oe_form header > span { + margin-left: 4px; +} +.openerp .oe_form header ul { + display: inline-block; + float: right; +} +.openerp .oe_form header .oe_button { + margin: 3px 2px 1px; +} +.openerp .oe_form header .oe_button:first-child { + margin-left: 6px; +} .openerp .oe_form header .oe_tags { margin: 5px 0 0 5px; width: 400px; @@ -2048,11 +2060,6 @@ margin: 0 auto; padding: 16px 0 48px; } -.openerp .oe_form header .oe_tags .oe_grey { - color: #aaaaaa; - max-width: 650px; - margin: 0 0 10px 0; -} .openerp .oe_form header .oe_tags div.oe_form_configuration p, .openerp .oe_form header .oe_tags div.oe_form_configuration ul, .openerp .oe_form header .oe_tags div.oe_form_configuration ol { color: #aaaaaa; max-width: 650px; @@ -2292,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 784f93d94cf..823ced4e24f 100644 --- a/addons/web/static/src/css/base.sass +++ b/addons/web/static/src/css/base.sass @@ -180,9 +180,11 @@ $sheet-max-width: 860px font-weight: bold background-color: #f0f0f0 th - border-right: 1px dotted $tag-border - &:last-child - border-right: none + border-left: 1px solid #dfdfdf + &:first-child + border-left: none + &.null + border-left: none th, td padding: 0 text-align: left @@ -450,21 +452,11 @@ $sheet-max-width: 860px text-decoration: none .oe_star_on color: gold - // }}} + p.oe_grey + max-width: 650px + .oe_grey + color: #aaa - // Generic blocks {{{ - header - position: relative - border-bottom: 1px solid #cacaca - padding-left: 2px - @include vertical-gradient(#fcfcfc, #dedede) - > span - margin-left: 4px - ul - display: inline-block - float: right - .oe_button - margin: 3px 2px 1px // }}} // Tags (for many2many tags, among others) {{{ @@ -825,7 +817,7 @@ $sheet-max-width: 860px vertical-align: top text-shadow: 0 1px 1px rgba(0,0,0,0.2) @include transition(all 0.2s ease-out) - &:hover, + &:hover background: rgba(0,0,0,0.2) text-shadow: black 0px 0px 3px color: white @@ -885,7 +877,7 @@ $sheet-max-width: 860px vertical-align: top text-shadow: 0 1px 1px rgba(0,0,0,0.2) @include transition(all 0.2s ease-out) - &:hover, + &:hover background: rgba(0,0,0,0.2) text-shadow: black 0px 0px 3px color: white @@ -1613,6 +1605,22 @@ $sheet-max-width: 860px .oe_notebook_page padding: 0 16px // }}} + // FormView.header {{{ + .oe_form header + position: relative + border-bottom: 1px solid #cacaca + padding-left: 2px + @include vertical-gradient(#fcfcfc, #dedede) + > span + margin-left: 4px + ul + display: inline-block + float: right + .oe_button, + margin: 3px 2px 1px + &:first-child + margin-left: 6px + // }}} // FormView.custom tags and classes {{{ .oe_form header .oe_tags margin: 5px 0 0 5px @@ -1623,10 +1631,6 @@ $sheet-max-width: 860px max-width: $sheet-max-width margin: 0 auto padding: 16px 0 48px - .oe_grey - color: #aaa - max-width: 650px - margin: 0 0 10px 0 div.oe_form_configuration p, ul, ol color: #aaa @@ -1821,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 fa6dbd3a27c..11d2f3da869 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,