Merge lp:~openerp-dev/openerp-web/7.0-opw-586536-msh into lp:openerp-web/7.0

Proposed by Mohammed Shekha(Open ERP)
Status: Merged
Approved by: Xavier (Open ERP)
Approved revision: 3766
Merge reported by: Xavier (Open ERP)
Merged at revision: not available
Proposed branch: lp:~openerp-dev/openerp-web/7.0-opw-586536-msh
Merge into: lp:openerp-web/7.0
Diff against target: 28 lines (+10/-1)
1 file modified
addons/web_calendar/static/src/js/calendar.js (+10/-1)
To merge this branch: bzr merge lp:~openerp-dev/openerp-web/7.0-opw-586536-msh
Reviewer Review Type Date Requested Status
Xavier (Open ERP) (community) Needs Information
Review via email: mp+149485@code.launchpad.net

Description of the change

Hello,

Fixed the issue of responsible label for field type selection calendar sidebar.

Demo:- Go to Sale -> Sale Order -> Calendar view, sidebar responsible are not proper, the responsible field is selection field so for selection field Calendar view displays database value for the selection.

Changed the code and check specially for selectiuon field as we have did for many2one already.

Thanks.

To post a comment you must log in.
Revision history for this message
Xavier (Open ERP) (xmo-deactivatedaccount) wrote :

I fail to see any "responsible" in the sidebar, only a list of statuses. What are you talking about?

review: Needs Information
Revision history for this message
Mohammed Shekha(Open ERP) (msh-openerp) wrote :

Hello Xavier,

The thing I had descibed is mixed up with two calendar view so it might written responsible, actually it is Status, the thing I want to tell is these status comes as a database value, instead there should be display value of selection field not databasse value.

Thanks.

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-02-04 14:38:04 +0000
3+++ addons/web_calendar/static/src/js/calendar.js 2013-02-20 07:16:27 +0000
4@@ -264,7 +264,13 @@
5
6 //To parse Events we have to convert date Format
7 var res_events = [],
8- sidebar_items = {};
9+ sidebar_items = {},
10+ selection_labels = {};
11+ if(this.fields[this.color_field].type == 'selection') {
12+ _(this.fields[this.color_field].selection).each(function(value){
13+ selection_labels[value[0]] = value[1];
14+ });
15+ }
16 for (var e = 0; e < events.length; e++) {
17 var evt = events[e];
18 if (!evt[this.date_start]) {
19@@ -274,6 +280,9 @@
20 if (this.color_field) {
21 var filter = evt[this.color_field];
22 if (filter) {
23+ if(this.fields[this.color_field].type == 'selection') {
24+ filter = selection_labels[filter];
25+ }
26 var filter_value = (typeof filter === 'object') ? filter[0] : filter;
27 if (typeof(fn_filter) === 'function' && !fn_filter(filter_value)) {
28 continue;