Merge lp:~openerp-dev/openobject-addons/trunk-opw-577044-port-mma into lp:openobject-addons

Proposed by Mayur Maheshwari(OpenERP)
Status: Superseded
Proposed branch: lp:~openerp-dev/openobject-addons/trunk-opw-577044-port-mma
Merge into: lp:openobject-addons
Diff against target: 23 lines (+4/-2)
1 file modified
document/report/document_report.py (+4/-2)
To merge this branch: bzr merge lp:~openerp-dev/openobject-addons/trunk-opw-577044-port-mma
Reviewer Review Type Date Requested Status
OpenERP Core Team Pending
Review via email: mp+136397@code.launchpad.net

This proposal has been superseded by a proposal from 2012-12-20.

Description of the change

Hello,

     I have Fixed the issue of month translation, here month field in report is defined as a char, so just changed it to selection so that name of the month are automatically translated from the server itself in fields_get.

Otherwise it will show the month name in English in any language.

Step :- Document -> Dashboard -> In Graph view X-axis, you will see the name of the month in English in any language.

code is forward port from 6.1

Thanks,
Mayur

To post a comment you must log in.
Revision history for this message
Fabien (Open ERP) (fp-tinyerp) wrote :

not good for the order, you should use '01' instead of '1' for the month of january otherwise the order of the data is incorrect.

8143. By Mayur Maheshwari(OpenERP)

[IMP]document: improve code for the order arrangement

Unmerged revisions

8143. By Mayur Maheshwari(OpenERP)

[IMP]document: improve code for the order arrangement

8142. By Mohammed Shekha(Open ERP)

[FIX]document: Fixed the issue of month translation, here month field in report is defined as a char, so just changed it to selection so that name of the month are automatically translated from the server itself in fields_get

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'document/report/document_report.py'
2--- document/report/document_report.py 2012-09-14 05:15:25 +0000
3+++ document/report/document_report.py 2012-11-27 12:56:25 +0000
4@@ -71,7 +71,9 @@
5 _columns = {
6 'file_size': fields.integer('File Size', readonly=True),
7 'nbr':fields.integer('# of Files', readonly=True),
8- 'month': fields.char('Month', size=24,readonly=True),
9+ 'month': fields.selection([('1','January'), ('2','February'), ('3','March'), ('4','April'),
10+ ('5','May'), ('6','June'), ('7','July'), ('8','August'), ('9','September'),
11+ ('10','October'), ('11','November'), ('12','December')], 'Month', readonly=True),
12 }
13 _order = "month"
14 def init(self, cr):
15@@ -80,7 +82,7 @@
16 create or replace view report_document_file as (
17 select min(f.id) as id,
18 count(*) as nbr,
19- min(EXTRACT(MONTH FROM f.create_date)||'-'||to_char(f.create_date,'Month')) as month,
20+ CAST(min(EXTRACT(MONTH FROM f.create_date)) AS text) as month,
21 sum(f.file_size) as file_size
22 from ir_attachment f
23 group by EXTRACT(MONTH FROM f.create_date)

Subscribers

People subscribed via source and target branches

to all changes: