Merge lp:~openerp-dev/openobject-addons/trunk-bug-798721-mtr into lp:openobject-addons
- trunk-bug-798721-mtr
- Merge into trunk
Proposed by
Meera Trambadia (OpenERP)
Status: | Merged | ||||
---|---|---|---|---|---|
Merged at revision: | 5225 | ||||
Proposed branch: | lp:~openerp-dev/openobject-addons/trunk-bug-798721-mtr | ||||
Merge into: | lp:openobject-addons | ||||
Diff against target: |
263 lines (+41/-31) 3 files modified
hr_attendance/report/attendance_by_month.py (+15/-13) hr_attendance/report/bymonth.xsl (+10/-2) hr_holidays/report/holidays_summary_report.py (+16/-16) |
||||
To merge this branch: | bzr merge lp:~openerp-dev/openobject-addons/trunk-bug-798721-mtr | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Mustufa Rangwala (Open ERP) (community) | Approve | ||
Meera Trambadia (OpenERP) (community) | Needs Resubmitting | ||
qdp (OpenERP) | Pending | ||
Review via email: mp+66069@code.launchpad.net |
Commit message
Description of the change
hr_attendance, hr_holidays:monthly attendance and holidays summary report are now translated" --fixes=lp:798721
To post a comment you must log in.
Revision history for this message
Mustufa Rangwala (Open ERP) (mra-tinyerp) wrote : | # |
review:
Needs Fixing
Revision history for this message
Meera Trambadia (OpenERP) (mtr-openerp) wrote : | # |
Hello sir,
I have made the changes in 'Attendances by Month' report as per your suggestion.
For Employee Holidays report I have translated the month and weekdays string.
And for 'Weekly Attendance' and 'Employee Holidays' report it requires to transfer the strings from .xsl to .py(in the xml format) thus needs to redefine the report files.
So the patch here consist of the changes for 'Attendances by Month' and 'Employee Holidays'(partial changes) report.
review:
Needs Resubmitting
Revision history for this message
Mustufa Rangwala (Open ERP) (mra-tinyerp) : | # |
review:
Approve
Revision history for this message
Mustufa Rangwala (Open ERP) (mra-tinyerp) wrote : | # |
Translation no available for some strings in pot/po files so currently it does not translate.
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'hr_attendance/report/attendance_by_month.py' | |||
2 | --- hr_attendance/report/attendance_by_month.py 2011-02-07 09:36:21 +0000 | |||
3 | +++ hr_attendance/report/attendance_by_month.py 2011-09-16 05:20:29 +0000 | |||
4 | @@ -30,9 +30,10 @@ | |||
5 | 30 | 30 | ||
6 | 31 | from report import report_sxw | 31 | from report import report_sxw |
7 | 32 | from tools import ustr | 32 | from tools import ustr |
8 | 33 | from tools.translate import _ | ||
9 | 33 | 34 | ||
10 | 34 | one_day = relativedelta(days=1) | 35 | one_day = relativedelta(days=1) |
12 | 35 | month2name = [0, 'January', 'February', 'March', 'April', 'May', 'Jun', 'July', 'August', 'September', 'October', 'November', 'December'] | 36 | month2name = [0, 'January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'] |
13 | 36 | 37 | ||
14 | 37 | def hour2str(h): | 38 | def hour2str(h): |
15 | 38 | hours = int(h) | 39 | hours = int(h) |
16 | @@ -52,7 +53,7 @@ | |||
17 | 52 | context = {} | 53 | context = {} |
18 | 53 | month = datetime(datas['form']['year'], datas['form']['month'], 1) | 54 | month = datetime(datas['form']['year'], datas['form']['month'], 1) |
19 | 54 | emp_ids = context.get('active_ids', []) | 55 | emp_ids = context.get('active_ids', []) |
21 | 55 | user_xml = ['<month>%s</month>' % month2name[month.month], '<year>%s</year>' % month.year] | 56 | user_xml = ['<month>%s</month>' % _(month2name[month.month]), '<year>%s</year>' % month.year] |
22 | 56 | if emp_ids: | 57 | if emp_ids: |
23 | 57 | for emp in obj_emp.read(cr, uid, emp_ids, ['name']): | 58 | for emp in obj_emp.read(cr, uid, emp_ids, ['name']): |
24 | 58 | stop, days_xml = False, [] | 59 | stop, days_xml = False, [] |
25 | @@ -95,7 +96,7 @@ | |||
26 | 95 | days_xml.append(today_xml) | 96 | days_xml.append(today_xml) |
27 | 96 | today, tomor = tomor, tomor + one_day | 97 | today, tomor = tomor, tomor + one_day |
28 | 97 | user_xml.append(user_repr % '\n'.join(days_xml)) | 98 | user_xml.append(user_repr % '\n'.join(days_xml)) |
30 | 98 | 99 | ||
31 | 99 | rpt_obj = pooler.get_pool(cr.dbname).get('hr.employee') | 100 | rpt_obj = pooler.get_pool(cr.dbname).get('hr.employee') |
32 | 100 | rml_obj=report_sxw.rml_parse(cr, uid, rpt_obj._name,context) | 101 | rml_obj=report_sxw.rml_parse(cr, uid, rpt_obj._name,context) |
33 | 101 | header_xml = ''' | 102 | header_xml = ''' |
34 | @@ -104,7 +105,7 @@ | |||
35 | 104 | <company>%s</company> | 105 | <company>%s</company> |
36 | 105 | </header> | 106 | </header> |
37 | 106 | ''' % (str(rml_obj.formatLang(time.strftime("%Y-%m-%d"),date=True))+' ' + str(time.strftime("%H:%M")),pooler.get_pool(cr.dbname).get('res.users').browse(cr,uid,uid).company_id.name) | 107 | ''' % (str(rml_obj.formatLang(time.strftime("%Y-%m-%d"),date=True))+' ' + str(time.strftime("%H:%M")),pooler.get_pool(cr.dbname).get('res.users').browse(cr,uid,uid).company_id.name) |
39 | 107 | 108 | ||
40 | 108 | first_date = str(month) | 109 | first_date = str(month) |
41 | 109 | som = datetime.strptime(first_date, '%Y-%m-%d %H:%M:%S') | 110 | som = datetime.strptime(first_date, '%Y-%m-%d %H:%M:%S') |
42 | 110 | eom = som + timedelta(int(dy)-1) | 111 | eom = som + timedelta(int(dy)-1) |
43 | @@ -113,12 +114,12 @@ | |||
44 | 113 | cell=1 | 114 | cell=1 |
45 | 114 | date_xml.append('<days>') | 115 | date_xml.append('<days>') |
46 | 115 | if day_diff.days>=30: | 116 | if day_diff.days>=30: |
48 | 116 | date_xml += ['<dayy number="%d" name="%s" cell="%d"/>' % (x, som.replace(day=x).strftime('%a'),x-som.day+1) for x in range(som.day, lengthmonth(som.year, som.month)+1)] | 117 | date_xml += ['<dayy number="%d" name="%s" cell="%d"/>' % (x, _(som.replace(day=x).strftime('%a')),x-som.day+1) for x in range(som.day, lengthmonth(som.year, som.month)+1)] |
49 | 117 | else: | 118 | else: |
50 | 118 | if day_diff.days>=(lengthmonth(som.year, som.month)-som.day): | 119 | if day_diff.days>=(lengthmonth(som.year, som.month)-som.day): |
52 | 119 | date_xml += ['<dayy number="%d" name="%s" cell="%d"/>' % (x, som.replace(day=x).strftime('%a'),x-som.day+1) for x in range(som.day, lengthmonth(som.year, som.month)+1)] | 120 | date_xml += ['<dayy number="%d" name="%s" cell="%d"/>' % (x, _(som.replace(day=x).strftime('%a')),x-som.day+1) for x in range(som.day, lengthmonth(som.year, som.month)+1)] |
53 | 120 | else: | 121 | else: |
55 | 121 | date_xml += ['<dayy number="%d" name="%s" cell="%d"/>' % (x, som.replace(day=x).strftime('%a'),x-som.day+1) for x in range(som.day, eom.day+1)] | 122 | date_xml += ['<dayy number="%d" name="%s" cell="%d"/>' % (x, _(som.replace(day=x).strftime('%a')),x-som.day+1) for x in range(som.day, eom.day+1)] |
56 | 122 | cell=x-som.day+1 | 123 | cell=x-som.day+1 |
57 | 123 | day_diff1=day_diff.days-cell+1 | 124 | day_diff1=day_diff.days-cell+1 |
58 | 124 | width_dict={} | 125 | width_dict={} |
59 | @@ -129,12 +130,12 @@ | |||
60 | 129 | month=som.month | 130 | month=som.month |
61 | 130 | month_dict[j]=som.strftime('%B') | 131 | month_dict[j]=som.strftime('%B') |
62 | 131 | width_dict[j]=cell | 132 | width_dict[j]=cell |
64 | 132 | 133 | ||
65 | 133 | while day_diff1>0: | 134 | while day_diff1>0: |
66 | 134 | if month+i<=12: | 135 | if month+i<=12: |
67 | 135 | if day_diff1 > lengthmonth(year,i+month): # Not on 30 else you have problems when entering 01-01-2009 for example | 136 | if day_diff1 > lengthmonth(year,i+month): # Not on 30 else you have problems when entering 01-01-2009 for example |
68 | 136 | som1=datetime.date(year,month+i,1) | 137 | som1=datetime.date(year,month+i,1) |
70 | 137 | date_xml += ['<dayy number="%d" name="%s" cell="%d"/>' % (x, som1.replace(day=x).strftime('%a'),cell+x) for x in range(1, lengthmonth(year,i+month)+1)] | 138 | date_xml += ['<dayy number="%d" name="%s" cell="%d"/>' % (x, _(som1.replace(day=x).strftime('%a')),cell+x) for x in range(1, lengthmonth(year,i+month)+1)] |
71 | 138 | i=i+1 | 139 | i=i+1 |
72 | 139 | j=j+1 | 140 | j=j+1 |
73 | 140 | month_dict[j]=som1.strftime('%B') | 141 | month_dict[j]=som1.strftime('%B') |
74 | @@ -142,7 +143,7 @@ | |||
75 | 142 | width_dict[j]=x | 143 | width_dict[j]=x |
76 | 143 | else: | 144 | else: |
77 | 144 | som1=datetime.date(year,month+i,1) | 145 | som1=datetime.date(year,month+i,1) |
79 | 145 | date_xml += ['<dayy number="%d" name="%s" cell="%d"/>' % (x, som1.replace(day=x).strftime('%a'),cell+x) for x in range(1, eom.day+1)] | 146 | date_xml += ['<dayy number="%d" name="%s" cell="%d"/>' % (x, _(som1.replace(day=x).strftime('%a')),cell+x) for x in range(1, eom.day+1)] |
80 | 146 | i=i+1 | 147 | i=i+1 |
81 | 147 | j=j+1 | 148 | j=j+1 |
82 | 148 | month_dict[j]=som1.strftime('%B') | 149 | month_dict[j]=som1.strftime('%B') |
83 | @@ -156,7 +157,7 @@ | |||
84 | 156 | i=1 | 157 | i=1 |
85 | 157 | if day_diff1>=30: | 158 | if day_diff1>=30: |
86 | 158 | som1=datetime.date(years,i,1) | 159 | som1=datetime.date(years,i,1) |
88 | 159 | date_xml += ['<dayy number="%d" name="%s" cell="%d"/>' % (x, som1.replace(day=x).strftime('%a'),cell+x) for x in range(1, lengthmonth(years,i)+1)] | 160 | date_xml += ['<dayy number="%d" name="%s" cell="%d"/>' % (x, _(som1.replace(day=x).strftime('%a')),cell+x) for x in range(1, lengthmonth(years,i)+1)] |
89 | 160 | i=i+1 | 161 | i=i+1 |
90 | 161 | j=j+1 | 162 | j=j+1 |
91 | 162 | month_dict[j]=som1.strftime('%B') | 163 | month_dict[j]=som1.strftime('%B') |
92 | @@ -167,7 +168,7 @@ | |||
93 | 167 | i=i+1 | 168 | i=i+1 |
94 | 168 | j=j+1 | 169 | j=j+1 |
95 | 169 | month_dict[j]=som1.strftime('%B') | 170 | month_dict[j]=som1.strftime('%B') |
97 | 170 | date_xml += ['<dayy number="%d" name="%s" cell="%d"/>' % (x, som1.replace(day=x).strftime('%a'),cell+x) for x in range(1, eom.day+1)] | 171 | date_xml += ['<dayy number="%d" name="%s" cell="%d"/>' % (x, _(som1.replace(day=x).strftime('%a')),cell+x) for x in range(1, eom.day+1)] |
98 | 171 | cell=cell+x | 172 | cell=cell+x |
99 | 172 | width_dict[j]=x | 173 | width_dict[j]=x |
100 | 173 | day_diff1=day_diff1-x | 174 | day_diff1=day_diff1-x |
101 | @@ -176,10 +177,11 @@ | |||
102 | 176 | xml = '''<?xml version="1.0" encoding="UTF-8" ?> | 177 | xml = '''<?xml version="1.0" encoding="UTF-8" ?> |
103 | 177 | <report> | 178 | <report> |
104 | 178 | %s | 179 | %s |
105 | 180 | <title>%s</title> | ||
106 | 179 | %s | 181 | %s |
107 | 180 | %s | 182 | %s |
108 | 181 | </report> | 183 | </report> |
110 | 182 | ''' % (header_xml,'\n'.join(user_xml),date_xml) | 184 | ''' % (header_xml,_('Attendances By Month'),'\n'.join(user_xml),date_xml) |
111 | 183 | return xml | 185 | return xml |
112 | 184 | 186 | ||
113 | 185 | report_custom('report.hr.attendance.bymonth', 'hr.employee', '', 'addons/hr_attendance/report/bymonth.xsl') | 187 | report_custom('report.hr.attendance.bymonth', 'hr.employee', '', 'addons/hr_attendance/report/bymonth.xsl') |
114 | 186 | 188 | ||
115 | === modified file 'hr_attendance/report/bymonth.xsl' | |||
116 | --- hr_attendance/report/bymonth.xsl 2011-01-14 00:11:01 +0000 | |||
117 | +++ hr_attendance/report/bymonth.xsl 2011-09-16 05:20:29 +0000 | |||
118 | @@ -12,6 +12,7 @@ | |||
119 | 12 | 12 | ||
120 | 13 | 13 | ||
121 | 14 | <xsl:template name="stylesheet"> | 14 | <xsl:template name="stylesheet"> |
122 | 15 | <paraStyle name="title" fontName="Helvetica-Bold" fontSize="15.0" leading="17" alignment="CENTER" spaceBefore="12.0" spaceAfter="6.0"/> | ||
123 | 15 | <paraStyle name="terp_header_Centre" fontName="Helvetica-Bold" fontSize="14.0" leading="17" alignment="CENTER" spaceBefore="12.0" spaceAfter="6.0"/> | 16 | <paraStyle name="terp_header_Centre" fontName="Helvetica-Bold" fontSize="14.0" leading="17" alignment="CENTER" spaceBefore="12.0" spaceAfter="6.0"/> |
124 | 16 | <paraStyle name="name" fontName="Helvetica" textColor="green" fontSize="7"/> | 17 | <paraStyle name="name" fontName="Helvetica" textColor="green" fontSize="7"/> |
125 | 17 | <paraStyle name="normal" fontName="Helvetica" fontSize="6"/> | 18 | <paraStyle name="normal" fontName="Helvetica" fontSize="6"/> |
126 | @@ -29,7 +30,7 @@ | |||
127 | 29 | 30 | ||
128 | 30 | <xsl:template name="story"> | 31 | <xsl:template name="story"> |
129 | 31 | <spacer length="1cm" /> | 32 | <spacer length="1cm" /> |
131 | 32 | <para style="terp_header_Centre" t="1">Attendances By Month</para> | 33 | <xsl:apply-templates select="report/title"/> |
132 | 33 | <spacer length="1cm" /> | 34 | <spacer length="1cm" /> |
133 | 34 | <blockTable> | 35 | <blockTable> |
134 | 35 | <xsl:attribute name="style">week</xsl:attribute> | 36 | <xsl:attribute name="style">week</xsl:attribute> |
135 | @@ -53,7 +54,14 @@ | |||
136 | 53 | <xsl:apply-templates select="report/user"/> | 54 | <xsl:apply-templates select="report/user"/> |
137 | 54 | </blockTable> | 55 | </blockTable> |
138 | 55 | </xsl:template> | 56 | </xsl:template> |
140 | 56 | 57 | ||
141 | 58 | <xsl:template match="title"> | ||
142 | 59 | <para style="title"> | ||
143 | 60 | <xsl:value-of select="."/> | ||
144 | 61 | </para> | ||
145 | 62 | <spacer length="1cm"/> | ||
146 | 63 | </xsl:template> | ||
147 | 64 | |||
148 | 57 | <xsl:template match="user"> | 65 | <xsl:template match="user"> |
149 | 58 | <!-- <tr></tr>--> | 66 | <!-- <tr></tr>--> |
150 | 59 | <tr> | 67 | <tr> |
151 | 60 | 68 | ||
152 | === modified file 'hr_holidays/report/holidays_summary_report.py' | |||
153 | --- hr_holidays/report/holidays_summary_report.py 2011-01-17 18:02:22 +0000 | |||
154 | +++ hr_holidays/report/holidays_summary_report.py 2011-09-16 05:20:29 +0000 | |||
155 | @@ -30,6 +30,7 @@ | |||
156 | 30 | import time | 30 | import time |
157 | 31 | from report import report_sxw | 31 | from report import report_sxw |
158 | 32 | from tools import ustr | 32 | from tools import ustr |
159 | 33 | from tools.translate import _ | ||
160 | 33 | 34 | ||
161 | 34 | def lengthmonth(year, month): | 35 | def lengthmonth(year, month): |
162 | 35 | if month == 2 and ((year % 4 == 0) and ((year % 100 != 0) or (year % 400 == 0))): | 36 | if month == 2 and ((year % 4 == 0) and ((year % 100 != 0) or (year % 400 == 0))): |
163 | @@ -69,9 +70,9 @@ | |||
164 | 69 | for index in range(1,61): | 70 | for index in range(1,61): |
165 | 70 | display[index]=' ' | 71 | display[index]=' ' |
166 | 71 | count='' | 72 | count='' |
168 | 72 | 73 | ||
169 | 73 | data_xml=['<info id="%d" number="%d" val="%s" />' % (row_id,x,display[x]) for x in range(1,len(display)+1) ] | 74 | data_xml=['<info id="%d" number="%d" val="%s" />' % (row_id,x,display[x]) for x in range(1,len(display)+1) ] |
171 | 74 | 75 | ||
172 | 75 | # Computing the xml | 76 | # Computing the xml |
173 | 76 | xml = ''' | 77 | xml = ''' |
174 | 77 | %s | 78 | %s |
175 | @@ -120,18 +121,17 @@ | |||
176 | 120 | 121 | ||
177 | 121 | # date_xml=[] | 122 | # date_xml=[] |
178 | 122 | for l in range(0,len(legend)): | 123 | for l in range(0,len(legend)): |
181 | 123 | date_xml += ['<legend row="%d" id="%d" name="%s" color="%s" />' % (l+1,legend[l][0],legend[l][1],legend[l][2])] | 124 | date_xml += ['<legend row="%d" id="%d" name="%s" color="%s" />' % (l+1,legend[l][0],_(legend[l][1]),legend[l][2])] |
180 | 124 | |||
182 | 125 | date_xml += ['<date month="%s" year="%d" />' % (som.strftime('%B'), som.year),'<days>'] | 125 | date_xml += ['<date month="%s" year="%d" />' % (som.strftime('%B'), som.year),'<days>'] |
183 | 126 | 126 | ||
184 | 127 | cell=1 | 127 | cell=1 |
185 | 128 | if day_diff.days>=30: | 128 | if day_diff.days>=30: |
187 | 129 | date_xml += ['<dayy number="%d" name="%s" cell="%d"/>' % (x, som.replace(day=x).strftime('%a'),x-som.day+1) for x in range(som.day, lengthmonth(som.year, som.month)+1)] | 129 | date_xml += ['<dayy number="%d" name="%s" cell="%d"/>' % (x, _(som.replace(day=x).strftime('%a')),x-som.day+1) for x in range(som.day, lengthmonth(som.year, som.month)+1)] |
188 | 130 | else: | 130 | else: |
189 | 131 | if day_diff.days>=(lengthmonth(som.year, som.month)-som.day): | 131 | if day_diff.days>=(lengthmonth(som.year, som.month)-som.day): |
191 | 132 | date_xml += ['<dayy number="%d" name="%s" cell="%d"/>' % (x, som.replace(day=x).strftime('%a'),x-som.day+1) for x in range(som.day, lengthmonth(som.year, som.month)+1)] | 132 | date_xml += ['<dayy number="%d" name="%s" cell="%d"/>' % (x, _(som.replace(day=x).strftime('%a')),x-som.day+1) for x in range(som.day, lengthmonth(som.year, som.month)+1)] |
192 | 133 | else: | 133 | else: |
194 | 134 | date_xml += ['<dayy number="%d" name="%s" cell="%d"/>' % (x, som.replace(day=x).strftime('%a'),x-som.day+1) for x in range(som.day, eom.day+1)] | 134 | date_xml += ['<dayy number="%d" name="%s" cell="%d"/>' % (x, _(som.replace(day=x).strftime('%a')),x-som.day+1) for x in range(som.day, eom.day+1)] |
195 | 135 | 135 | ||
196 | 136 | cell=x-som.day+1 | 136 | cell=x-som.day+1 |
197 | 137 | day_diff1=day_diff.days-cell+1 | 137 | day_diff1=day_diff.days-cell+1 |
198 | @@ -150,7 +150,7 @@ | |||
199 | 150 | if month+i<=12: | 150 | if month+i<=12: |
200 | 151 | if day_diff1 > lengthmonth(year,i+month): # Not on 30 else you have problems when entering 01-01-2009 for example | 151 | if day_diff1 > lengthmonth(year,i+month): # Not on 30 else you have problems when entering 01-01-2009 for example |
201 | 152 | som1=datetime.date(year,month+i,1) | 152 | som1=datetime.date(year,month+i,1) |
203 | 153 | date_xml += ['<dayy number="%d" name="%s" cell="%d"/>' % (x, som1.replace(day=x).strftime('%a'),cell+x) for x in range(1, lengthmonth(year,i+month)+1)] | 153 | date_xml += ['<dayy number="%d" name="%s" cell="%d"/>' % (x, _(som1.replace(day=x).strftime('%a')),cell+x) for x in range(1, lengthmonth(year,i+month)+1)] |
204 | 154 | i=i+1 | 154 | i=i+1 |
205 | 155 | j=j+1 | 155 | j=j+1 |
206 | 156 | month_dict[j]=som1.strftime('%B') | 156 | month_dict[j]=som1.strftime('%B') |
207 | @@ -159,7 +159,7 @@ | |||
208 | 159 | 159 | ||
209 | 160 | else: | 160 | else: |
210 | 161 | som1=datetime.date(year,month+i,1) | 161 | som1=datetime.date(year,month+i,1) |
212 | 162 | date_xml += ['<dayy number="%d" name="%s" cell="%d"/>' % (x, som1.replace(day=x).strftime('%a'),cell+x) for x in range(1, eom.day+1)] | 162 | date_xml += ['<dayy number="%d" name="%s" cell="%d"/>' % (x, _(som1.replace(day=x).strftime('%a')),cell+x) for x in range(1, eom.day+1)] |
213 | 163 | i=i+1 | 163 | i=i+1 |
214 | 164 | j=j+1 | 164 | j=j+1 |
215 | 165 | month_dict[j]=som1.strftime('%B') | 165 | month_dict[j]=som1.strftime('%B') |
216 | @@ -174,7 +174,7 @@ | |||
217 | 174 | i=1 | 174 | i=1 |
218 | 175 | if day_diff1>=30: | 175 | if day_diff1>=30: |
219 | 176 | som1=datetime.date(years,i,1) | 176 | som1=datetime.date(years,i,1) |
221 | 177 | date_xml += ['<dayy number="%d" name="%s" cell="%d"/>' % (x, som1.replace(day=x).strftime('%a'),cell+x) for x in range(1, lengthmonth(years,i)+1)] | 177 | date_xml += ['<dayy number="%d" name="%s" cell="%d"/>' % (x, _(som1.replace(day=x).strftime('%a')),cell+x) for x in range(1, lengthmonth(years,i)+1)] |
222 | 178 | i=i+1 | 178 | i=i+1 |
223 | 179 | j=j+1 | 179 | j=j+1 |
224 | 180 | month_dict[j]=som1.strftime('%B') | 180 | month_dict[j]=som1.strftime('%B') |
225 | @@ -186,7 +186,7 @@ | |||
226 | 186 | i=i+1 | 186 | i=i+1 |
227 | 187 | j=j+1 | 187 | j=j+1 |
228 | 188 | month_dict[j]=som1.strftime('%B') | 188 | month_dict[j]=som1.strftime('%B') |
230 | 189 | date_xml += ['<dayy number="%d" name="%s" cell="%d"/>' % (x, som1.replace(day=x).strftime('%a'),cell+x) for x in range(1, eom.day+1)] | 189 | date_xml += ['<dayy number="%d" name="%s" cell="%d"/>' % (x, _(som1.replace(day=x).strftime('%a')),cell+x) for x in range(1, eom.day+1)] |
231 | 190 | cell=cell+x | 190 | cell=cell+x |
232 | 191 | width_dict[j]=x | 191 | width_dict[j]=x |
233 | 192 | 192 | ||
234 | @@ -200,16 +200,16 @@ | |||
235 | 200 | st+=',' + str(0.4 *width_dict[m])+'cm' | 200 | st+=',' + str(0.4 *width_dict[m])+'cm' |
236 | 201 | st+=',0.4cm</cols_months>\n' | 201 | st+=',0.4cm</cols_months>\n' |
237 | 202 | 202 | ||
239 | 203 | months_xml =['<months number="%d" name="%s" />' % (x,month_dict[x]) for x in range(1,len(month_dict)+1) ] | 203 | months_xml =['<months number="%d" name="%s"/>' % (x, _(month_dict[x])) for x in range(1,len(month_dict)+1) ] |
240 | 204 | months_xml.append(st) | 204 | months_xml.append(st) |
242 | 205 | 205 | ||
243 | 206 | emp_xml='' | 206 | emp_xml='' |
244 | 207 | row_id=1 | 207 | row_id=1 |
246 | 208 | 208 | ||
247 | 209 | if data['model']=='hr.employee': | 209 | if data['model']=='hr.employee': |
248 | 210 | for id in data['form']['emp']: | 210 | for id in data['form']['emp']: |
249 | 211 | items = obj_emp.read(cr, uid, id, ['id','name']) | 211 | items = obj_emp.read(cr, uid, id, ['id','name']) |
251 | 212 | 212 | ||
252 | 213 | emp_xml += emp_create_xml(self, cr, uid, 0, holiday_type, row_id, items['id'], items['name'], som, eom) | 213 | emp_xml += emp_create_xml(self, cr, uid, 0, holiday_type, row_id, items['id'], items['name'], som, eom) |
253 | 214 | row_id = row_id +1 | 214 | row_id = row_id +1 |
254 | 215 | 215 | ||
255 | @@ -229,7 +229,7 @@ | |||
256 | 229 | dept_done=1 | 229 | dept_done=1 |
257 | 230 | emp_xml += emp_create_xml(self, cr, uid, 0, holiday_type, row_id, item['id'], item['name'], som, eom) | 230 | emp_xml += emp_create_xml(self, cr, uid, 0, holiday_type, row_id, item['id'], item['name'], som, eom) |
258 | 231 | row_id = row_id +1 | 231 | row_id = row_id +1 |
260 | 232 | 232 | ||
261 | 233 | header_xml = ''' | 233 | header_xml = ''' |
262 | 234 | <header> | 234 | <header> |
263 | 235 | <date>%s</date> | 235 | <date>%s</date> |
monthly attendance report => not fully translated still "Attendances By Month" (you have to make this string dynamic from py file only and remove it from xsl)
same for holidays report.
And yes you have to improve attendance by week report and other remaining reports too for translation.
Thanks,
mra