Merge pull request #17 from savoirfairelinux/7.0-m2m-context
authorMartin Trigaux <mart-e@users.noreply.github.com>
Mon, 23 Jun 2014 15:41:03 +0000 (17:41 +0200)
committerMartin Trigaux <mart-e@users.noreply.github.com>
Mon, 23 Jun 2014 15:41:03 +0000 (17:41 +0200)
[FIX] view_list: Add context propagation for m2m list view

If the _rec_name field of a model is translatable, the value was not translated when displayed in a list view through a many2many field (e.g. server_action_ids on base.action.rule).

addons/web/static/src/js/view_list.js

index 6de354b..4cf5cc6 100644 (file)
@@ -1073,7 +1073,7 @@ instance.web.ListView.List = instance.web.Class.extend( /** @lends instance.web.
                     ids = value;
                 }
                 new instance.web.Model(column.relation)
-                    .call('name_get', [ids]).done(function (names) {
+                    .call('name_get', [ids, this.dataset.context]).done(function (names) {
                         // FIXME: nth horrible hack in this poor listview
                         record.set(column.id + '__display',
                                    _(names).pluck(1).join(', '));