Skip to content

Commit

Permalink
[FIX] Add context propagation for m2m list view
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Sandy Carter committed May 16, 2014
1 parent 1397b7a commit 3594dc5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion addons/web/static/src/js/view_list.js
Original file line number Diff line number Diff line change
Expand Up @@ -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(', '));
Expand Down

0 comments on commit 3594dc5

Please sign in to comment.