Merge lp:~openerp-dev/openerp-web/7.0-opw-584359-cbi into lp:openerp-web/7.0

Proposed by Chris Biersbach (OpenERP)
Status: Merged
Merged at revision: 3878
Proposed branch: lp:~openerp-dev/openerp-web/7.0-opw-584359-cbi
Merge into: lp:openerp-web/7.0
Diff against target: 26 lines (+9/-0)
1 file modified
addons/web_calendar/static/src/js/calendar.js (+9/-0)
To merge this branch: bzr merge lp:~openerp-dev/openerp-web/7.0-opw-584359-cbi
Reviewer Review Type Date Requested Status
OpenERP Core Team Pending
Review via email: mp+156847@code.launchpad.net

Description of the change

Forwardport of 6.1 merge proposal by msh: Fixed the issue of Calendar responsible label not translated when there is selection field on responsible.

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'addons/web_calendar/static/src/js/calendar.js'
2--- addons/web_calendar/static/src/js/calendar.js 2013-04-02 10:47:52 +0000
3+++ addons/web_calendar/static/src/js/calendar.js 2013-04-03 13:30:08 +0000
4@@ -265,6 +265,12 @@
5 //To parse Events we have to convert date Format
6 var res_events = [],
7 sidebar_items = {};
8+ var selection_label = {};
9+ if(this.fields[this.color_field].selection) {
10+ _(this.fields[this.color_field].selection).each(function(value){
11+ selection_label[value[0]] = value[1];
12+ });
13+ }
14 for (var e = 0; e < events.length; e++) {
15 var evt = events[e];
16 if (!evt[this.date_start]) {
17@@ -274,6 +280,9 @@
18 if (this.color_field) {
19 var filter = evt[this.color_field];
20 if (filter) {
21+ if(this.fields[this.color_field].selection) {
22+ filter = selection_label[filter];
23+ }
24 var filter_value = (typeof filter === 'object') ? filter[0] : filter;
25 if (typeof(fn_filter) === 'function' && !fn_filter(filter_value)) {
26 continue;