[MERGE] forward port of branch 7.0 up to revid 4162 launchpad_translations_on_behalf_...
authorChristophe Simonis <chs@openerp.com>
Tue, 18 Mar 2014 11:27:43 +0000 (12:27 +0100)
committerChristophe Simonis <chs@openerp.com>
Tue, 18 Mar 2014 11:27:43 +0000 (12:27 +0100)
bzr revid: chs@openerp.com-20140129095637-mbfz82r5pyz4dctc
bzr revid: dle@openerp.com-20140210140818-5mtk1qhheo219bm1
bzr revid: dle@openerp.com-20140214114445-krexrwm9o2nrxepk
bzr revid: mat@openerp.com-20140219111353-cxo860z7ctz7om30
bzr revid: dle@openerp.com-20140221120519-1pj3wc8kqgkr5uda
bzr revid: chs@openerp.com-20140318112743-tqv492026y2pnbff

13 files changed:
1  2 
addons/web/controllers/main.py
addons/web/static/src/css/base.css
addons/web/static/src/css/base.sass
addons/web/static/src/js/chrome.js
addons/web/static/src/js/data.js
addons/web/static/src/js/data_export.js
addons/web/static/src/js/formats.js
addons/web/static/src/js/search.js
addons/web/static/src/js/view_form.js
addons/web/static/src/js/view_list.js
addons/web/static/src/js/views.js
addons/web/tests/test_dataset.py
addons/web_kanban/static/src/js/kanban.js

@@@ -1051,8 -1083,11 +1051,11 @@@ class DataSet(http.Controller)
                  'records': [{'id': id} for id in ids]
              }
  
 -        records = Model.read(ids, fields or False, req.context)
 +        records = Model.read(ids, fields or False, request.context)
-         records.sort(key=lambda obj: ids.index(obj['id']))
+         index = dict((r['id'], r) for r in records)
+         records = [index[x] for x in ids if x in index]
          return {
              'length': length,
              'records': records
@@@ -1526,10 -1567,10 +1529,10 @@@ class Export(http.Controller)
              if length == 2:
                  # subfields is a seq of $base/*rest, and not loaded yet
                  info.update(self.graft_subfields(
 -                    req, fields[base]['relation'], base, fields[base]['string'],
 +                    fields[base]['relation'], base, fields[base]['string'],
                      subfields
                  ))
-             else:
+             elif base in fields:
                  info[base] = fields[base]['string']
  
          return info
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
@@@ -407,8 -407,8 +407,8 @@@ instance.web.SearchView = instance.web.
                  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)
 +                return self.search_view_loaded(r);
              }).fail(function () {
                  self.ready.reject.apply(null, arguments);
              });
@@@ -5047,11 -4917,11 +5048,11 @@@ instance.web.form.FieldReference = inst
          this.selection.on("change:value", this, this.on_selection_changed);
          this.selection.appendTo(this.$(".oe_form_view_reference_selection"));
          this.selection
 -            .on('focused', null, function () {self.trigger('focused')})
 -            .on('blurred', null, function () {self.trigger('blurred')});
 +            .on('focused', null, function () {self.trigger('focused');})
 +            .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);
@@@ -5485,11 -5388,8 +5486,8 @@@ instance.web.form.FieldStatus = instanc
          });
          this.get_selection();
          if (this.options.clickable) {
 -            this.$el.on('click','li',this.on_click_stage);
 +            this.$el.on('click','li[data-id]',this.on_click_stage);
          }
-         if (this.$el.parent().is('header')) {
-             this.$el.after('<div class="oe_clear"/>');
-         }
          this._super();
      },
      set_value: function(value_) {
Simple merge
Simple merge
@@@ -28,10 -22,15 +28,15 @@@ class TestDataSetController(unittest2.T
  
      def test_regular_find(self):
          self.search.return_value = [1, 2, 3]
+         self.read.return_value = [
+             {'id': 1, 'name': 'foo'},
+             {'id': 2, 'name': 'bar'},
+             {'id': 3, 'name': 'qux'}
+         ]
  
 -        self.dataset.do_search_read(self.request, 'fake.model')
 +        self.dataset.do_search_read('fake.model')
          self.read.assert_called_once_with(
 -            [1, 2, 3], False,self.request.context)
 +            [1, 2, 3], False, req.context)
  
      def test_ids_shortcut(self):
          self.search.return_value = [1, 2, 3]