Merge lp:~gs.clearcorp/openerp-costa-rica/7.0_l10n_cr_ins_csv_generator into lp:openerp-costa-rica
- 7.0_l10n_cr_ins_csv_generator
- Merge into 7.0
Proposed by
Glen Sojo
Status: | Merged |
---|---|
Merged at revision: | 250 |
Proposed branch: | lp:~gs.clearcorp/openerp-costa-rica/7.0_l10n_cr_ins_csv_generator |
Merge into: | lp:openerp-costa-rica |
Diff against target: |
708 lines (+637/-0) 11 files modified
l10n_cr_hr_ins_csv_generator/__init__.py (+24/-0) l10n_cr_hr_ins_csv_generator/__openerp__.py (+52/-0) l10n_cr_hr_ins_csv_generator/i18n/es_CR.po (+213/-0) l10n_cr_hr_ins_csv_generator/l10n_cr_hr_ins_csv_generator.py (+55/-0) l10n_cr_hr_ins_csv_generator/tools/__init__.py (+23/-0) l10n_cr_hr_ins_csv_generator/tools/custom_encoder.py (+87/-0) l10n_cr_hr_ins_csv_generator/view/l10n_cr_hr_ins_csv_generator_view.xml (+43/-0) l10n_cr_hr_ins_csv_generator/wizard/__init__.py (+23/-0) l10n_cr_hr_ins_csv_generator/wizard/l10n_cr_hr_ins_csv_generator_wizard.py (+65/-0) l10n_cr_hr_ins_csv_generator/wizard/l10n_cr_hr_ins_csv_generator_wizard_menu.xml (+11/-0) l10n_cr_hr_ins_csv_generator/wizard/l10n_cr_hr_ins_csv_generator_wizard_view.xml (+41/-0) |
To merge this branch: | bzr merge lp:~gs.clearcorp/openerp-costa-rica/7.0_l10n_cr_ins_csv_generator |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
ClearCorp drivers | Pending | ||
Review via email: mp+191276@code.launchpad.net |
Commit message
Description of the change
Module l10n_cr_
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 | === added directory 'l10n_cr_hr_ins_csv_generator' | |||
2 | === added file 'l10n_cr_hr_ins_csv_generator/__init__.py' | |||
3 | --- l10n_cr_hr_ins_csv_generator/__init__.py 1970-01-01 00:00:00 +0000 | |||
4 | +++ l10n_cr_hr_ins_csv_generator/__init__.py 2013-10-15 19:06:07 +0000 | |||
5 | @@ -0,0 +1,24 @@ | |||
6 | 1 | # -*- coding: utf-8 -*- | ||
7 | 2 | ############################################################################## | ||
8 | 3 | # | ||
9 | 4 | # OpenERP, Open Source Management Solution | ||
10 | 5 | # Addons modules by CLEARCORP S.A. | ||
11 | 6 | # Copyright (C) 2009-TODAY CLEARCORP S.A. (<http://clearcorp.co.cr>). | ||
12 | 7 | # | ||
13 | 8 | # This program is free software: you can redistribute it and/or modify | ||
14 | 9 | # it under the terms of the GNU Affero General Public License as | ||
15 | 10 | # published by the Free Software Foundation, either version 3 of the | ||
16 | 11 | # License, or (at your option) any later version. | ||
17 | 12 | # | ||
18 | 13 | # This program is distributed in the hope that it will be useful, | ||
19 | 14 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
20 | 15 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
21 | 16 | # GNU Affero General Public License for more details. | ||
22 | 17 | # | ||
23 | 18 | # You should have received a copy of the GNU Affero General Public License | ||
24 | 19 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
25 | 20 | # | ||
26 | 21 | ############################################################################## | ||
27 | 22 | |||
28 | 23 | import l10n_cr_hr_ins_csv_generator | ||
29 | 24 | import wizard | ||
30 | 0 | \ No newline at end of file | 25 | \ No newline at end of file |
31 | 1 | 26 | ||
32 | === added file 'l10n_cr_hr_ins_csv_generator/__openerp__.py' | |||
33 | --- l10n_cr_hr_ins_csv_generator/__openerp__.py 1970-01-01 00:00:00 +0000 | |||
34 | +++ l10n_cr_hr_ins_csv_generator/__openerp__.py 2013-10-15 19:06:07 +0000 | |||
35 | @@ -0,0 +1,52 @@ | |||
36 | 1 | # -*- coding: utf-8 -*- | ||
37 | 2 | ############################################################################## | ||
38 | 3 | # | ||
39 | 4 | # OpenERP, Open Source Management Solution | ||
40 | 5 | # Addons modules by CLEARCORP S.A. | ||
41 | 6 | # Copyright (C) 2009-TODAY CLEARCORP S.A. (<http://clearcorp.co.cr>). | ||
42 | 7 | # | ||
43 | 8 | # This program is free software: you can redistribute it and/or modify | ||
44 | 9 | # it under the terms of the GNU Affero General Public License as | ||
45 | 10 | # published by the Free Software Foundation, either version 3 of the | ||
46 | 11 | # License, or (at your option) any later version. | ||
47 | 12 | # | ||
48 | 13 | # This program is distributed in the hope that it will be useful, | ||
49 | 14 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
50 | 15 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
51 | 16 | # GNU Affero General Public License for more details. | ||
52 | 17 | # | ||
53 | 18 | # You should have received a copy of the GNU Affero General Public License | ||
54 | 19 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
55 | 20 | # | ||
56 | 21 | ############################################################################## | ||
57 | 22 | |||
58 | 23 | { | ||
59 | 24 | "name" : 'Costa Rica INS csv Generator', | ||
60 | 25 | "version" : '1.0', | ||
61 | 26 | "author" : 'CLEARCORP S.A.', | ||
62 | 27 | 'complexity': 'normal', | ||
63 | 28 | "description": """ | ||
64 | 29 | Module build for the generation of custom files to upload information to the INS systems | ||
65 | 30 | """, | ||
66 | 31 | "category": 'Human Resources', | ||
67 | 32 | "sequence": 4, | ||
68 | 33 | "website" : "http://clearcorp.co.cr", | ||
69 | 34 | "images" : [], | ||
70 | 35 | "icon" : False, | ||
71 | 36 | "depends" : [ | ||
72 | 37 | 'hr_payroll', | ||
73 | 38 | ], | ||
74 | 39 | "data" : [ | ||
75 | 40 | 'wizard/l10n_cr_hr_ins_csv_generator_wizard_view.xml', | ||
76 | 41 | 'wizard/l10n_cr_hr_ins_csv_generator_wizard_menu.xml', | ||
77 | 42 | 'view/l10n_cr_hr_ins_csv_generator_view.xml', | ||
78 | 43 | ], | ||
79 | 44 | "init_xml" : [], | ||
80 | 45 | "demo_xml" : [], | ||
81 | 46 | "update_xml" : [], | ||
82 | 47 | "test" : [], | ||
83 | 48 | "auto_install": False, | ||
84 | 49 | "application": False, | ||
85 | 50 | "installable": True, | ||
86 | 51 | 'license': 'AGPL-3', | ||
87 | 52 | } | ||
88 | 0 | \ No newline at end of file | 53 | \ No newline at end of file |
89 | 1 | 54 | ||
90 | === added directory 'l10n_cr_hr_ins_csv_generator/i18n' | |||
91 | === added symlink 'l10n_cr_hr_ins_csv_generator/i18n/es.po' | |||
92 | === target is u'es_CR.po' | |||
93 | === added file 'l10n_cr_hr_ins_csv_generator/i18n/es_CR.po' | |||
94 | --- l10n_cr_hr_ins_csv_generator/i18n/es_CR.po 1970-01-01 00:00:00 +0000 | |||
95 | +++ l10n_cr_hr_ins_csv_generator/i18n/es_CR.po 2013-10-15 19:06:07 +0000 | |||
96 | @@ -0,0 +1,213 @@ | |||
97 | 1 | # Translation of OpenERP Server. | ||
98 | 2 | # This file contains the translation of the following modules: | ||
99 | 3 | # * ins_csv_generator | ||
100 | 4 | # | ||
101 | 5 | msgid "" | ||
102 | 6 | msgstr "" | ||
103 | 7 | "Project-Id-Version: OpenERP Server 7.0\n" | ||
104 | 8 | "Report-Msgid-Bugs-To: \n" | ||
105 | 9 | "POT-Creation-Date: 2013-10-14 18:12+0000\n" | ||
106 | 10 | "PO-Revision-Date: 2013-10-14 18:12+0000\n" | ||
107 | 11 | "Last-Translator: <>\n" | ||
108 | 12 | "Language-Team: \n" | ||
109 | 13 | "MIME-Version: 1.0\n" | ||
110 | 14 | "Content-Type: text/plain; charset=UTF-8\n" | ||
111 | 15 | "Content-Transfer-Encoding: \n" | ||
112 | 16 | "Plural-Forms: \n" | ||
113 | 17 | |||
114 | 18 | #. module: ins_csv_generator | ||
115 | 19 | #: field:hr.employee,ins_working_day:0 | ||
116 | 20 | msgid "Working Day" | ||
117 | 21 | msgstr "Jornada Laboral" | ||
118 | 22 | |||
119 | 23 | #. module: ins_csv_generator | ||
120 | 24 | #: view:hr.ins.csv.generator.generator.wizard:0 | ||
121 | 25 | msgid "Encoded text file:" | ||
122 | 26 | msgstr "Archivo de texto codificado" | ||
123 | 27 | |||
124 | 28 | #. module: ins_csv_generator | ||
125 | 29 | #: field:hr.employee,ins_id_type:0 | ||
126 | 30 | msgid "Id Type" | ||
127 | 31 | msgstr "Tipo de Indentificación" | ||
128 | 32 | |||
129 | 33 | #. module: ins_csv_generator | ||
130 | 34 | #: model:ir.ui.menu,name:ins_csv_generator.menu_generator | ||
131 | 35 | msgid "Generate INS File" | ||
132 | 36 | msgstr "Generar Archivo INS" | ||
133 | 37 | |||
134 | 38 | #. module: ins_csv_generator | ||
135 | 39 | #: selection:hr.employee,ins_id_type:0 | ||
136 | 40 | msgid "Cédula Residencia" | ||
137 | 41 | msgstr "Cédula Residencia" | ||
138 | 42 | |||
139 | 43 | #. module: ins_csv_generator | ||
140 | 44 | #: view:hr.ins.csv.generator.generator.wizard:0 | ||
141 | 45 | msgid "Wizard" | ||
142 | 46 | msgstr "Asistente" | ||
143 | 47 | |||
144 | 48 | #. module: ins_csv_generator | ||
145 | 49 | #: selection:hr.employee,ins_working_day:0 | ||
146 | 50 | msgid "Tiempo completo" | ||
147 | 51 | msgstr "Tiempo Completo" | ||
148 | 52 | |||
149 | 53 | #. module: ins_csv_generator | ||
150 | 54 | #: selection:hr.employee,ins_id_type:0 | ||
151 | 55 | msgid "Cédula Nacional" | ||
152 | 56 | msgstr "Cédula Nacional" | ||
153 | 57 | |||
154 | 58 | #. module: ins_csv_generator | ||
155 | 59 | #: model:ir.model,name:ins_csv_generator.model_hr_employee | ||
156 | 60 | msgid "Employee" | ||
157 | 61 | msgstr "Empleado" | ||
158 | 62 | |||
159 | 63 | #. module: ins_csv_generator | ||
160 | 64 | #: view:hr.employee:0 | ||
161 | 65 | msgid "Identification Information" | ||
162 | 66 | msgstr "Información de Identificación" | ||
163 | 67 | |||
164 | 68 | #. module: ins_csv_generator | ||
165 | 69 | #: view:hr.ins.csv.generator.generator.wizard:0 | ||
166 | 70 | msgid "Generate csv File" | ||
167 | 71 | msgstr "Generar Archivos csv" | ||
168 | 72 | |||
169 | 73 | #. module: ins_csv_generator | ||
170 | 74 | #: view:hr.employee:0 | ||
171 | 75 | msgid "Working Information" | ||
172 | 76 | msgstr "Información Laboral" | ||
173 | 77 | |||
174 | 78 | #. module: ins_csv_generator | ||
175 | 79 | #: field:hr.employee,ins_paid_days:0 | ||
176 | 80 | msgid "Paid Days" | ||
177 | 81 | msgstr "Días Pagados" | ||
178 | 82 | |||
179 | 83 | #. module: ins_csv_generator | ||
180 | 84 | #: field:hr.employee,ins_last_name1:0 | ||
181 | 85 | msgid "First Last Name" | ||
182 | 86 | msgstr "Primer Apellido" | ||
183 | 87 | |||
184 | 88 | #. module: ins_csv_generator | ||
185 | 89 | #: field:hr.ins.csv.generator.generator.wizard,state:0 | ||
186 | 90 | msgid "State" | ||
187 | 91 | msgstr "Estado" | ||
188 | 92 | |||
189 | 93 | #. module: ins_csv_generator | ||
190 | 94 | #: selection:hr.employee,ins_working_day:0 | ||
191 | 95 | msgid "Medio tiempo" | ||
192 | 96 | msgstr "Medio Tiempo" | ||
193 | 97 | |||
194 | 98 | #. module: ins_csv_generator | ||
195 | 99 | #: selection:hr.ins.csv.generator.generator.wizard,state:0 | ||
196 | 100 | msgid "get" | ||
197 | 101 | msgstr "Obtener" | ||
198 | 102 | |||
199 | 103 | #. module: ins_csv_generator | ||
200 | 104 | #: view:hr.ins.csv.generator.generator.wizard:0 | ||
201 | 105 | msgid "Fill the required fields" | ||
202 | 106 | msgstr "Llenar los campos requeridos" | ||
203 | 107 | |||
204 | 108 | #. module: ins_csv_generator | ||
205 | 109 | #: view:hr.employee:0 | ||
206 | 110 | msgid "Others" | ||
207 | 111 | msgstr "Others" | ||
208 | 112 | |||
209 | 113 | #. module: ins_csv_generator | ||
210 | 114 | #: field:hr.employee,ins_job_code:0 | ||
211 | 115 | msgid "Job Code" | ||
212 | 116 | msgstr "Código de Trabajo" | ||
213 | 117 | |||
214 | 118 | #. module: ins_csv_generator | ||
215 | 119 | #: field:hr.employee,ins_last_name2:0 | ||
216 | 120 | msgid "Second Last Name" | ||
217 | 121 | msgstr "Segundo Apellido" | ||
218 | 122 | |||
219 | 123 | #. module: ins_csv_generator | ||
220 | 124 | #: selection:hr.employee,ins_working_day:0 | ||
221 | 125 | msgid "Ocasional" | ||
222 | 126 | msgstr "Ocasional" | ||
223 | 127 | |||
224 | 128 | #. module: ins_csv_generator | ||
225 | 129 | #: view:hr.ins.csv.generator.generator.wizard:0 | ||
226 | 130 | msgid "Are you sure you want to generate the csv file?" | ||
227 | 131 | msgstr "¿Estás seguro que deseas generar el archivo csv?" | ||
228 | 132 | |||
229 | 133 | #. module: ins_csv_generator | ||
230 | 134 | #: field:hr.employee,ins_name:0 | ||
231 | 135 | #: field:hr.ins.csv.generator.generator.wizard,name:0 | ||
232 | 136 | msgid "Name" | ||
233 | 137 | msgstr "Nombre" | ||
234 | 138 | |||
235 | 139 | #. module: ins_csv_generator | ||
236 | 140 | #: field:hr.employee,ins_paid_hours:0 | ||
237 | 141 | msgid "Paid Hours" | ||
238 | 142 | msgstr "Horas Pagadas" | ||
239 | 143 | |||
240 | 144 | #. module: ins_csv_generator | ||
241 | 145 | #: selection:hr.employee,ins_working_day:0 | ||
242 | 146 | msgid "Por jornales" | ||
243 | 147 | msgstr "Por Jornales" | ||
244 | 148 | |||
245 | 149 | #. module: ins_csv_generator | ||
246 | 150 | #: view:hr.employee:0 | ||
247 | 151 | msgid "Full Name Configuration" | ||
248 | 152 | msgstr "Configuración de Nombre Completo" | ||
249 | 153 | |||
250 | 154 | #. module: ins_csv_generator | ||
251 | 155 | #: selection:hr.employee,ins_id_type:0 | ||
252 | 156 | msgid "Permiso Trabajo" | ||
253 | 157 | msgstr "Permiso de Trabajo" | ||
254 | 158 | |||
255 | 159 | #. module: ins_csv_generator | ||
256 | 160 | #: selection:hr.ins.csv.generator.generator.wizard,state:0 | ||
257 | 161 | msgid "generate" | ||
258 | 162 | msgstr "Generar" | ||
259 | 163 | |||
260 | 164 | #. module: ins_csv_generator | ||
261 | 165 | #: selection:hr.employee,ins_id_type:0 | ||
262 | 166 | msgid "Número Pasaporte" | ||
263 | 167 | msgstr "Número de Pasaporte" | ||
264 | 168 | |||
265 | 169 | #. module: ins_csv_generator | ||
266 | 170 | #: view:hr.employee:0 | ||
267 | 171 | msgid "INS Information" | ||
268 | 172 | msgstr "Información INS" | ||
269 | 173 | |||
270 | 174 | #. module: ins_csv_generator | ||
271 | 175 | #: field:hr.ins.csv.generator.generator.wizard,date_end:0 | ||
272 | 176 | msgid "Date End" | ||
273 | 177 | msgstr "Fecha Final" | ||
274 | 178 | |||
275 | 179 | #. module: ins_csv_generator | ||
276 | 180 | #: model:ir.actions.act_window,name:ins_csv_generator.action_generator_wizard_create | ||
277 | 181 | msgid "INS csv Generator" | ||
278 | 182 | msgstr "Generador de csv INS" | ||
279 | 183 | |||
280 | 184 | #. module: ins_csv_generator | ||
281 | 185 | #: field:hr.employee,ins_exportable:0 | ||
282 | 186 | msgid "Export?" | ||
283 | 187 | msgstr "Exportar?" | ||
284 | 188 | |||
285 | 189 | #. module: ins_csv_generator | ||
286 | 190 | #: field:hr.ins.csv.generator.generator.wizard,data:0 | ||
287 | 191 | msgid "File" | ||
288 | 192 | msgstr "Archivo" | ||
289 | 193 | |||
290 | 194 | #. module: ins_csv_generator | ||
291 | 195 | #: view:hr.ins.csv.generator.generator.wizard:0 | ||
292 | 196 | msgid "Cancel" | ||
293 | 197 | msgstr "Cancelar" | ||
294 | 198 | |||
295 | 199 | #. module: ins_csv_generator | ||
296 | 200 | #: selection:hr.employee,ins_id_type:0 | ||
297 | 201 | msgid "Sin Documentos" | ||
298 | 202 | msgstr "Sin Documentos" | ||
299 | 203 | |||
300 | 204 | #. module: ins_csv_generator | ||
301 | 205 | #: field:hr.ins.csv.generator.generator.wizard,date_start:0 | ||
302 | 206 | msgid "Date Start" | ||
303 | 207 | msgstr "Fecha Inicial" | ||
304 | 208 | |||
305 | 209 | #. module: ins_csv_generator | ||
306 | 210 | #: field:hr.ins.csv.generator.generator.wizard,salary_rule_id:0 | ||
307 | 211 | msgid "Salary Rule" | ||
308 | 212 | msgstr "Regla de Salario" | ||
309 | 213 | |||
310 | 0 | 214 | ||
311 | === added file 'l10n_cr_hr_ins_csv_generator/l10n_cr_hr_ins_csv_generator.py' | |||
312 | --- l10n_cr_hr_ins_csv_generator/l10n_cr_hr_ins_csv_generator.py 1970-01-01 00:00:00 +0000 | |||
313 | +++ l10n_cr_hr_ins_csv_generator/l10n_cr_hr_ins_csv_generator.py 2013-10-15 19:06:07 +0000 | |||
314 | @@ -0,0 +1,55 @@ | |||
315 | 1 | # -*- coding: utf-8 -*- | ||
316 | 2 | ############################################################################## | ||
317 | 3 | # | ||
318 | 4 | # OpenERP, Open Source Management Solution | ||
319 | 5 | # Addons modules by CLEARCORP S.A. | ||
320 | 6 | # Copyright (C) 2009-TODAY CLEARCORP S.A. (<http://clearcorp.co.cr>). | ||
321 | 7 | # | ||
322 | 8 | # This program is free software: you can redistribute it and/or modify | ||
323 | 9 | # it under the terms of the GNU Affero General Public License as | ||
324 | 10 | # published by the Free Software Foundation, either version 3 of the | ||
325 | 11 | # License, or (at your option) any later version. | ||
326 | 12 | # | ||
327 | 13 | # This program is distributed in the hope that it will be useful, | ||
328 | 14 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
329 | 15 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
330 | 16 | # GNU Affero General Public License for more details. | ||
331 | 17 | # | ||
332 | 18 | # You should have received a copy of the GNU Affero General Public License | ||
333 | 19 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
334 | 20 | # | ||
335 | 21 | ############################################################################## | ||
336 | 22 | |||
337 | 23 | from openerp.osv import osv, fields | ||
338 | 24 | |||
339 | 25 | class hrEmployee(osv.Model): | ||
340 | 26 | _inherit = 'hr.employee' | ||
341 | 27 | |||
342 | 28 | _defaults = { | ||
343 | 29 | 'ins_exportable': True, | ||
344 | 30 | 'ins_working_day': 'Tiempo completo', | ||
345 | 31 | 'ins_paid_days': 30, | ||
346 | 32 | 'ins_paid_hours': 240, | ||
347 | 33 | } | ||
348 | 34 | |||
349 | 35 | _columns = { | ||
350 | 36 | 'ins_exportable': fields.boolean('Export?'), | ||
351 | 37 | 'ins_id_type': fields.selection([ | ||
352 | 38 | ('CN','Cédula Nacional'), | ||
353 | 39 | ('CR','Cédula Residencia'), | ||
354 | 40 | ('NP', 'Número Pasaporte'), | ||
355 | 41 | ('PT','Permiso Trabajo'), | ||
356 | 42 | ('SD','Sin Documentos'), | ||
357 | 43 | ], 'Id Type'), | ||
358 | 44 | 'ins_name': fields.char('Name', size=128), | ||
359 | 45 | 'ins_last_name1': fields.char('First Last Name', size=128), | ||
360 | 46 | 'ins_last_name2': fields.char('Second Last Name', size=128), | ||
361 | 47 | 'ins_working_day': fields.selection([('Tiempo completo','Tiempo completo'), | ||
362 | 48 | ('Medio tiempo','Medio tiempo'), | ||
363 | 49 | ('Ocasional','Ocasional'), | ||
364 | 50 | ('Por jornales','Por jornales'), | ||
365 | 51 | ],'Working Day'), | ||
366 | 52 | 'ins_paid_days': fields.integer('Paid Days'), | ||
367 | 53 | 'ins_paid_hours': fields.integer('Paid Hours'), | ||
368 | 54 | 'ins_job_code': fields.char('Job Code'), | ||
369 | 55 | } | ||
370 | 0 | \ No newline at end of file | 56 | \ No newline at end of file |
371 | 1 | 57 | ||
372 | === added directory 'l10n_cr_hr_ins_csv_generator/tools' | |||
373 | === added file 'l10n_cr_hr_ins_csv_generator/tools/__init__.py' | |||
374 | --- l10n_cr_hr_ins_csv_generator/tools/__init__.py 1970-01-01 00:00:00 +0000 | |||
375 | +++ l10n_cr_hr_ins_csv_generator/tools/__init__.py 2013-10-15 19:06:07 +0000 | |||
376 | @@ -0,0 +1,23 @@ | |||
377 | 1 | # -*- coding: utf-8 -*- | ||
378 | 2 | ############################################################################## | ||
379 | 3 | # | ||
380 | 4 | # OpenERP, Open Source Management Solution | ||
381 | 5 | # Addons modules by CLEARCORP S.A. | ||
382 | 6 | # Copyright (C) 2009-TODAY CLEARCORP S.A. (<http://clearcorp.co.cr>). | ||
383 | 7 | # | ||
384 | 8 | # This program is free software: you can redistribute it and/or modify | ||
385 | 9 | # it under the terms of the GNU Affero General Public License as | ||
386 | 10 | # published by the Free Software Foundation, either version 3 of the | ||
387 | 11 | # License, or (at your option) any later version. | ||
388 | 12 | # | ||
389 | 13 | # This program is distributed in the hope that it will be useful, | ||
390 | 14 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
391 | 15 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
392 | 16 | # GNU Affero General Public License for more details. | ||
393 | 17 | # | ||
394 | 18 | # You should have received a copy of the GNU Affero General Public License | ||
395 | 19 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
396 | 20 | # | ||
397 | 21 | ############################################################################## | ||
398 | 22 | |||
399 | 23 | import custom_encoder | ||
400 | 0 | \ No newline at end of file | 24 | \ No newline at end of file |
401 | 1 | 25 | ||
402 | === added file 'l10n_cr_hr_ins_csv_generator/tools/custom_encoder.py' | |||
403 | --- l10n_cr_hr_ins_csv_generator/tools/custom_encoder.py 1970-01-01 00:00:00 +0000 | |||
404 | +++ l10n_cr_hr_ins_csv_generator/tools/custom_encoder.py 2013-10-15 19:06:07 +0000 | |||
405 | @@ -0,0 +1,87 @@ | |||
406 | 1 | # -*- coding: utf-8 -*- | ||
407 | 2 | ############################################################################## | ||
408 | 3 | # | ||
409 | 4 | # OpenERP, Open Source Management Solution | ||
410 | 5 | # Addons modules by CLEARCORP S.A. | ||
411 | 6 | # Copyright (C) 2009-TODAY CLEARCORP S.A. (<http://clearcorp.co.cr>). | ||
412 | 7 | # | ||
413 | 8 | # This program is free software: you can redistribute it and/or modify | ||
414 | 9 | # it under the terms of the GNU Affero General Public License as | ||
415 | 10 | # published by the Free Software Foundation, either version 3 of the | ||
416 | 11 | # License, or (at your option) any later version. | ||
417 | 12 | # | ||
418 | 13 | # This program is distributed in the hope that it will be useful, | ||
419 | 14 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
420 | 15 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
421 | 16 | # GNU Affero General Public License for more details. | ||
422 | 17 | # | ||
423 | 18 | # You should have received a copy of the GNU Affero General Public License | ||
424 | 19 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
425 | 20 | # | ||
426 | 21 | ############################################################################## | ||
427 | 22 | |||
428 | 23 | import base64 | ||
429 | 24 | import cStringIO | ||
430 | 25 | import csv | ||
431 | 26 | |||
432 | 27 | import openerp.pooler as pooler | ||
433 | 28 | |||
434 | 29 | def encodeInsCsv(cr, uid, date_start, date_end, code, context=None): | ||
435 | 30 | def _information_export(buffer, cr, uid, code, context): | ||
436 | 31 | def _get_user_wage(cr, uid, pool, date_start, date_end, code, id, context): | ||
437 | 32 | payslip_obj = pool.get('hr.payslip') | ||
438 | 33 | payslip_ids = payslip_obj.search(cr, uid, [('employee_id','=',id),('date_to','>=',date_start),('date_to','<=',date_end)], context=context) | ||
439 | 34 | payslips = payslip_obj.browse(cr, uid, payslip_ids, context=context) | ||
440 | 35 | wage_sum = 0 | ||
441 | 36 | for payslip in payslips: | ||
442 | 37 | for line in payslip.line_ids: | ||
443 | 38 | if line.salary_rule_id.code == code: | ||
444 | 39 | wage_sum+= line.total | ||
445 | 40 | return int(wage_sum) | ||
446 | 41 | |||
447 | 42 | def _encode(s): | ||
448 | 43 | if isinstance(s, unicode): | ||
449 | 44 | return s.encode('utf8') | ||
450 | 45 | else: | ||
451 | 46 | if isinstance(s,bool): | ||
452 | 47 | return "" | ||
453 | 48 | return str(s) | ||
454 | 49 | |||
455 | 50 | def _process(employees, buffer): | ||
456 | 51 | writer = csv.writer(buffer, 'excel', delimiter=';') | ||
457 | 52 | # write header first | ||
458 | 53 | writer.writerow(("TI","NA","N° Cedula","N° Asegurado","Nombre", | ||
459 | 54 | "Apellido1","Apellido2","Tipo Jornada","Dias", | ||
460 | 55 | "Horas","Salario","Observaciones","Ocupacion")) | ||
461 | 56 | for tuple in employees: | ||
462 | 57 | employee = tuple[0] | ||
463 | 58 | writer.writerow((_encode(employee.ins_id_type), | ||
464 | 59 | _encode(employee.country_id.code), | ||
465 | 60 | _encode(employee.identification_id), | ||
466 | 61 | _encode(employee.sinid), | ||
467 | 62 | _encode(employee.ins_name), | ||
468 | 63 | _encode(employee.ins_last_name1), | ||
469 | 64 | _encode(employee.ins_last_name2), | ||
470 | 65 | _encode(employee.ins_working_day), | ||
471 | 66 | _encode(employee.ins_paid_days), | ||
472 | 67 | _encode(employee.ins_paid_hours), | ||
473 | 68 | _encode(tuple[1]), | ||
474 | 69 | "",#Observations are not added automatically | ||
475 | 70 | _encode(employee.ins_job_code))) | ||
476 | 71 | |||
477 | 72 | dbname = cr.dbname | ||
478 | 73 | pool = pooler.get_pool(dbname) | ||
479 | 74 | employee_obj = pool.get('hr.employee') | ||
480 | 75 | employee_ids = employee_obj.search(cr, uid, [('ins_exportable','=',True)], context=context) | ||
481 | 76 | employees = employee_obj.browse(cr, uid, employee_ids, context=context) | ||
482 | 77 | tmp_employees = [] | ||
483 | 78 | for employee in employees: | ||
484 | 79 | ins_wage = _get_user_wage(cr,uid,pool,date_start,date_end,code,employee.id,context) | ||
485 | 80 | tmp_employees.append((employee,ins_wage)) | ||
486 | 81 | _process(tmp_employees, buffer) | ||
487 | 82 | |||
488 | 83 | buffer = cStringIO.StringIO() | ||
489 | 84 | _information_export(buffer,cr,uid,code,context) | ||
490 | 85 | out = base64.encodestring(buffer.getvalue()) | ||
491 | 86 | buffer.close() | ||
492 | 87 | return out | ||
493 | 0 | \ No newline at end of file | 88 | \ No newline at end of file |
494 | 1 | 89 | ||
495 | === added directory 'l10n_cr_hr_ins_csv_generator/view' | |||
496 | === added file 'l10n_cr_hr_ins_csv_generator/view/l10n_cr_hr_ins_csv_generator_view.xml' | |||
497 | --- l10n_cr_hr_ins_csv_generator/view/l10n_cr_hr_ins_csv_generator_view.xml 1970-01-01 00:00:00 +0000 | |||
498 | +++ l10n_cr_hr_ins_csv_generator/view/l10n_cr_hr_ins_csv_generator_view.xml 2013-10-15 19:06:07 +0000 | |||
499 | @@ -0,0 +1,43 @@ | |||
500 | 1 | <?xml version="1.0" encoding="UTF-8"?> | ||
501 | 2 | |||
502 | 3 | <openerp> | ||
503 | 4 | <data> | ||
504 | 5 | <!-- Views --> | ||
505 | 6 | <record model="ir.ui.view" id ="ins_csv_generator_employee_form_view"> | ||
506 | 7 | <field name="name">ins.csv.generator.employee.form.view</field> | ||
507 | 8 | <field name="model">hr.employee</field> | ||
508 | 9 | <field name="priority" eval="16"/> | ||
509 | 10 | <field name="inherit_id" ref="hr.view_employee_form"/> | ||
510 | 11 | <field name="arch" type="xml"> | ||
511 | 12 | <xpath expr="//page[@string='HR Settings']" position="after"> | ||
512 | 13 | <page string="INS Information"> | ||
513 | 14 | <group name="ins_information_group" colspan="4" col="2"> | ||
514 | 15 | <group colspan="1" col="2"> | ||
515 | 16 | <separator string="Identification Information" colspan="2"/> | ||
516 | 17 | <field name="ins_id_type"/> | ||
517 | 18 | <field name="sinid"/> | ||
518 | 19 | </group> | ||
519 | 20 | <group colspan="1" col="2"> | ||
520 | 21 | <separator string="Full Name Configuration" colspan="2"/> | ||
521 | 22 | <field name="ins_name"/> | ||
522 | 23 | <field name="ins_last_name1"/> | ||
523 | 24 | <field name="ins_last_name2"/> | ||
524 | 25 | </group> | ||
525 | 26 | <group colspan="1" col="2"> | ||
526 | 27 | <separator string="Working Information" colspan="2"/> | ||
527 | 28 | <field name="ins_working_day"/> | ||
528 | 29 | <field name="ins_paid_days"/> | ||
529 | 30 | <field name="ins_paid_hours"/> | ||
530 | 31 | <field name="ins_job_code"/> | ||
531 | 32 | </group> | ||
532 | 33 | <group colspan="1" col="2"> | ||
533 | 34 | <separator string="Others" colspan="2"/> | ||
534 | 35 | <field name="ins_exportable"/> | ||
535 | 36 | </group> | ||
536 | 37 | </group> | ||
537 | 38 | </page> | ||
538 | 39 | </xpath> | ||
539 | 40 | </field> | ||
540 | 41 | </record> | ||
541 | 42 | </data> | ||
542 | 43 | </openerp> | ||
543 | 0 | \ No newline at end of file | 44 | \ No newline at end of file |
544 | 1 | 45 | ||
545 | === added directory 'l10n_cr_hr_ins_csv_generator/wizard' | |||
546 | === added file 'l10n_cr_hr_ins_csv_generator/wizard/__init__.py' | |||
547 | --- l10n_cr_hr_ins_csv_generator/wizard/__init__.py 1970-01-01 00:00:00 +0000 | |||
548 | +++ l10n_cr_hr_ins_csv_generator/wizard/__init__.py 2013-10-15 19:06:07 +0000 | |||
549 | @@ -0,0 +1,23 @@ | |||
550 | 1 | # -*- coding: utf-8 -*- | ||
551 | 2 | ############################################################################## | ||
552 | 3 | # | ||
553 | 4 | # OpenERP, Open Source Management Solution | ||
554 | 5 | # Addons modules by CLEARCORP S.A. | ||
555 | 6 | # Copyright (C) 2009-TODAY CLEARCORP S.A. (<http://clearcorp.co.cr>). | ||
556 | 7 | # | ||
557 | 8 | # This program is free software: you can redistribute it and/or modify | ||
558 | 9 | # it under the terms of the GNU Affero General Public License as | ||
559 | 10 | # published by the Free Software Foundation, either version 3 of the | ||
560 | 11 | # License, or (at your option) any later version. | ||
561 | 12 | # | ||
562 | 13 | # This program is distributed in the hope that it will be useful, | ||
563 | 14 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
564 | 15 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
565 | 16 | # GNU Affero General Public License for more details. | ||
566 | 17 | # | ||
567 | 18 | # You should have received a copy of the GNU Affero General Public License | ||
568 | 19 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
569 | 20 | # | ||
570 | 21 | ############################################################################## | ||
571 | 22 | |||
572 | 23 | import l10n_cr_hr_ins_csv_generator_wizard | ||
573 | 0 | \ No newline at end of file | 24 | \ No newline at end of file |
574 | 1 | 25 | ||
575 | === added file 'l10n_cr_hr_ins_csv_generator/wizard/l10n_cr_hr_ins_csv_generator_wizard.py' | |||
576 | --- l10n_cr_hr_ins_csv_generator/wizard/l10n_cr_hr_ins_csv_generator_wizard.py 1970-01-01 00:00:00 +0000 | |||
577 | +++ l10n_cr_hr_ins_csv_generator/wizard/l10n_cr_hr_ins_csv_generator_wizard.py 2013-10-15 19:06:07 +0000 | |||
578 | @@ -0,0 +1,65 @@ | |||
579 | 1 | # -*- coding: utf-8 -*- | ||
580 | 2 | ############################################################################## | ||
581 | 3 | # | ||
582 | 4 | # OpenERP, Open Source Management Solution | ||
583 | 5 | # Addons modules by CLEARCORP S.A. | ||
584 | 6 | # Copyright (C) 2009-TODAY CLEARCORP S.A. (<http://clearcorp.co.cr>). | ||
585 | 7 | # | ||
586 | 8 | # This program is free software: you can redistribute it and/or modify | ||
587 | 9 | # it under the terms of the GNU Affero General Public License as | ||
588 | 10 | # published by the Free Software Foundation, either version 3 of the | ||
589 | 11 | # License, or (at your option) any later version. | ||
590 | 12 | # | ||
591 | 13 | # This program is distributed in the hope that it will be useful, | ||
592 | 14 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
593 | 15 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
594 | 16 | # GNU Affero General Public License for more details. | ||
595 | 17 | # | ||
596 | 18 | # You should have received a copy of the GNU Affero General Public License | ||
597 | 19 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
598 | 20 | # | ||
599 | 21 | ############################################################################## | ||
600 | 22 | import base64 | ||
601 | 23 | import cStringIO | ||
602 | 24 | |||
603 | 25 | from openerp.osv import osv, fields | ||
604 | 26 | from ..tools import custom_encoder | ||
605 | 27 | |||
606 | 28 | class generatorWizardCreate(osv.TransientModel): | ||
607 | 29 | |||
608 | 30 | _name = "hr.ins.csv.generator.generator.wizard" | ||
609 | 31 | |||
610 | 32 | _columns = { | ||
611 | 33 | 'name': fields.char('Name', size=128), | ||
612 | 34 | 'salary_rule_id':fields.many2one('hr.salary.rule','Salary Rule', required=True), | ||
613 | 35 | 'date_start': fields.date('Date Start', required=True), | ||
614 | 36 | 'date_end': fields.date('Date End', required=True), | ||
615 | 37 | 'data': fields.binary('File', readonly=True), | ||
616 | 38 | 'state': fields.selection([('generate','generate'), # generate file | ||
617 | 39 | ('get','get')], string="State"), # get the file | ||
618 | 40 | } | ||
619 | 41 | |||
620 | 42 | _defaults = { | ||
621 | 43 | 'state': 'generate', | ||
622 | 44 | } | ||
623 | 45 | |||
624 | 46 | def generate_csv(self, cr, uid, ids, context=None): | ||
625 | 47 | this = self.browse(cr, uid, ids)[0] | ||
626 | 48 | this.name = 'ins_generated_file.csv' | ||
627 | 49 | out = custom_encoder.encodeInsCsv(cr, uid, this.date_start,this.date_end, | ||
628 | 50 | this.salary_rule_id.code, context) | ||
629 | 51 | self.write(cr, uid, ids, { | ||
630 | 52 | 'state': 'get', | ||
631 | 53 | 'data': out, | ||
632 | 54 | 'name':this.name}, context=context) | ||
633 | 55 | return { | ||
634 | 56 | 'type': 'ir.actions.act_window', | ||
635 | 57 | 'res_model': 'hr.ins.csv.generator.generator.wizard', | ||
636 | 58 | 'view_mode': 'form', | ||
637 | 59 | 'view_type': 'form', | ||
638 | 60 | 'res_id': this.id, | ||
639 | 61 | 'views': [(False, 'form')], | ||
640 | 62 | 'target': 'new', | ||
641 | 63 | } | ||
642 | 64 | |||
643 | 65 | # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: | ||
644 | 0 | \ No newline at end of file | 66 | \ No newline at end of file |
645 | 1 | 67 | ||
646 | === added file 'l10n_cr_hr_ins_csv_generator/wizard/l10n_cr_hr_ins_csv_generator_wizard_menu.xml' | |||
647 | --- l10n_cr_hr_ins_csv_generator/wizard/l10n_cr_hr_ins_csv_generator_wizard_menu.xml 1970-01-01 00:00:00 +0000 | |||
648 | +++ l10n_cr_hr_ins_csv_generator/wizard/l10n_cr_hr_ins_csv_generator_wizard_menu.xml 2013-10-15 19:06:07 +0000 | |||
649 | @@ -0,0 +1,11 @@ | |||
650 | 1 | <?xml version="1.0" encoding="UTF-8"?> | ||
651 | 2 | |||
652 | 3 | <openerp> | ||
653 | 4 | <data> | ||
654 | 5 | <menuitem id="menu_generator" | ||
655 | 6 | parent="hr.menu_hr_main" | ||
656 | 7 | name="Generate INS File" | ||
657 | 8 | sequence="100" | ||
658 | 9 | action="action_generator_wizard_create"/> | ||
659 | 10 | </data> | ||
660 | 11 | </openerp> | ||
661 | 0 | \ No newline at end of file | 12 | \ No newline at end of file |
662 | 1 | 13 | ||
663 | === added file 'l10n_cr_hr_ins_csv_generator/wizard/l10n_cr_hr_ins_csv_generator_wizard_view.xml' | |||
664 | --- l10n_cr_hr_ins_csv_generator/wizard/l10n_cr_hr_ins_csv_generator_wizard_view.xml 1970-01-01 00:00:00 +0000 | |||
665 | +++ l10n_cr_hr_ins_csv_generator/wizard/l10n_cr_hr_ins_csv_generator_wizard_view.xml 2013-10-15 19:06:07 +0000 | |||
666 | @@ -0,0 +1,41 @@ | |||
667 | 1 | <?xml version="1.0" encoding="UTF-8"?> | ||
668 | 2 | |||
669 | 3 | <openerp> | ||
670 | 4 | <data> | ||
671 | 5 | <!-- Views --> | ||
672 | 6 | <record model="ir.ui.view" id ="ins_csv_generator_generator_wizard_create_form"> | ||
673 | 7 | <field name="name">ins.csv.generator.generator.wizard.create.form</field> | ||
674 | 8 | <field name="model">hr.ins.csv.generator.generator.wizard</field> | ||
675 | 9 | <field name="priority" eval="16"/> | ||
676 | 10 | <field name="arch" type="xml"> | ||
677 | 11 | <form string="Wizard" version="7.0"> | ||
678 | 12 | <sheet> | ||
679 | 13 | <field invisible="1" name="state"/> | ||
680 | 14 | <group states="get"> | ||
681 | 15 | <p>Encoded text file: <field name="data" readonly="1" filename="name"/></p> | ||
682 | 16 | </group> | ||
683 | 17 | <group states="generate" colspan="4" col="2"> | ||
684 | 18 | <separator string="Fill the required fields" colspan="2"/> | ||
685 | 19 | <field name="salary_rule_id"/> | ||
686 | 20 | <field name="date_start"/> | ||
687 | 21 | <field name="date_end"/> | ||
688 | 22 | </group> | ||
689 | 23 | </sheet> | ||
690 | 24 | <footer states="generate"> | ||
691 | 25 | <button type="object" name="generate_csv" string="Generate csv File" icon="gtk-ok" | ||
692 | 26 | confirm="Are you sure you want to generate the csv file?" class="oe_highlight" /> | ||
693 | 27 | <button type="special" special="cancel" string="Cancel" class="oe_link" /> | ||
694 | 28 | </footer> | ||
695 | 29 | </form> | ||
696 | 30 | </field> | ||
697 | 31 | </record> | ||
698 | 32 | |||
699 | 33 | <!-- Actions --> | ||
700 | 34 | <act_window id="action_generator_wizard_create" | ||
701 | 35 | name="INS csv Generator" | ||
702 | 36 | res_model="hr.ins.csv.generator.generator.wizard" | ||
703 | 37 | view_mode="form" | ||
704 | 38 | target="new" | ||
705 | 39 | /> | ||
706 | 40 | </data> | ||
707 | 41 | </openerp> | ||
708 | 0 | \ No newline at end of file | 42 | \ No newline at end of file |