diff --git a/addons/web/__openerp__.py b/addons/web/__openerp__.py index fcfdca60a2a..11b94353695 100644 --- a/addons/web/__openerp__.py +++ b/addons/web/__openerp__.py @@ -17,7 +17,7 @@ This module provides the core of the OpenERP Web Client. "static/lib/datejs/parser.js", "static/lib/datejs/sugarpak.js", "static/lib/datejs/extras.js", - "static/lib/jquery/jquery-1.7.2.js", + "static/lib/jquery/jquery-1.8.2.js", "static/lib/jquery.MD5/jquery.md5.js", "static/lib/jquery.form/jquery.form.js", "static/lib/jquery.validate/jquery.validate.js", @@ -25,7 +25,7 @@ This module provides the core of the OpenERP Web Client. "static/lib/spinjs/spin.js", "static/lib/jquery.autosize/jquery.autosize.js", "static/lib/jquery.blockUI/jquery.blockUI.js", - "static/lib/jquery.ui/js/jquery-ui-1.8.17.custom.min.js", + "static/lib/jquery.ui/js/jquery-ui-1.9.1.custom.js", "static/lib/jquery.ui.timepicker/js/jquery-ui-timepicker-addon.js", "static/lib/jquery.ui.notify/js/jquery.notify.js", "static/lib/jquery.deferred-queue/jquery.deferred-queue.js", @@ -38,7 +38,7 @@ This module provides the core of the OpenERP Web Client. "static/lib/underscore/underscore.string.js", "static/lib/backbone/backbone.js", "static/lib/cleditor/jquery.cleditor.js", - "static/lib/py.js/lib/py.js", + "static/lib/py.js/lib/py.js", "static/src/js/boot.js", "static/src/js/corelib.js", "static/src/js/coresetup.js", @@ -55,7 +55,7 @@ This module provides the core of the OpenERP Web Client. "static/src/js/view_tree.js", ], 'css' : [ - "static/lib/jquery.ui.bootstrap/css/custom-theme/jquery-ui-1.8.16.custom.css", + "static/lib/jquery.ui.bootstrap/css/custom-theme/jquery-ui-1.9.0.custom.css", "static/lib/jquery.ui.timepicker/css/jquery-ui-timepicker-addon.css", "static/lib/jquery.ui.notify/css/ui.notify.css", "static/lib/jquery.tipsy/tipsy.css", @@ -67,4 +67,5 @@ This module provides the core of the OpenERP Web Client. 'qweb' : [ "static/src/xml/*.xml", ], + 'bootstrap': True, } diff --git a/addons/web/controllers/main.py b/addons/web/controllers/main.py index ad8d91ed1dd..9eb672caa3b 100644 --- a/addons/web/controllers/main.py +++ b/addons/web/controllers/main.py @@ -81,57 +81,6 @@ def rjsmin(script): ).strip() return result -def sass2scss(src): - # Validated by diff -u of sass2scss against: - # sass-convert -F sass -T scss openerp.sass openerp.scss - block = [] - sass = ('', block) - reComment = re.compile(r'//.*$') - reIndent = re.compile(r'^\s+') - reIgnore = re.compile(r'^\s*(//.*)?$') - reFixes = { re.compile(r'\(\((.*)\)\)') : r'(\1)', } - lastLevel = 0 - prevBlocks = {} - for l in src.split('\n'): - l = l.rstrip() - if reIgnore.search(l): continue - l = reComment.sub('', l) - l = l.rstrip() - indent = reIndent.match(l) - level = indent.end() if indent else 0 - l = l[level:] - if level>lastLevel: - prevBlocks[lastLevel] = block - newBlock = [] - block[-1] = (block[-1], newBlock) - block = newBlock - elif level=0: - out += indent+sass[0]+" {\n" - for e in sass[1]: - out += write(e, level+1) - if level>=0: - out = out.rstrip(" \n") - out += ' }\n' - if level==0: - out += "\n" - else: - out += indent+sass+";\n" - return out - return write(sass) - def db_list(req): dbs = [] proxy = req.session.proxy("db") @@ -142,6 +91,17 @@ def db_list(req): dbs = [i for i in dbs if re.match(r, i)] return dbs +def db_monodb(req): + # if only one db is listed returns it else return False + try: + dbs = db_list(req) + if len(dbs) == 1: + return dbs[0] + except xmlrpclib.Fault: + # ignore access denied + pass + return False + def module_topological_sort(modules): """ Return a list of module names sorted so that their dependencies of the modules are listed before the module itself @@ -231,22 +191,14 @@ def module_installed_bypass_session(dbname): def module_boot(req): server_wide_modules = openerp.conf.server_wide_modules or ['web'] - return [m for m in server_wide_modules if m in openerpweb.addons_manifest] - # TODO the following will be enabled once we separate the module code and translation loading serverside = [] dbside = [] for i in server_wide_modules: if i in openerpweb.addons_manifest: serverside.append(i) - # if only one db load every module at boot - dbs = [] - try: - dbs = db_list(req) - except xmlrpclib.Fault: - # ignore access denied - pass - if len(dbs) == 1: - dbside = module_installed_bypass_session(dbs[0]) + monodb = db_monodb(req) + if monodb: + dbside = module_installed_bypass_session(monodb) dbside = [i for i in dbside if i not in serverside] addons = serverside + dbside return addons @@ -549,7 +501,7 @@ def _local_web_translations(trans_file): messages.append({'id': x.id, 'string': x.string}) return messages -def from_elementtree(el, preserve_whitespaces=False): +def xml2json_from_elementtree(el, preserve_whitespaces=False): """ xml2json-direct Simple and straightforward XML-to-JSON converter in Python New BSD Licensed @@ -569,13 +521,12 @@ def from_elementtree(el, preserve_whitespaces=False): if el.text and (preserve_whitespaces or el.text.strip() != ''): kids.append(el.text) for kid in el: - kids.append(from_elementtree(kid, preserve_whitespaces)) + kids.append(xml2json_from_elementtree(kid, preserve_whitespaces)) if kid.tail and (preserve_whitespaces or kid.tail.strip() != ''): kids.append(kid.tail) res["children"] = kids return res - def content_disposition(filename, req): filename = filename.encode('utf8') escaped = urllib2.quote(filename) @@ -612,8 +563,7 @@ html_template = """ - - + + diff --git a/addons/web_calendar/static/src/js/calendar.js b/addons/web_calendar/static/src/js/calendar.js index 36e37219bf8..51bce57f7cd 100644 --- a/addons/web_calendar/static/src/js/calendar.js +++ b/addons/web_calendar/static/src/js/calendar.js @@ -96,7 +96,7 @@ instance.web_calendar.CalendarView = instance.web.View.extend({ if (!this.sidebar && this.options.$sidebar) { this.sidebar = new instance.web_calendar.Sidebar(this); - this.has_been_loaded.pipe(this.sidebar.appendTo(this.$el.find('.oe_calendar_sidebar_container'))); + this.has_been_loaded.then(this.sidebar.appendTo(this.$el.find('.oe_calendar_sidebar_container'))); } this.trigger('calendar_view_loaded', data); return this.has_been_loaded.resolve(); @@ -236,7 +236,7 @@ instance.web_calendar.CalendarView = instance.web.View.extend({ } }, reload_event: function(id) { - this.dataset.read_ids([id], _.keys(this.fields)).then(this.proxy('events_loaded')); + this.dataset.read_ids([id], _.keys(this.fields)).done(this.proxy('events_loaded')); }, get_color: function(key) { if (this.color_map[key]) { @@ -347,12 +347,12 @@ instance.web_calendar.CalendarView = instance.web.View.extend({ ranged_search: function() { var self = this; scheduler.clearAll(); - $.when(this.has_been_loaded, this.ready).then(function() { + $.when(this.has_been_loaded, this.ready).done(function() { self.dataset.read_slice(_.keys(self.fields), { offset: 0, domain: self.get_range_domain(), context: self.last_search[1] - }).then(function(events) { + }).done(function(events) { self.dataset_events = events; self.events_loaded(events); }); @@ -367,7 +367,7 @@ instance.web_calendar.CalendarView = instance.web.View.extend({ }, do_show: function () { var self = this; - $.when(this.has_been_loaded).then(function() { + $.when(this.has_been_loaded).done(function() { self.$el.show(); self.do_push_state({}); }); @@ -387,7 +387,7 @@ instance.web_calendar.CalendarView = instance.web.View.extend({ var index = this.dataset.get_id_index(event_id); if (index !== null) { event_id = this.dataset.ids[index]; - this.dataset.write(event_id, data, {}).then(function() { + this.dataset.write(event_id, data, {}).done(function() { self.refresh_minical(); }); } @@ -395,13 +395,13 @@ instance.web_calendar.CalendarView = instance.web.View.extend({ quick_create: function(event_id, event_obj) { var self = this; var data = this.get_event_data(event_obj); - this.dataset.create(data).then(function(r) { + this.dataset.create(data).done(function(r) { var id = r; self.dataset.ids.push(id); scheduler.changeEventId(event_id, id); self.refresh_minical(); self.reload_event(id); - }, function(r, event) { + }).fail(function(r, event) { event.preventDefault(); self.slow_create(event_id, event_obj); }); @@ -472,7 +472,7 @@ instance.web_calendar.CalendarView = instance.web.View.extend({ var self = this; var index = this.dataset.get_id_index(event_id); if (index !== null) { - this.dataset.unlink(event_id).then(function() { + this.dataset.unlink(event_id).done(function() { self.refresh_minical(); }); } diff --git a/addons/web_diagram/static/src/js/diagram.js b/addons/web_diagram/static/src/js/diagram.js index 85c6427b704..7b914922205 100644 --- a/addons/web_diagram/static/src/js/diagram.js +++ b/addons/web_diagram/static/src/js/diagram.js @@ -26,7 +26,7 @@ instance.web.DiagramView = instance.web.View.extend({ }, start: function() { var self = this; - return this.rpc("/web_diagram/diagram/load", {"model": this.model, "view_id": this.view_id}).then(function(r) { + return this.rpc("/web_diagram/diagram/load", {"model": this.model, "view_id": this.view_id}).done(function(r) { self.load_diagram(r); }); }, @@ -105,7 +105,7 @@ instance.web.DiagramView = instance.web.View.extend({ }); this.rpc( - '/web_diagram/diagram/get_diagram_info',params).then(function(result) { + '/web_diagram/diagram/get_diagram_info',params).done(function(result) { self.draw_diagram(result); } ); @@ -256,7 +256,7 @@ instance.web.DiagramView = instance.web.View.extend({ ); pop.on('write_completed', self, function() { - self.dataset.read_index(_.keys(self.fields_view.fields)).pipe(self.on_diagram_loaded); + self.dataset.read_index(_.keys(self.fields_view.fields)).then(self.on_diagram_loaded); }); var form_fields = [self.parent_field]; @@ -290,7 +290,7 @@ instance.web.DiagramView = instance.web.View.extend({ self.context || self.dataset.context ); pop.on("elements_selected", self, function(element_ids) { - self.dataset.read_index(_.keys(self.fields_view.fields)).pipe(self.on_diagram_loaded); + self.dataset.read_index(_.keys(self.fields_view.fields)).then(self.on_diagram_loaded); }); var form_controller = pop.view_form; @@ -320,7 +320,7 @@ instance.web.DiagramView = instance.web.View.extend({ } ); pop.on('write_completed', self, function() { - self.dataset.read_index(_.keys(self.fields_view.fields)).pipe(self.on_diagram_loaded); + self.dataset.read_index(_.keys(self.fields_view.fields)).then(self.on_diagram_loaded); }); }, @@ -342,7 +342,7 @@ instance.web.DiagramView = instance.web.View.extend({ this.context || this.dataset.context ); pop.on("elements_selected", self, function(element_ids) { - self.dataset.read_index(_.keys(self.fields_view.fields)).pipe(self.on_diagram_loaded); + self.dataset.read_index(_.keys(self.fields_view.fields)).then(self.on_diagram_loaded); }); // We want to destroy the dummy edge after a creation cancel. This destroys it even if we save the changes. // This is not a problem since the diagram is completely redrawn on saved changes. @@ -390,7 +390,7 @@ instance.web.DiagramView = instance.web.View.extend({ pager_action_trigger: function(){ var loaded = this.dataset.read_index(_.keys(this.fields_view.fields)) - .pipe(this.on_diagram_loaded); + .then(this.on_diagram_loaded); this.do_update_pager(); return loaded; }, diff --git a/addons/web_diagram/static/src/js/graph.js b/addons/web_diagram/static/src/js/graph.js index bfe5796c0f0..6e3b018d85a 100644 --- a/addons/web_diagram/static/src/js/graph.js +++ b/addons/web_diagram/static/src/js/graph.js @@ -87,12 +87,12 @@ dummy_circle.animate({'r': close_button_radius }, 400, 'linear'); if(entity_type == "node"){ - $.when(GraphNode.destruction_callback(entity)).then(function () { + $.when(GraphNode.destruction_callback(entity)).done(function () { //console.log("remove node",entity); entity.remove(); }); }else if(entity_type == "edge"){ - $.when(GraphEdge.destruction_callback(entity)).then(function () { + $.when(GraphEdge.destruction_callback(entity)).done(function () { //console.log("remove edge",entity); entity.remove(); }); diff --git a/addons/web_gantt/static/src/js/gantt.js b/addons/web_gantt/static/src/js/gantt.js index 040f53568ae..627942d0dbc 100644 --- a/addons/web_gantt/static/src/js/gantt.js +++ b/addons/web_gantt/static/src/js/gantt.js @@ -22,7 +22,7 @@ instance.web_gantt.GanttView = instance.web.View.extend({ var self = this; this.fields_view = fields_view_get; this.$el.addClass(this.fields_view.arch.attrs['class']); - return this.rpc("/web/searchview/fields_get", {"model": this.dataset.model}).pipe(function(fields_get) { + return this.rpc("/web/searchview/fields_get", {"model": this.dataset.model}).then(function(fields_get) { self.fields = fields_get.fields; self.has_been_loaded.resolve(); }); @@ -46,11 +46,11 @@ instance.web_gantt.GanttView = instance.web.View.extend({ })); fields = _.uniq(fields.concat(n_group_bys)); - return $.when(this.has_been_loaded).pipe(function() { + return $.when(this.has_been_loaded).then(function() { return self.dataset.read_slice(fields, { domain: domains, context: contexts - }).pipe(function(data) { + }).then(function(data) { return self.on_data_loaded(data, n_group_bys); }); }); @@ -62,7 +62,7 @@ instance.web_gantt.GanttView = instance.web.View.extend({ on_data_loaded: function(tasks, group_bys) { var self = this; var ids = _.pluck(tasks, "id"); - return this.dataset.name_get(ids).pipe(function(names) { + return this.dataset.name_get(ids).then(function(names) { var ntasks = _.map(tasks, function(task) { return _.extend({__name: _.detect(names, function(name) { return name[0] == task.id; })[1]}, task); }); diff --git a/addons/web_graph/static/src/js/graph.js b/addons/web_graph/static/src/js/graph.js index 8d8d49d0a44..3b73201b154 100644 --- a/addons/web_graph/static/src/js/graph.js +++ b/addons/web_graph/static/src/js/graph.js @@ -94,7 +94,7 @@ instance.web_graph.GraphView = instance.web.View.extend({ if (self.legend == "top") { self.legend = "inside"; } self.forcehtml = true; - self.graph_get_data().then(function (result) { + self.graph_get_data().done(function (result) { self.graph_render_all(result).download.saveImage('png'); }).always(function () { self.forcehtml = false; @@ -243,7 +243,7 @@ instance.web_graph.GraphView = instance.web.View.extend({ var result = []; var ticks = {}; - return obj.call("fields_view_get", [view_id, 'graph']).pipe(function(tmp) { + return obj.call("fields_view_get", [view_id, 'graph']).then(function(tmp) { view_get = tmp; fields = view_get['fields']; var toload = _.select(group_by, function(x) { return fields[x] === undefined }); @@ -251,7 +251,7 @@ instance.web_graph.GraphView = instance.web.View.extend({ return obj.call("fields_get", [toload, context]); else return $.when([]); - }).pipe(function (fields_to_add) { + }).then(function (fields_to_add) { _.extend(fields, fields_to_add); var tree = $($.parseXML(view_get['arch'])); @@ -307,7 +307,7 @@ instance.web_graph.GraphView = instance.web.View.extend({ } if (mode === "pie") { - return obj.call("read_group", [domain, yaxis.concat([xaxis[0]]), [xaxis[0]]], {context: context}).pipe(function(res) { + return obj.call("read_group", [domain, yaxis.concat([xaxis[0]]), [xaxis[0]]], {context: context}).then(function(res) { _.each(res, function(record) { result.push({ 'data': [[_convert(xaxis[0], record[xaxis[0]]), record[yaxis[0]]]], @@ -318,11 +318,11 @@ instance.web_graph.GraphView = instance.web.View.extend({ } else if ((! stacked) || (xaxis.length < 2)) { var defs = []; _.each(xaxis, function(x) { - defs.push(obj.call("read_group", [domain, yaxis.concat([x]), [x]], {context: context}).pipe(function(res) { + defs.push(obj.call("read_group", [domain, yaxis.concat([x]), [x]], {context: context}).then(function(res) { return [x, res]; })); }); - return $.when.apply($, defs).pipe(function() { + return $.when.apply($, defs).then(function() { _.each(_.toArray(arguments), function(res) { var x = res[0]; res = res[1]; @@ -336,15 +336,15 @@ instance.web_graph.GraphView = instance.web.View.extend({ }); } else { xaxis.reverse(); - return obj.call("read_group", [domain, yaxis.concat(xaxis.slice(0, 1)), xaxis.slice(0, 1)], {context: context}).pipe(function(axis) { + return obj.call("read_group", [domain, yaxis.concat(xaxis.slice(0, 1)), xaxis.slice(0, 1)], {context: context}).then(function(axis) { var defs = []; _.each(axis, function(x) { var key = x[xaxis[0]] - defs.push(obj.call("read_group", [domain, yaxis.concat(xaxis.slice(1, 2)), xaxis.slice(1, 2)], {context: context}).pipe(function(res) { + defs.push(obj.call("read_group", [domain, yaxis.concat(xaxis.slice(1, 2)), xaxis.slice(1, 2)], {context: context}).then(function(res) { return [x, key, res]; })); }); - return $.when.apply($, defs).pipe(function() { + return $.when.apply($, defs).then(function() { _.each(_.toArray(arguments), function(res) { var x = res[0]; var key = res[1]; @@ -359,7 +359,7 @@ instance.web_graph.GraphView = instance.web.View.extend({ }); }); } - }).pipe(function() { + }).then(function() { var res = { 'data': result, 'ticks': _.map(ticks, function(el, key) { return [el, key] }) @@ -374,7 +374,7 @@ instance.web_graph.GraphView = instance.web.View.extend({ _.extend(this, options.data); return this.graph_get_data() - .then(this.proxy('graph_render_all')); + .done(this.proxy('graph_render_all')); }, graph_render_all: function (data) { diff --git a/addons/web_kanban/static/src/css/kanban.css b/addons/web_kanban/static/src/css/kanban.css index f968364c987..105e074df1f 100644 --- a/addons/web_kanban/static/src/css/kanban.css +++ b/addons/web_kanban/static/src/css/kanban.css @@ -113,7 +113,7 @@ padding: 0; margin: 0px; } -.openerp .oe_kanban_view .oe_kanban_group_folded .oe_kanban_group_title, .openerp .oe_kanban_view .oe_kanban_group_folded.oe_kanban_column > *, .openerp .oe_kanban_view .oe_kanban_group_folded .oe_kanban_aggregates, .openerp .oe_kanban_view .oe_kanban_group_folded .oe_kanban_add { +.openerp .oe_kanban_view .oe_kanban_group_folded .oe_kanban_group_title, .openerp .oe_kanban_view .oe_kanban_group_folded.oe_kanban_column *, .openerp .oe_kanban_view .oe_kanban_group_folded .oe_kanban_aggregates, .openerp .oe_kanban_view .oe_kanban_group_folded .oe_kanban_add { display: none; } .openerp .oe_kanban_view .oe_kanban_group_folded .oe_kanban_group_title_vertical { diff --git a/addons/web_kanban/static/src/css/kanban.sass b/addons/web_kanban/static/src/css/kanban.sass index 459fc56092d..fbc9e3d8568 100644 --- a/addons/web_kanban/static/src/css/kanban.sass +++ b/addons/web_kanban/static/src/css/kanban.sass @@ -140,7 +140,7 @@ padding: 0 margin: 0px .oe_kanban_group_folded - .oe_kanban_group_title, &.oe_kanban_column > *, .oe_kanban_aggregates, .oe_kanban_add + .oe_kanban_group_title, &.oe_kanban_column *, .oe_kanban_aggregates, .oe_kanban_add display: none .oe_kanban_group_title_vertical display: block diff --git a/addons/web_kanban/static/src/js/kanban.js b/addons/web_kanban/static/src/js/kanban.js index 76920da6a47..a4f51e81dd8 100644 --- a/addons/web_kanban/static/src/js/kanban.js +++ b/addons/web_kanban/static/src/js/kanban.js @@ -198,7 +198,7 @@ instance.web_kanban.KanbanView = instance.web.View.extend({ var form = am.dialog_widget.views.form.controller; form.on("on_button_cancel", am.dialog, am.dialog.close); form.on('record_created', self, function(r) { - (new instance.web.DataSet(self, self.group_by_field.relation)).name_get([r]).then(function(new_record) { + (new instance.web.DataSet(self, self.group_by_field.relation)).name_get([r]).done(function(new_record) { am.dialog.close(); var domain = self.dataset.domain.slice(0); domain.push([self.group_by, '=', new_record[0][0]]); @@ -212,7 +212,7 @@ instance.web_kanban.KanbanView = instance.web.View.extend({ aggregates: {}, }; var new_group = new instance.web_kanban.KanbanGroup(self, [], datagroup, dataset); - self.do_add_groups([new_group]).then(function() { + self.do_add_groups([new_group]).done(function() { $(window).scrollTo(self.groups.slice(-1)[0].$el, { axis: 'x' }); }); }); @@ -224,14 +224,14 @@ instance.web_kanban.KanbanView = instance.web.View.extend({ this.search_domain = domain; this.search_context = context; this.search_group_by = group_by; - $.when(this.has_been_loaded).then(function() { + $.when(this.has_been_loaded).done(function() { self.group_by = group_by.length ? group_by[0] : self.fields_view.arch.attrs.default_group_by; self.group_by_field = self.fields_view.fields[self.group_by] || {}; self.grouped_by_m2o = (self.group_by_field.type === 'many2one'); self.$buttons.find('.oe_alternative').toggle(self.grouped_by_m2o); self.$el.toggleClass('oe_kanban_grouped_by_m2o', self.grouped_by_m2o); var grouping = new instance.web.Model(self.dataset.model, context, domain).query().group_by(self.group_by); - $.when(grouping).then(function(groups) { + $.when(grouping).done(function(groups) { if (groups) { self.do_process_groups(groups); } else { @@ -252,7 +252,7 @@ instance.web_kanban.KanbanView = instance.web.View.extend({ var dataset = new instance.web.DataSetSearch(self, self.dataset.model, new instance.web.CompoundContext(self.dataset.get_context(), group.model.context()), group.model.domain()); return dataset.read_slice(self.fields_keys.concat(['__last_update']), { 'limit': self.limit }) - .pipe(function(records) { + .then(function(records) { self.dataset.ids.push.apply(self.dataset.ids, dataset.ids); groups_array[index] = new instance.web_kanban.KanbanGroup(self, records, group, dataset); if (!remaining--) { @@ -268,16 +268,16 @@ instance.web_kanban.KanbanView = instance.web.View.extend({ this.$el.removeClass('oe_kanban_grouped').addClass('oe_kanban_ungrouped'); this.add_group_mutex.exec(function() { var def = $.Deferred(); - self.dataset.read_slice(self.fields_keys.concat(['__last_update']), { 'limit': self.limit }).then(function(records) { + self.dataset.read_slice(self.fields_keys.concat(['__last_update']), { 'limit': self.limit }).done(function(records) { self.do_clear_groups(); var kgroup = new instance.web_kanban.KanbanGroup(self, records, null, self.dataset); - self.do_add_groups([kgroup]).then(function() { + self.do_add_groups([kgroup]).done(function() { if (_.isEmpty(records)) { self.no_result(); } def.resolve(); }); - }).then(null, function() { + }).done(null, function() { def.reject(); }); return def; @@ -306,7 +306,7 @@ instance.web_kanban.KanbanView = instance.web.View.extend({ return group.insertBefore($last_td); } }); - return $.when.apply(null, groups_started).then(function () { + return $.when.apply(null, groups_started).done(function () { self.on_groups_started(); self.$el.appendTo($parent); _.each(self.groups, function(group) { @@ -375,7 +375,7 @@ instance.web_kanban.KanbanView = instance.web.View.extend({ var tmp_group = self.groups.splice(start_index, 1)[0]; self.groups.splice(stop_index, 0, tmp_group); var new_sequence = _.pluck(self.groups, 'value'); - (new instance.web.DataSet(self, self.group_by_field.relation)).resequence(new_sequence).then(function(r) { + (new instance.web.DataSet(self, self.group_by_field.relation)).resequence(new_sequence).done(function(r) { if (r === false) { console.error("Kanban: could not resequence model '%s'. Probably no 'sequence' field.", self.group_by_field.relation); } @@ -404,7 +404,7 @@ instance.web_kanban.KanbanView = instance.web.View.extend({ record.group = new_group; var data = {}; data[this.group_by] = new_group.value; - this.dataset.write(record.id, data, {}).then(function() { + this.dataset.write(record.id, data, {}).done(function() { record.do_reload(); new_group.do_save_sequences(); }).fail(function(error, evt) { @@ -497,7 +497,7 @@ instance.web_kanban.KanbanView.postprocessing_widget_many2many_tags = function(s if(model_list_id[model].length>0){ var block = self.$el.find(".oe_form_field.oe_tags[model='" + model + "']"); var dataset = new instance.web.DataSetSearch(self, model, self.session.context); - dataset.name_get(_.uniq( model_list_id[model] )).then( + dataset.name_get(_.uniq( model_list_id[model] )).done( function(result) { for(var t=0;t\n<%s string='%s'>\n\t\n", values.view_type, view_string, field_name, values.view_type); var vals = {'model': self.model, 'name': values.view_name, 'priority': values.priority, 'type': values.view_type, 'arch': arch}; @@ -182,7 +182,7 @@ instance.web_view_editor.ViewEditor = instance.web.Widget.extend({ var self = this; if (confirm(_t("Do you really want to remove this view?"))) { var controller = this.action_manager.inner_widget.views[this.action_manager.inner_widget.active_view].controller; - this.dataset.unlink([this.main_view_id]).then(function() { + this.dataset.unlink([this.main_view_id]).done(function() { controller.reload_content(); self.main_view_id = self.parent.fields_view.view_id; }); @@ -245,12 +245,12 @@ instance.web_view_editor.ViewEditor = instance.web.Widget.extend({ get_arch: function() { var self = this; var view_arch_list = []; - this.dataset.read_ids([parseInt(self.main_view_id)], ['arch', 'type','priority']).then(function(arch) { + this.dataset.read_ids([parseInt(self.main_view_id)], ['arch', 'type','priority']).done(function(arch) { if (arch.length) { var arch_object = self.parse_xml(arch[0].arch, self.main_view_id); self.main_view_type = arch[0].type == 'tree'? 'list': arch[0].type; view_arch_list.push({"view_id": self.main_view_id, "arch": arch[0].arch,"priority":arch[0].priority}); - self.dataset.read_slice([], {domain: [['inherit_id','=', parseInt(self.main_view_id)]]}).then(function(result) { + self.dataset.read_slice([], {domain: [['inherit_id','=', parseInt(self.main_view_id)]]}).done(function(result) { _.each(result, function(res) { view_arch_list.push({"view_id": res.id, "arch": res.arch,"priority":res.priority}); self.inherit_view(arch_object, res); @@ -455,7 +455,7 @@ instance.web_view_editor.ViewEditor = instance.web.Widget.extend({ var priority = _.detect(self.one_object['arch'], function(val) {return val.view_id == view_id;}); var arch = _.str.sprintf("\n\t ", val[1]); var vals = {'model': self.model, 'name': view_name, 'priority': priority.priority + 1, 'type': "form", 'arch': arch,'inherit_id':self.main_view_id}; - this.dataset.create(vals).then(function(id) { + this.dataset.create(vals).done(function(id) { var arch_to_obj = self.parse_xml(arch,id); obj.child_id.push(arch_to_obj[0]); self.one_object['parent_child_id'] = self.parent_child_list(self.one_object['main_object'],[]); @@ -538,7 +538,7 @@ instance.web_view_editor.ViewEditor = instance.web.Widget.extend({ var value = _.has(_CHILDREN, element) ? element : _.str.include(html_tag, element)?"html_tag":false; property_to_check.push(value); }); - field_dataset.call( 'fields_get', []).then(function(result) { + field_dataset.call( 'fields_get', []).done(function(result) { var fields = _.keys(result); fields.push(" "),fields.sort(); self.on_add_node(property_to_check, fields); @@ -890,7 +890,7 @@ instance.web_view_editor.ViewEditor = instance.web.Widget.extend({ var arch_val = self.get_object_by_id(this.one_object.clicked_tr_id,this.one_object['main_object'], []); this.edit_node_dialog.$el.append('
'); this.edit_widget = []; - self.ready = $.when(self.on_groups(properties)).then(function () { + self.ready = $.when(self.on_groups(properties)).done(function () { _PROPERTIES_ATTRIBUTES['groups']['selection'] = self.groups; var values = _.keys( instance.web.form.widgets.map); values.push(''); @@ -993,7 +993,7 @@ instance.web_view_editor.ViewEditor = instance.web.Widget.extend({ table_selector.find("td[id^=]").attr("width","100px"); self.add_node_dialog.$el.find('#new_field').click(function() { model_data = new instance.web.DataSetSearch(self,'ir.model', null, null); - model_data.read_slice([], {domain: [['model','=', self.model]]}).then(function(result) { + model_data.read_slice([], {domain: [['model','=', self.model]]}).done(function(result) { self.render_new_field(result[0]); }); }); @@ -1011,7 +1011,7 @@ instance.web_view_editor.ViewEditor = instance.web.Widget.extend({ } }; var action_manager = new instance.web.ActionManager(self); - $.when(action_manager.do_action(action)).then(function() { + $.when(action_manager.do_action(action)).done(function() { var controller = action_manager.dialog_widget.views['form'].controller; controller.on("on_button_cancel", self, function(){ action_manager.destroy();