diff options
| author | Christophe Simonis <chs@odoo.com> | 2014-09-15 15:09:32 +0200 |
|---|---|---|
| committer | Christophe Simonis <chs@odoo.com> | 2014-09-15 15:09:32 +0200 |
| commit | 45cc064d590eae30357b6055f7609508a47b78fc (patch) | |
| tree | db41ced74b478c9e6629f4aa40396b00ed78cc65 /addons/web/static/src | |
| parent | 3fb4ad20cdae70019656c8fce32ab0bb8fadf090 (diff) | |
| parent | 780dd9891f5783fd07a075a445314df912d0a88c (diff) | |
[MERGE] forward port of branch 8.0 up to 780dd98
Diffstat (limited to 'addons/web/static/src')
| -rw-r--r-- | addons/web/static/src/css/base.css | 27 | ||||
| -rw-r--r-- | addons/web/static/src/css/base.sass | 16 | ||||
| -rw-r--r-- | addons/web/static/src/js/chrome.js | 4 | ||||
| -rw-r--r-- | addons/web/static/src/js/data.js | 2 | ||||
| -rw-r--r-- | addons/web/static/src/js/pyeval.js | 23 | ||||
| -rw-r--r-- | addons/web/static/src/js/view_form.js | 25 | ||||
| -rw-r--r-- | addons/web/static/src/js/views.js | 7 | ||||
| -rw-r--r-- | addons/web/static/src/xml/base.xml | 21 |
8 files changed, 63 insertions, 62 deletions
diff --git a/addons/web/static/src/css/base.css b/addons/web/static/src/css/base.css index 2cd8b4b2ad1..9492c53aac2 100644 --- a/addons/web/static/src/css/base.css +++ b/addons/web/static/src/css/base.css @@ -1002,20 +1002,8 @@ text-align: center; margin: 10px 0 0; } -.openerp .oe_about .user-details .user-info-block .navigation { - float: left; - width: auto; - padding: 0; - margin-left: 25%; - list-style: none; - border: 1px solid #a24689; -} -.openerp .oe_about .user-details .user-info-block .navigation li { - float: left; -} .openerp .oe_about .user-details .user-info-block .navigation li a { - padding: 20px 30px; - float: left; + padding: 10px 20px; } .openerp .oe_about .user-details .user-info-block .navigation li.active a { background: #a24689; @@ -1914,17 +1902,17 @@ .openerp .oe_application .oe_form_sheet .oe_notebook_page { padding: 0 16px; } -.openerp .oe_form > :not(.oe_form_nosheet) header { +.openerp .oe_form > :not(.oe_form_nosheet) header, .openerp .oe_form > .oe_form_nosheet header { padding-left: 2px; } -.openerp .oe_form > :not(.oe_form_nosheet) header ul:not(.oe_tooltip_technical):not(.oe_dropdown_menu) { +.openerp .oe_form > :not(.oe_form_nosheet) header ul:not(.oe_tooltip_technical):not(.oe_dropdown_menu), .openerp .oe_form > .oe_form_nosheet header ul:not(.oe_tooltip_technical):not(.oe_dropdown_menu) { display: inline-block; float: right; } -.openerp .oe_form > :not(.oe_form_nosheet) header .oe_button { +.openerp .oe_form > :not(.oe_form_nosheet) header .oe_button, .openerp .oe_form > .oe_form_nosheet header .oe_button { margin: 3px 2px 1px; } -.openerp .oe_form > :not(.oe_form_nosheet) header .oe_button:first-child { +.openerp .oe_form > :not(.oe_form_nosheet) header .oe_button:first-child, .openerp .oe_form > .oe_form_nosheet header .oe_button:first-child { margin-left: 6px; } .openerp .oe_form header { @@ -2642,7 +2630,9 @@ .openerp .oe_list.oe_list_editable.oe_editing .oe_form_field.oe_form_field_float.oe_readonly, .openerp .oe_list.oe_list_editable.oe_editing .oe_form_field.oe_form_view_integer.oe_readonly { padding: 6px 0px 0px; text-align: right; - max-width: 100px; +} +.openerp .oe_list.oe_list_editable.oe_editing .oe_form_field.oe_form_field_float span, .openerp .oe_list.oe_list_editable.oe_editing .oe_form_field.oe_form_view_integer span { + padding: 0px 6px; } .openerp .oe_list.oe_list_editable.oe_editing .oe_form_field.oe_form_field_float input, .openerp .oe_list.oe_list_editable.oe_editing .oe_form_field.oe_form_view_integer input { width: 100% !important; @@ -3373,6 +3363,7 @@ body.oe_single_form .oe_single_form_container { } .modal .oe_act_window.modal-body { padding: 0; + overflow-x: auto; } .ui-datepicker { diff --git a/addons/web/static/src/css/base.sass b/addons/web/static/src/css/base.sass index 5ba6f747a5a..9897a99fe3d 100644 --- a/addons/web/static/src/css/base.sass +++ b/addons/web/static/src/css/base.sass @@ -869,17 +869,9 @@ $sheet-padding: 16px text-align: center margin: 10px 0 0 .navigation - float: left - width: auto - padding: 0 - margin-left: 25% - list-style: none - border: 1px solid $link-color-odoo li - float: left a - padding: 20px 30px - float: left + padding: 10px 20px &.active a background: $link-color-odoo color: #fff @@ -1579,7 +1571,7 @@ $sheet-padding: 16px padding: 0 16px // }}} // FormView.header {{{ - .oe_form > :not(.oe_form_nosheet) header + .oe_form > :not(.oe_form_nosheet) header, .oe_form > .oe_form_nosheet header padding-left: 2px ul:not(.oe_tooltip_technical):not(.oe_dropdown_menu) display: inline-block @@ -2148,7 +2140,8 @@ $sheet-padding: 16px &.oe_readonly padding: 6px 0px 0px text-align: right - max-width: 100px + span + padding: 0px 6px input width: 100% !important text-align: right @@ -2757,6 +2750,7 @@ body.oe_single_form margin: 0 4px 0 0 .oe_act_window.modal-body padding: 0 + overflow-x: auto .ui-datepicker z-index: 1500 !important diff --git a/addons/web/static/src/js/chrome.js b/addons/web/static/src/js/chrome.js index 57063a8ef55..66202e4ae47 100644 --- a/addons/web/static/src/js/chrome.js +++ b/addons/web/static/src/js/chrome.js @@ -1051,7 +1051,7 @@ instance.web.UserMenu = instance.web.Widget.extend({ this.update_promise = this.update_promise.then(fct, fct); }, on_menu_help: function() { - window.open('http://help.openerp.com', '_blank'); + window.open('http://help.odoo.com', '_blank'); }, on_menu_logout: function() { this.trigger('user_logout'); @@ -1083,7 +1083,7 @@ instance.web.UserMenu = instance.web.Widget.extend({ instance.web.redirect('https://accounts.odoo.com/oauth2/auth?'+$.param(params)); }).fail(function(result, ev){ ev.preventDefault(); - instance.web.redirect('https://accounts.openerp.com/web'); + instance.web.redirect('https://accounts.odoo.com/web'); }); } }, diff --git a/addons/web/static/src/js/data.js b/addons/web/static/src/js/data.js index c22faaae9bd..8936c40b051 100644 --- a/addons/web/static/src/js/data.js +++ b/addons/web/static/src/js/data.js @@ -969,6 +969,8 @@ instance.web.BufferedDataSet = instance.web.DataSetStatic.extend({ sign = -1; field = field.slice(1); } + if(!a[field] && a[field] !== 0){ return sign} + if(!b[field] && b[field] !== 0){ return (sign == -1) ? 1 : -1} //m2o should be searched based on value[1] not based whole value(i.e. [id, value]) if(_.isArray(a[field]) && a[field].length == 2 && _.isString(a[field][1])){ return sign * compare(a[field][1], b[field][1]); diff --git a/addons/web/static/src/js/pyeval.js b/addons/web/static/src/js/pyeval.js index d5499a028b7..bad98e7b2a0 100644 --- a/addons/web/static/src/js/pyeval.js +++ b/addons/web/static/src/js/pyeval.js @@ -888,15 +888,9 @@ return new $.Deferred(function (d) {setTimeout(function () { var result; try { - var contexts = ([instance.session.user_context] || []).concat(source.contexts); - // see Session.eval_context in Python - result = { - context: instance.web.pyeval.eval('contexts', contexts), - domain: instance.web.pyeval.eval('domains', source.domains), - group_by: instance.web.pyeval.eval('groupbys', source.group_by_seq || []) - }; - - } catch (e) { + result = instance.web.pyeval.sync_eval_domains_and_contexts(source); + } + catch (e) { result = { error: { code: 400, message: instance.web._t("Evaluation Error"), @@ -906,9 +900,18 @@ instance.web._t("Local evaluation failure\n%s\n\n%s"), e.message, JSON.stringify(source)) } - }}; + }}; } d.resolve(result); }, 0); }); }; + instance.web.pyeval.sync_eval_domains_and_contexts = function (source) { + var contexts = ([instance.session.user_context] || []).concat(source.contexts); + // see Session.eval_context in Python + return { + context: instance.web.pyeval.eval('contexts', contexts), + domain: instance.web.pyeval.eval('domains', source.domains), + group_by: instance.web.pyeval.eval('groupbys', source.group_by_seq || []) + }; + }; })(); diff --git a/addons/web/static/src/js/view_form.js b/addons/web/static/src/js/view_form.js index 58bf4d4bb4e..a48b029f728 100644 --- a/addons/web/static/src/js/view_form.js +++ b/addons/web/static/src/js/view_form.js @@ -587,7 +587,16 @@ instance.web.FormView = instance.web.View.extend(instance.web.form.FieldManagerM var self = this; return this.mutating_mutex.exec(function() { function iterate() { - var defs = []; + var start = $.Deferred(); + start.resolve(); + start = _.reduce(self.onchanges_defs, function(memo, d){ + return memo.then(function(){ + return d; + }, function(){ + return d; + }); + }, start); + var defs = [start]; _.each(self.fields, function(field) { defs.push(field.commit_value()); }); @@ -796,14 +805,12 @@ instance.web.FormView = instance.web.View.extend(instance.web.form.FieldManagerM var self = this; var save_obj = {prepend_on_create: prepend_on_create, ret: null}; this.save_list.push(save_obj); - return $.when.apply($, self.onchanges_defs).then(function(){ - return self._process_operations().then(function() { - if (save_obj.error) - return $.Deferred().reject(); - return $.when.apply($, save_obj.ret); - }).done(function() { - self.$el.removeClass('oe_form_dirty'); - }); + return self._process_operations().then(function() { + if (save_obj.error) + return $.Deferred().reject(); + return $.when.apply($, save_obj.ret); + }).done(function(result) { + self.$el.removeClass('oe_form_dirty'); }); }, _process_save: function(save_obj) { diff --git a/addons/web/static/src/js/views.js b/addons/web/static/src/js/views.js index 85e8e274d30..6dc20e91548 100644 --- a/addons/web/static/src/js/views.js +++ b/addons/web/static/src/js/views.js @@ -1621,7 +1621,12 @@ instance.web.fields_view_get = function(args) { if (typeof model === 'string') { model = new instance.web.Model(args.model, args.context); } - return args.model.call('fields_view_get', [args.view_id, args.view_type, args.context, args.toolbar]).then(function(fvg) { + return args.model.call('fields_view_get', { + view_id: args.view_id, + view_type: args.view_type, + context: args.context, + toolbar: args.toolbar + }).then(function(fvg) { return postprocess(fvg); }); }; diff --git a/addons/web/static/src/xml/base.xml b/addons/web/static/src/xml/base.xml index eb02390ad17..911736c7262 100644 --- a/addons/web/static/src/xml/base.xml +++ b/addons/web/static/src/xml/base.xml @@ -365,13 +365,13 @@ <t t-name="UserMenu.about"> <div class="oe_about"> - <a class="oe_activate_debug_mode oe_right label label-primary" href="?debug" >Activate the developer mode</a> - - - <div class="container"> - <div class=""> - <div class="col-sm-6 col-md-6 user-details"> + <div class="container-fluid"> + <div class="row"> + <a class="oe_activate_debug_mode oe_right label label-primary" href="?debug" >Activate the developer mode</a> + </div> + <div class="row"> + <div class="col-sm-offset-2 col-md-offset-2 col-sm-8 col-md-8 user-details"> <div class="user-image"> <img src="/web/static/src/img/logo2.png" alt="Odoo (Formerly OpenERP)" title="Odoo (Formerly OpenERP)" class="img-circle"/> </div> @@ -381,7 +381,7 @@ <h3>Version <t t-esc="version_info.server_version"/></h3> </div> - <ul class="navigation"> + <ul class="list-inline text-center navigation"> <li class="active"> <a data-toggle="tab" href="#settings"> <span class="glyphicon glyphicon-cog"></span> @@ -439,7 +439,6 @@ </div> </div> </div> - </t> <t t-name="WebClient.timezone_notification"> @@ -1298,10 +1297,10 @@ <img t-att-src='_s + "/web/static/src/img/throbber.gif"' width="16" height="16"/> <b>Uploading ...</b> </div> + <t t-call="HiddenInputFile"> + <t t-set="fileupload_id" t-value="widget.fileupload_id"/> + </t> </div> - <t t-call="HiddenInputFile"> - <t t-set="fileupload_id" t-value="widget.fileupload_id"/> - </t> </t> </span> </t> |
