Merge lp:~openerp-dev/openobject-client/6.1-opw-575749-rgo into lp:openobject-client/6.1

Proposed by Ravi Gohil (OpenERP)
Status: Merged
Approved by: Naresh(OpenERP)
Approved revision: 2066
Merged at revision: 2077
Proposed branch: lp:~openerp-dev/openobject-client/6.1-opw-575749-rgo
Merge into: lp:openobject-client/6.1
Diff against target: 32 lines (+3/-3)
2 files modified
bin/SpiffGtkWidgets/Calendar/CanvasEvent.py (+1/-1)
bin/widget/view/calendar_gtk/parser.py (+2/-2)
To merge this branch: bzr merge lp:~openerp-dev/openobject-client/6.1-opw-575749-rgo
Reviewer Review Type Date Requested Status
Naresh(OpenERP) Pending
Review via email: mp+109836@code.launchpad.net

Description of the change

Hello,

When the calendar view doesn't get the value for it's fields, it shows `False` as a string and not the blank string.

You can reproduce the issue by defining a meeting and not setting the value for the fields `Sales Team` or `Partner`.

This MP contains fix for this issue. Kindly review it.

Thanks.

To post a comment you must log in.
2065. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

2066. By Ravi Gohil (OpenERP)

[FIX] entries in calendar view shows 'False' as a string if there is no value in the field: (Maintenance Case : 575749)

Revision history for this message
Naresh(OpenERP) (nch-openerp) wrote :

just modified the patch a bit before final merge

=== modified file 'bin/widget/view/calendar_gtk/parser.py'
--- bin/widget/view/calendar_gtk/parser.py 2011-10-31 09:12:35 +0000
+++ bin/widget/view/calendar_gtk/parser.py 2012-07-20 06:25:32 +0000
@@ -440,13 +440,14 @@

             if isinstance(s, (tuple, list)): s = s[-1]

- caption = ustr(s)
-
+ if not (isinstance(s,bool) or self.fields[f]['type'] == 'boolean'):
+ caption = ustr(s)
+
             for f in self.axis[1:]:
                 s = event[f]
                 if isinstance(s, (tuple, list)): s = s[-1]
-
- description += [ustr(s)]
+ if not (isinstance(s, bool) or self.fields[f]['type'] == 'boolean'):
+ description += [ustr(s)]

         starts = event.get(self.date_start)
         ends = event.get(self.date_delay) or 1.0

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'bin/SpiffGtkWidgets/Calendar/CanvasEvent.py'
2--- bin/SpiffGtkWidgets/Calendar/CanvasEvent.py 2010-12-13 09:52:05 +0000
3+++ bin/SpiffGtkWidgets/Calendar/CanvasEvent.py 2012-06-14 06:07:22 +0000
4@@ -41,7 +41,7 @@
5 self.append(self.text, hippo.PACK_EXPAND)
6
7 def set_text(self, text, description = ''):
8- self.text.set_property('text', text + ', ' + description)
9+ self.text.set_property('text', text + ', ' + description if text and description else text or description or '')
10
11
12 def set_text_color(self, newcolor):
13
14=== modified file 'bin/widget/view/calendar_gtk/parser.py'
15--- bin/widget/view/calendar_gtk/parser.py 2011-10-31 09:12:35 +0000
16+++ bin/widget/view/calendar_gtk/parser.py 2012-06-14 06:07:22 +0000
17@@ -440,13 +440,13 @@
18
19 if isinstance(s, (tuple, list)): s = s[-1]
20
21- caption = ustr(s)
22+ caption = ustr(s) if not isinstance(s, bool) else '' if not self.fields[f]['type'] == 'boolean' else ustr(s)
23
24 for f in self.axis[1:]:
25 s = event[f]
26 if isinstance(s, (tuple, list)): s = s[-1]
27
28- description += [ustr(s)]
29+ description += [ustr(s)] if not isinstance(s, bool) else [] if not self.fields[f]['type'] == 'boolean' else [ustr(s)]
30
31 starts = event.get(self.date_start)
32 ends = event.get(self.date_delay) or 1.0

Subscribers

People subscribed via source and target branches