[FIX] Add context propagation for m2m list view
authorSandy Carter <sandy.carter@savoirfairelinux.com>
Fri, 16 May 2014 21:42:20 +0000 (17:42 -0400)
committerSandy Carter <sandy.carter@savoirfairelinux.com>
Fri, 16 May 2014 21:42:20 +0000 (17:42 -0400)
Fix bug https://bugs.launchpad.net/openerp-web/+bug/1279885 :
    Many2many fields in Tree views will not get translated.
    If you check the context for a name_get of a m2m field, it is passed as
    None.

Add context propagation to m2m fields in list views.
Fix translation issues when viewing a a many2many field in a Tree view.

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(', '));