diff --git a/addons/web/static/src/css/Makefile b/addons/web/static/src/css/Makefile index f4f1f6d1bb5..ba88946baac 100644 --- a/addons/web/static/src/css/Makefile +++ b/addons/web/static/src/css/Makefile @@ -1,2 +1,5 @@ -sass: - sass -t expanded --compass --unix-newlines --watch base.sass:base.css& \ No newline at end of file +all: *.css +%.css: %.sass + sass -t expanded --compass --unix-newlines $< $@ +watch: + sass -t expanded --compass --unix-newlines --watch .:. diff --git a/addons/web/static/src/css/base.css b/addons/web/static/src/css/base.css index bf9362a1e09..81ca509f4f9 100644 --- a/addons/web/static/src/css/base.css +++ b/addons/web/static/src/css/base.css @@ -78,6 +78,20 @@ .openerp td { vertical-align: top; } +.openerp .oe_title { + width: 50%; + float: left; +} +.openerp .oe_title:after { + content: "."; + display: block; + height: 0; + clear: both; + visibility: hidden; +} +.openerp .oe_form_group { + clear: both; +} .openerp .zebra tbody tr:nth-child(odd) td { background-color: #f0f0fa; background-color: #efeff8; @@ -1594,7 +1608,6 @@ border-radius: 0 3px 3px 0; } .openerp .oe_searchview .oe_searchview_facets .oe_searchview_facet .oe_facet_category, .openerp .oe_searchview .oe_searchview_facets .oe_searchview_facet .oe_facet_value { - height: 18px; padding: 0 4px; } .openerp .oe_searchview .oe_searchview_facets .oe_searchview_facet .oe_facet_category { @@ -3021,25 +3034,12 @@ font-size: 95%; line-height: 1.2em; } -.openerp .oe_debug_view_log label { - display: block; - width: 49%; - text-align: right; - float: left; - font-weight: bold; - color: #000099; -} -.openerp .oe_debug_view_log span { - display: block; - width: 49%; - float: right; - color: #333333; -} .openerp .navbar { min-height: 32px; margin-bottom: 0px; border: none; z-index: 1; + position: static; background-color: #414141; background-color: #454343; background-image: -webkit-gradient(linear, left top, left bottom, from(#646060), to(#262626)); diff --git a/addons/web/static/src/css/base.sass b/addons/web/static/src/css/base.sass index c79deecddb5..f51e806d1ee 100644 --- a/addons/web/static/src/css/base.sass +++ b/addons/web/static/src/css/base.sass @@ -189,6 +189,17 @@ $sheet-padding: 16px vertical-align: middle td vertical-align: top + .oe_title + width: 50% + float: left + .oe_title:after + content: "." + display: block + height: 0 + clear: both + visibility: hidden + .oe_form_group + clear: both .zebra tbody tr:nth-child(odd) td background-color: #f0f0fa @include vertical-gradient(#f0f0fa, #eeeef6) @@ -1302,7 +1313,6 @@ $sheet-padding: 16px background: $tag-bg-light @include radius(0 3px 3px 0) .oe_facet_category, .oe_facet_value - height: 18px padding: 0 4px .oe_facet_category color: white @@ -2419,18 +2429,6 @@ $sheet-padding: 16px .oe_debug_view_log font-size: 95% line-height: 1.2em - .oe_debug_view_log label - display: block - width: 49% - text-align: right - float: left - font-weight: bold - color: #009 - .oe_debug_view_log span - display: block - width: 49% - float: right - color: #333 // }}} // Bootstrap HACKS {{{ .navbar @@ -2438,6 +2436,7 @@ $sheet-padding: 16px margin-bottom: 0px border: none z-index: 1 + position: static background-color: #414141 @include vertical-gradient(#646060, #262626) .navbar-default diff --git a/addons/web/static/src/js/data.js b/addons/web/static/src/js/data.js index 78e3001d746..f2a55bbc44b 100644 --- a/addons/web/static/src/js/data.js +++ b/addons/web/static/src/js/data.js @@ -872,7 +872,8 @@ instance.web.BufferedDataSet = instance.web.DataSetStatic.extend({ }); var return_records = function() { var records = _.map(ids, function(id) { - return _.extend({}, _.detect(self.cache, function(c) {return c.id === id;}).values, {"id": id}); + var c = _.find(self.cache, function(c) {return c.id === id;}); + return _.isUndefined(c) ? c : _.extend({}, c.values, {"id": id}); }); if (self.debug_mode) { if (_.include(records, undefined)) { diff --git a/addons/web/static/src/js/search.js b/addons/web/static/src/js/search.js index 903a9f4683e..b667d135bdd 100644 --- a/addons/web/static/src/js/search.js +++ b/addons/web/static/src/js/search.js @@ -414,7 +414,7 @@ instance.web.SearchView = instance.web.Widget.extend(/** @lends instance.web.Sea context: this.dataset.get_context(), }); - $.when(load_view).then(function (r) { + this.alive($.when(load_view)).then(function (r) { return self.search_view_loaded(r); }).fail(function () { self.ready.reject.apply(null, arguments); diff --git a/addons/web/static/src/js/view_form.js b/addons/web/static/src/js/view_form.js index 4576e9d328d..0a30d4db649 100644 --- a/addons/web/static/src/js/view_form.js +++ b/addons/web/static/src/js/view_form.js @@ -5129,7 +5129,7 @@ instance.web.form.FieldReference = instance.web.form.AbstractField.extend(instan .on('blurred', null, function () {self.trigger('blurred');}); this.m2o = new instance.web.form.FieldMany2One(fm, { attrs: { - name: 'm2o', + name: 'Referenced Document', modifiers: JSON.stringify({readonly: this.get('effective_readonly')}), }}); this.m2o.on("change:value", this, this.data_changed); diff --git a/addons/web/static/src/js/views.js b/addons/web/static/src/js/views.js index 82a2095bace..cb0d130e305 100644 --- a/addons/web/static/src/js/views.js +++ b/addons/web/static/src/js/views.js @@ -815,6 +815,11 @@ instance.web.ViewManager = instance.web.Widget.extend({ contexts: [action_context].concat(contexts || []), group_by_seq: groupbys || [] }).done(function (results) { + if (results.error) { + throw new Error( + _.str.sprintf(_t("Failed to evaluate search criterions")+": \n%s", + JSON.stringify(results.error))); + } self.dataset._model = new instance.web.Model( self.dataset.model, results.context, results.domain); var groupby = results.group_by.length @@ -1259,7 +1264,7 @@ instance.web.Sidebar = instance.web.Widget.extend({ this.dataset = dataset; this.model_id = model_id; if (args && args[0].error) { - this.do_warn( instance.web.qweb.render('message_error_uploading'), args[0].error); + this.do_warn(_t('Uploading Error'), args[0].error); } if (!model_id) { this.on_attachments_loaded([]); diff --git a/addons/web/static/src/xml/base.xml b/addons/web/static/src/xml/base.xml index fc9c2154d01..80b82c1f40b 100644 --- a/addons/web/static/src/xml/base.xml +++ b/addons/web/static/src/xml/base.xml @@ -536,23 +536,32 @@
- - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + +
ID:
XML ID:
Creation User:
Creation Date:
Latest Modification by:
Latest Modification Date:
diff --git a/addons/web_view_editor/static/src/js/view_editor.js b/addons/web_view_editor/static/src/js/view_editor.js index a7906689cce..69e9a3080b7 100644 --- a/addons/web_view_editor/static/src/js/view_editor.js +++ b/addons/web_view_editor/static/src/js/view_editor.js @@ -15,7 +15,7 @@ instance.web.ViewManagerAction.include({ } evt.currentTarget.selectedIndex = 0; }else{ - return this._super.apply(this,arguments); + return this._super.apply(this,arguments); } } }); @@ -73,12 +73,10 @@ instance.web_view_editor.ViewEditor = instance.web.Widget.extend({ $.when(this.action_manager.do_action(action)).done(function() { var viewmanager = self.action_manager.inner_widget; var controller = viewmanager.views[viewmanager.active_view].controller; - controller.on('view_loaded', self, function(){ - $(controller.groups).bind({ - 'selected': function(e, ids, records) { + $(controller.groups).bind({ + 'selected': function (e, ids, records, deselected) { self.main_view_id = ids[0]; - } - }); + } }); }); }, @@ -232,10 +230,11 @@ instance.web_view_editor.ViewEditor = instance.web.Widget.extend({ return main_object; }, parse_xml: function(arch, view_id) { + //First element of att_list must be element tagname. main_object = { 'level': 0, 'id': this.xml_element_id +=1, - 'att_list': [], + 'att_list': ["view"], 'name': _.str.sprintf("", view_id), 'child_id': [] }; @@ -535,15 +534,22 @@ instance.web_view_editor.ViewEditor = instance.web.Widget.extend({ var field_dataset = new instance.web.DataSetSearch(this, this.model, null, null); parent_tr = self.get_object_by_id(parseInt($(parent_tr).attr('id').replace(/[^0-9]+/g, '')), this.one_object['main_object'], [])[0].att_list[0]; _.each([tr, parent_tr],function(element) { - var value = _.has(_CHILDREN, element) ? element : _.str.include(html_tag, element)?"html_tag":false; + var value = _.has(_CHILDREN, element) ? element : _.str.include(html_tag, element)?"html_tag":false; property_to_check.push(value); }); field_dataset.call( 'fields_get', []).done(function(result) { var fields = _.keys(result); fields.push(" "),fields.sort(); - self.on_add_node(property_to_check, fields); + self.on_add_node(property_to_check, fields, self.inject_position(parent_tr,tr)); }); }, + inject_position : function(parent_tag,current_tag){ + if(parent_tag == "view") + return ['Inside']; + if(current_tag == "field") + return ['After','Before']; + return ['After','Before','Inside']; + }, do_node_edit: function(side) { var self = this; var result = self.get_object_by_id(this.one_object.clicked_tr_id, this.one_object['main_object'], []); @@ -637,12 +643,12 @@ instance.web_view_editor.ViewEditor = instance.web.Widget.extend({ var children = _.filter(xml_arch.childNodes[0].childNodes, function (child) { return child.nodeType == 1; }); - arch.arch = _.detect(children, function(xml_child) { + var inherited_view = _.detect(children, function(xml_child) { var temp_obj = self.create_View_Node(xml_child), insert = _.intersection(_.flatten(temp_obj.att_list),_.uniq(check_list)); if (insert.length == _.uniq(check_list).length ) {return xml_child;} }); - xml_arch = QWeb.load_xml(arch.arch); + xml_arch = QWeb.load_xml(instance.web.xml_to_str(inherited_view)); } return self.do_save_xml(xml_arch.documentElement, obj[0].child_id[0],obj[0].child_id, move_direct, update_values,arch); }, @@ -941,11 +947,11 @@ instance.web_view_editor.ViewEditor = instance.web.Widget.extend({ }); return def.promise(); }, - on_add_node: function(properties, fields){ + on_add_node: function(properties, fields, position){ var self = this; var render_list = [{'name': 'node_type','selection': _.keys(_CHILDREN).sort(), 'value': 'field', 'string': 'Node Type','type': 'selection'}, {'name': 'field_value','selection': fields, 'value': false, 'string': '','type': 'selection'}, - {'name': 'position','selection': ['After','Before','Inside'], 'value': false, 'string': 'Position','type': 'selection'}]; + {'name': 'position','selection': position, 'value': false, 'string': 'Position','type': 'selection'}]; this.add_widget = []; this.add_node_dialog = new instance.web.Dialog(this,{ title: _t("Properties"), @@ -1186,7 +1192,7 @@ var _CHILDREN = { //e.g.:xyz 'td' : ['field'] }; // Generic html_tag list and can be added html tag in future. It's support above _CHILDREN dict's *html_tag* by default. -// For specific child node one has to define tag above and specify children tag in list. Like above xyz example. +// For specific child node one has to define tag above and specify children tag in list. Like above xyz example. var html_tag = ['div','h1','h2','h3','h4','h5','h6','td','tr']; var _ICONS = ['','STOCK_ABOUT', 'STOCK_ADD', 'STOCK_APPLY', 'STOCK_BOLD',