Merge lp:~acysos-team/openerp-spain/openerp-spain-7.0-aeat into lp:~openerp-spain-team/openerp-spain/7.0

Proposed by Ignacio Ibeas (www.acysos.com)
Status: Merged
Merged at revision: 368
Proposed branch: lp:~acysos-team/openerp-spain/openerp-spain-7.0-aeat
Merge into: lp:~openerp-spain-team/openerp-spain/7.0
Diff against target: 1123 lines (+351/-318)
8 files modified
l10n_es_aeat/__openerp__.py (+15/-8)
l10n_es_aeat/aeat_report.py (+61/-31)
l10n_es_aeat/i18n/ca.po (+73/-89)
l10n_es_aeat/i18n/es.po (+72/-88)
l10n_es_aeat/i18n/l10n_es_aeat.pot (+63/-76)
l10n_es_aeat/security/aeat_security.xml (+12/-0)
l10n_es_aeat/security/ir.model.access.csv (+2/-3)
l10n_es_aeat/wizard/export_to_boe.py (+53/-23)
To merge this branch: bzr merge lp:~acysos-team/openerp-spain/openerp-spain-7.0-aeat
Reviewer Review Type Date Requested Status
Ignacio Ibeas (www.acysos.com) Approve
Joaquin Gutierrez Needs Fixing
Pedro Manuel Baeza Approve
Review via email: mp+194644@code.launchpad.net

Description of the change

Añade el módulo base para los modelo AEAT migrado a OpenERP 7.0

Saludos

To post a comment you must log in.
Revision history for this message
Pedro Manuel Baeza (pedro.baeza) wrote :

Buenas, Ignacio,

Gracias por la adaptación. Para completar los estándares de codificación de la v7, te pediría que cambiaras las siguientes cosas:

- "from openerp.osv import fields, osv" a "from openerp.osv import fields, orm"
- En lugar de "osv.Model", poner "orm.Model"
- "orm.orm_exception" por "osv.osv_exception"

Por lo demás, todo correcto.

Un saludo.

review: Needs Fixing
Revision history for this message
Ignacio Ibeas (www.acysos.com) (ignacio-acysos) wrote :

Hola,

No tengo ningún problema en cambiarlo, es un cambio mínimo, pero estas seguro que es así, esta igual que en los módulos oficiales de OpenERP S.A., mira account, base, sale...

Saludos

Revision history for this message
Pedro Manuel Baeza (pedro.baeza) wrote :

Ya, efectivamente en los módulos oficiales no está cambiado aún por la política del balanceo del esfuerzo/recompensa, aunque en mi opinión luego a la larga es peor, porque cuando ya desactiven la compatibilidad con el namespace osv, les toca cambiar todo y tienen menos tiempo para probarlo, pero bueno, es la norma que han seguido. Pero desde la versión 6.1, el namespace osv está deprecated en favor de orm.

Te adjunto el link del borrador de las contribuciones para la OpenERP Community, donde se hablan de estas convenciones:

http://pad.openerp.com/p/community-review

Un saludo.

Revision history for this message
Ignacio Ibeas (www.acysos.com) (ignacio-acysos) wrote :

Ok, no hay problema, no lo había hecho precisamente porque los oficiales no estaba, he supuesto que ese cambio era para la 8.

Saludos

Revision history for this message
Ignacio Ibeas (www.acysos.com) (ignacio-acysos) wrote :

Cambios realizados.

Revision history for this message
Pedro Manuel Baeza (pedro.baeza) wrote :

Gracias por los cambios.

Un saludo.

review: Approve
Revision history for this message
Joaquin Gutierrez (joaquing-pedrosa) wrote :

Hola Ignacio:

He detectado un error en el fichero aeat_report en el metodo unlink, linea 134.

Tienes "raise orm.orm exception(..." hay que cambiarlo por "raise orm.except_orm(..."

Si te parece bien cambialo tu, yo lo he cambiado en local para poder seguir trabajando con el 347.

Un saludo y gracias

review: Needs Fixing
Revision history for this message
Pedro Manuel Baeza (pedro.baeza) wrote :

Buenas, Joaquín, lo detecté yo también, porque se lo dije erróneamente a Ignacio en este mismo MP, pero lo he cambiado en la revisión 373, puesto que el MP está ya hecho.

Un saludo.

Revision history for this message
Joaquin Gutierrez (joaquing-pedrosa) wrote :

Hola:

He encontrado otro error a la hora de generar el fichero. En el fichero export_to_boe.py da un error de variable no definida en la linea 230, esto es debido a que tiene que estar declarada a la hora de crear el attach en la llinea 221, ahora mismo esta "self.pool.get("ir.attachment").create......" se tiene que poner "attach_id = self.pool.get("ir.attachment").create......". No se si lo teneis controlado.
Yo como el anterio lo he cambiado en local.

Un saludo

review: Needs Fixing
Revision history for this message
Ignacio Ibeas (www.acysos.com) (ignacio-acysos) wrote :

El tema del exception estaba corregido en mi rama local como comento Pedro, habrá sido un error de copiar y pegar.

Respecto al attach, es correcto, falta esa variable. No me había producido error porque los otros modelos extienden esa función.

Saludos

review: Approve
Revision history for this message
Joaquin Gutierrez (joaquing-pedrosa) wrote :

Ok ignacio, seguimos con el tajo.

Un saludo

Enviado en movilidad x un cacharro con iOS

El 17/11/2013, a las 13:23, "Ignacio Ibeas \(www.acysos.com\)" <email address hidden> escribió:

> Review: Approve
>
> El tema del exception estaba corregido en mi rama local como comento Pedro, habrá sido un error de copiar y pegar.
>
> Respecto al attach, es correcto, falta esa variable. No me había producido error porque los otros modelos extienden esa función.
>
> Saludos
> --
> https://code.launchpad.net/~acysos-team/openerp-spain/openerp-spain-7.0-aeat/+merge/194644
> You are reviewing the proposed merge of lp:~acysos-team/openerp-spain/openerp-spain-7.0-aeat into lp:openerp-spain.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'l10n_es_aeat/__openerp__.py'
2--- l10n_es_aeat/__openerp__.py 2013-01-28 10:29:06 +0000
3+++ l10n_es_aeat/__openerp__.py 2013-11-11 18:29:02 +0000
4@@ -4,6 +4,10 @@
5 # Copyright (C) 2004-2011
6 # Pexego Sistemas Informáticos. (http://pexego.es) All Rights Reserved
7 #
8+# Copyright (C) 2013
9+# Ignacio Ibeas - Acysos S.L. (http://acysos.com) All Rights Reserved
10+# Migración a OpenERP 7.0
11+#
12 # This program is free software: you can redistribute it and/or modify
13 # it under the terms of the GNU Affero General Public License as
14 # published by the Free Software Foundation, either version 3 of the
15@@ -24,19 +28,22 @@
16 'version' : "1.0",
17 'author' : "Pexego",
18 'license' : "AGPL-3",
19- 'website' : "http://www.pexego.es",
20+ 'contributors': ['Ignacio Ibeas (Acysos S.L.)'],
21+ 'website' : "http://www.pexego.es, http://www.acysos.com",
22 'category' : "Localisation/Accounting",
23 'init_xml' : [
24 ],
25- 'depends' : ["account"],
26+ 'depends' : [
27+ "account",
28+ ],
29 'update_xml' : [
30+ 'security/aeat_security.xml',
31+ 'security/ir.model.access.csv',
32 'aeat_menuitem.xml',
33- 'security/ir.model.access.csv'
34 ],
35 'demo_xml' : [],
36 'test' : [],
37- 'installable' : False,
38- 'active' : False,
39-}
40-
41-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
42+ 'auto_install': False,
43+ 'installable': True,
44+ 'application': False,
45+}
46\ No newline at end of file
47
48=== modified file 'l10n_es_aeat/aeat_report.py'
49--- l10n_es_aeat/aeat_report.py 2011-08-03 10:50:08 +0000
50+++ l10n_es_aeat/aeat_report.py 2013-11-11 18:29:02 +0000
51@@ -3,6 +3,10 @@
52 #
53 # Copyright (C) 2004-2011
54 # Pexego Sistemas Informáticos. (http://pexego.es) All Rights Reserved
55+# Luis Manuel Angueira Blanco (Pexego)
56+# Copyright (C) 2013
57+# Ignacio Ibeas - Acysos S.L. (http://acysos.com) All Rights Reserved
58+# Migración a OpenERP 7.0
59 #
60 # This program is free software: you can redistribute it and/or modify
61 # it under the terms of the GNU Affero General Public License as
62@@ -19,16 +23,13 @@
63 #
64 ##############################################################################
65
66-__author__ = "Luis Manuel Angueira Blanco (Pexego)"
67-
68
69 import netsvc
70 import re
71-from tools.translate import _
72-
73-from osv import osv, fields
74-
75-class l10n_es_aeat_report(osv.osv):
76+from openerp.tools.translate import _
77+from openerp.osv import orm, fields
78+
79+class l10n_es_aeat_report(orm.Model):
80 _name = "l10n.es.aeat.report"
81 _description = "AEAT Report base module"
82
83@@ -42,35 +43,55 @@
84 if company_id:
85 company = self.pool.get('res.company').browse(cr, uid, company_id)
86 if company.partner_id and company.partner_id.vat:
87- # Remove the ES part from spanish vat numbers (ES12345678Z => 12345678Z)
88- company_vat = re.match("(ES){0,1}(.*)", company.partner_id.vat).groups()[1]
89+ # Remove the ES part from spanish vat numbers
90+ # (ES12345678Z => 12345678Z)
91+ company_vat = re.match("(ES){0,1}(.*)",
92+ company.partner_id.vat).groups()[1]
93 return { 'value': { 'company_vat': company_vat } }
94
95
96 _columns = {
97- 'company_id': fields.many2one('res.company', 'Company', required=True, states={'done':[('readonly',True)]}),
98-
99- 'number': fields.char('Declaration Number', size=13, states={'calculated':[('required',True)],'done':[('readonly',True)]}),
100- 'previous_number' : fields.char('Previous Declaration Number', size=13, states={'done':[('readonly',True)]}),
101-
102- 'representative_vat': fields.char('L.R. VAT number', size=9, help="Legal Representative VAT number.",
103- states={'calculated':[('required',True)],'confirmed':[('readonly',True)]}),
104-
105- 'fiscalyear_id': fields.many2one('account.fiscalyear', 'Fiscal Year', required=True, states={'done': [('readonly', True)]}),
106-
107- 'company_vat': fields.char('VAT number', size=9, states={'calculated':[('required',True)],'done':[('readonly',True)]}),
108-
109- 'type': fields.selection([
110- ('N','Normal'),
111+ 'company_id': fields.many2one(
112+ 'res.company', 'Company',
113+ required=True, states={'done':[('readonly',True)]}
114+ ),
115+ 'number': fields.char(
116+ 'Declaration Number', size=13,
117+ states={'calculated':[('required',True)],
118+ 'done':[('readonly',True)]}
119+ ),
120+ 'previous_number' : fields.char(
121+ 'Previous Declaration Number',
122+ size=13, states={'done':[('readonly',True)]}
123+ ),
124+ 'representative_vat': fields.char(
125+ 'L.R. VAT number', size=9,
126+ help="Legal Representative VAT number.",
127+ states={'calculated':[('required',True)],
128+ 'confirmed':[('readonly',True)]}
129+ ),
130+ 'fiscalyear_id': fields.many2one(
131+ 'account.fiscalyear', 'Fiscal Year', required=True,
132+ states={'done': [('readonly', True)]}
133+ ),
134+ 'company_vat': fields.char(
135+ 'VAT number', size=9,
136+ states={'calculated':[('required',True)],
137+ 'done':[('readonly',True)]}
138+ ),
139+ 'type': fields.selection(
140+ [('N','Normal'),
141 ('C','Complementary'),
142- ('S','Substitutive')], 'Statement Type',
143- states={'calculated':[('required',True)],'done':[('readonly',True)]}),
144-
145+ ('S','Substitutive')],
146+ 'Statement Type',
147+ states={'calculated':[('required',True)],
148+ 'done':[('readonly',True)]}
149+ ),
150 'support_type': fields.selection([
151 ('C','DVD'),
152 ('T','Telematics')], 'Support Type',
153- states={'calculated':[('required',True)],'done':[('readonly',True)]}),
154-
155+ states={'calculated':[('required',True)],
156+ 'done':[('readonly',True)]}),
157 'calculation_date': fields.datetime("Calculation date"),
158 'state' : fields.selection([
159 ('draft', 'Draft'),
160@@ -79,12 +100,17 @@
161 ('done', 'Done'),
162 ('canceled', 'Canceled')
163 ], 'State', readonly=True),
164+ 'attach_id':fields.many2one(
165+ 'ir.attachment', 'BOE file', readonly=True
166+ ),
167 }
168
169 _defaults = {
170 'company_id' : lambda self, cr, uid, context:
171- self.pool.get('res.users').browse(cr, uid, uid, context).company_id and
172- self.pool.get('res.users').browse(cr, uid, uid, context).company_id.id,
173+ self.pool.get('res.users').browse(cr, uid,
174+ uid, context).company_id and
175+ self.pool.get('res.users').browse(cr, uid,
176+ uid, context).company_id.id,
177 'type' : lambda *a: 'N',
178 'support_type' : lambda *a: 'T',
179 'state' : lambda *a: 'draft',
180@@ -105,7 +131,11 @@
181
182 for item in self.browse(cr, uid, ids):
183 if item.state not in ['draft', 'canceled']:
184- raise osv.except_osv(_('Error!'), _("Only reports in 'draft' or 'cancel' state can be removed"))
185+ raise orm.orm_exception(
186+ _('Error!'),
187+ _("Only reports in 'draft' or 'cancel'" + \
188+ "state can be removed")
189+ )
190
191 return super(l10n_es_aeat_report, self).unlink(cr, uid, ids, context)
192
193
194=== modified file 'l10n_es_aeat/i18n/ca.po' (properties changed: +x to -x)
195--- l10n_es_aeat/i18n/ca.po 2013-10-14 05:33:51 +0000
196+++ l10n_es_aeat/i18n/ca.po 2013-11-11 18:29:02 +0000
197@@ -1,20 +1,19 @@
198 # Translation of OpenERP Server.
199 # This file contains the translation of the following modules:
200-# * l10n_es_aeat
201+# * l10n_es_aeat
202 #
203 msgid ""
204 msgstr ""
205-"Project-Id-Version: OpenERP Server 6.0.0-rc1\n"
206-"Report-Msgid-Bugs-To: support@openerp.com\n"
207-"POT-Creation-Date: 2010-12-13 17:34+0000\n"
208-"PO-Revision-Date: 2013-10-10 16:51+0000\n"
209-"Last-Translator: Jordi Esteve (Zikzakmedia) <jesteve@zikzakmedia.com>\n"
210+"Project-Id-Version: OpenERP Server 7.0-20130519-231019\n"
211+"Report-Msgid-Bugs-To: \n"
212+"POT-Creation-Date: 2013-10-11 15:27+0000\n"
213+"PO-Revision-Date: 2013-10-11 15:27+0000\n"
214+"Last-Translator: <>\n"
215 "Language-Team: \n"
216 "MIME-Version: 1.0\n"
217 "Content-Type: text/plain; charset=UTF-8\n"
218-"Content-Transfer-Encoding: 8bit\n"
219-"X-Launchpad-Export-Date: 2013-10-14 05:33+0000\n"
220-"X-Generator: Launchpad (build 16799)\n"
221+"Content-Transfer-Encoding: \n"
222+"Plural-Forms: \n"
223
224 #. module: l10n_es_aeat
225 #: field:l10n.es.aeat.report,type:0
226@@ -22,23 +21,11 @@
227 msgstr "Tipus declaració"
228
229 #. module: l10n_es_aeat
230-#: code:addons/l10n_es_aeat/wizard/export_to_boe.py:104
231-#: code:addons/l10n_es_aeat/wizard/export_to_boe.py:144
232-#, python-format
233-msgid "The formated string must match the given length"
234-msgstr "La cadena formatejada ha de satisfer la llargada donada."
235-
236-#. module: l10n_es_aeat
237 #: selection:l10n.es.aeat.report,support_type:0
238 msgid "DVD"
239 msgstr "DVD"
240
241 #. module: l10n_es_aeat
242-#: field:account.invoice,refund_invoices_description:0
243-msgid "Refund invoices description"
244-msgstr "Descripció de factures rectificatives."
245-
246-#. module: l10n_es_aeat
247 #: field:l10n.es.aeat.report,state:0
248 msgid "State"
249 msgstr "Estat"
250@@ -50,8 +37,8 @@
251
252 #. module: l10n_es_aeat
253 #: selection:l10n.es.aeat.report,type:0
254-msgid "Normal"
255-msgstr "Normal"
256+msgid "Complementary"
257+msgstr "Complementària"
258
259 #. module: l10n_es_aeat
260 #: field:l10n.es.aeat.report,company_id:0
261@@ -69,9 +56,9 @@
262 msgstr "Substitutiva"
263
264 #. module: l10n_es_aeat
265-#: field:l10n.es.aeat.report,fiscalyear_id:0
266-msgid "Fical Year"
267-msgstr "Exercici fiscal"
268+#: help:l10n.es.aeat.report,representative_vat:0
269+msgid "Legal Representative VAT number."
270+msgstr "NIF del representant legal."
271
272 #. module: l10n_es_aeat
273 #: field:l10n.es.aeat.report,previous_number:0
274@@ -79,14 +66,28 @@
275 msgstr "Número declaració anterior"
276
277 #. module: l10n_es_aeat
278-#: field:account.invoice,origin_invoices_ids:0
279-msgid "Refund invoice"
280-msgstr "Factura rectificativa"
281-
282-#. module: l10n_es_aeat
283-#: help:l10n.es.aeat.report,representative_vat:0
284-msgid "Legal Representative VAT number."
285-msgstr "NIF del representant legal."
286+#: field:l10n.es.aeat.report,company_vat:0
287+msgid "VAT number"
288+msgstr "NIF / CIF"
289+
290+#. module: l10n_es_aeat
291+#: code:addons/l10n_es_aeat/aeat_report.py:109
292+#, python-format
293+msgid "Only reports in 'draft' or 'cancel' state can be removed"
294+msgstr "Només declaracions en estat 'Esborrany' o 'Cancel·lada' poden ser eliminades"
295+
296+#. module: l10n_es_aeat
297+#: code:addons/l10n_es_aeat/wizard/export_to_boe.py:199
298+#, python-format
299+msgid "%Y-%m-%d"
300+msgstr "%Y-%m-%d"
301+
302+#. module: l10n_es_aeat
303+#: code:addons/l10n_es_aeat/wizard/export_to_boe.py:109
304+#: code:addons/l10n_es_aeat/wizard/export_to_boe.py:147
305+#, python-format
306+msgid "The formated string must match the given length"
307+msgstr "La cadena formatejada ha de satisfer la llargada donada."
308
309 #. module: l10n_es_aeat
310 #: field:l10n.es.aeat.report,support_type:0
311@@ -94,16 +95,20 @@
312 msgstr "Tipus de suport"
313
314 #. module: l10n_es_aeat
315-#: help:account.invoice,origin_invoices_ids:0
316-msgid "Links to original invoice which is referred by current refund invoice"
317-msgstr ""
318-"Enllaça amb la factura original a la qual fa referència la factura actual."
319-
320-#. module: l10n_es_aeat
321-#: model:ir.model,name:l10n_es_aeat.model_l10n_es_aeat
322-#: model:ir.module.module,shortdesc:l10n_es_aeat.module_meta_information
323-msgid "AEAT Base"
324-msgstr "AEAT Base"
325+#: field:l10n.es.aeat.report,attach_id:0
326+msgid "BOE file"
327+msgstr "Fitxer BOE"
328+
329+#. module: l10n_es_aeat
330+#: code:addons/l10n_es_aeat/aeat_report.py:109
331+#, python-format
332+msgid "Error!"
333+msgstr "Error!"
334+
335+#. module: l10n_es_aeat
336+#: field:l10n.es.aeat.report,fiscalyear_id:0
337+msgid "Fiscal Year"
338+msgstr "Exercici fiscal"
339
340 #. module: l10n_es_aeat
341 #: model:ir.model,name:l10n_es_aeat.model_l10n_es_aeat_report
342@@ -111,9 +116,9 @@
343 msgstr "Mòdul base per les declaracions de l'Agència Tributària"
344
345 #. module: l10n_es_aeat
346-#: field:l10n.es.aeat.report,calculation_date:0
347-msgid "Calculation date"
348-msgstr "Data del càlcul"
349+#: selection:l10n.es.aeat.report,state:0
350+msgid "Processed"
351+msgstr "Calculada"
352
353 #. module: l10n_es_aeat
354 #: field:l10n.es.aeat.report,representative_vat:0
355@@ -121,45 +126,11 @@
356 msgstr "NIF R.L."
357
358 #. module: l10n_es_aeat
359-#: field:l10n.es.aeat.report,company_vat:0
360-msgid "VAT number"
361-msgstr "NIF / CIF"
362-
363-#. module: l10n_es_aeat
364-#: code:addons/l10n_es_aeat/aeat_report.py:107
365-#, python-format
366-msgid "Only reports in 'draft' or 'cancel' state can be removed"
367-msgstr ""
368-"Només declaracions en estat 'Esborrany' o 'Cancel·lada' poden ser eliminades"
369-
370-#. module: l10n_es_aeat
371 #: selection:l10n.es.aeat.report,support_type:0
372 msgid "Telematics"
373 msgstr "Telemàtica"
374
375 #. module: l10n_es_aeat
376-#: code:addons/l10n_es_aeat/aeat_report.py:107
377-#, python-format
378-msgid "Error!"
379-msgstr "Error!"
380-
381-#. module: l10n_es_aeat
382-#: field:l10n.es.aeat.report,fiscalyear_id:0
383-msgid "Fiscal Year"
384-msgstr "Exercici fiscal"
385-
386-#. module: l10n_es_aeat
387-#: field:l10n.es.aeat.report,number:0
388-msgid "Declaration Number"
389-msgstr "Número declaració"
390-
391-#. module: l10n_es_aeat
392-#: code:addons/l10n_es_aeat/wizard/export_to_boe.py:100
393-#, python-format
394-msgid "Wrong aling option. It should be < or >"
395-msgstr "Opció d'alineament errònia. Hauria de ser < o >"
396-
397-#. module: l10n_es_aeat
398 #: model:ir.ui.menu,name:l10n_es_aeat.menu_root_aeat
399 msgid "AEAT Reports"
400 msgstr "Declaracions Agència Tributària"
401@@ -171,8 +142,13 @@
402
403 #. module: l10n_es_aeat
404 #: selection:l10n.es.aeat.report,type:0
405-msgid "Complementary"
406-msgstr "Complementària"
407+msgid "Normal"
408+msgstr "Normal"
409+
410+#. module: l10n_es_aeat
411+#: field:l10n.es.aeat.report,number:0
412+msgid "Declaration Number"
413+msgstr "Número declaració"
414
415 #. module: l10n_es_aeat
416 #: selection:l10n.es.aeat.report,state:0
417@@ -180,16 +156,24 @@
418 msgstr "Cancel·lada"
419
420 #. module: l10n_es_aeat
421+#: code:addons/l10n_es_aeat/wizard/export_to_boe.py:105
422+#, python-format
423+msgid "Wrong aling option. It should be < or >"
424+msgstr "Opció d'alineament errònia. Hauria de ser < o >"
425+
426+#. module: l10n_es_aeat
427 #: selection:l10n.es.aeat.report,state:0
428 msgid "Done"
429 msgstr "Realitzada"
430
431 #. module: l10n_es_aeat
432-#: model:ir.model,name:l10n_es_aeat.model_account_invoice
433-msgid "Invoice"
434-msgstr "Factura"
435+#: code:addons/l10n_es_aeat/wizard/export_to_boe.py:199
436+#, python-format
437+msgid "%s_report_%s.txt"
438+msgstr "%s_report_%s.txt"
439
440 #. module: l10n_es_aeat
441-#: selection:l10n.es.aeat.report,state:0
442-msgid "Processed"
443-msgstr "Calculada"
444+#: field:l10n.es.aeat.report,calculation_date:0
445+msgid "Calculation date"
446+msgstr "Data del càlcul"
447+
448
449=== modified file 'l10n_es_aeat/i18n/es.po' (properties changed: +x to -x)
450--- l10n_es_aeat/i18n/es.po 2013-10-14 05:33:51 +0000
451+++ l10n_es_aeat/i18n/es.po 2013-11-11 18:29:02 +0000
452@@ -4,17 +4,16 @@
453 #
454 msgid ""
455 msgstr ""
456-"Project-Id-Version: OpenERP Server 6.0.0-rc1\n"
457-"Report-Msgid-Bugs-To: support@openerp.com\n"
458-"POT-Creation-Date: 2010-12-13 17:34+0000\n"
459-"PO-Revision-Date: 2013-10-10 16:51+0000\n"
460-"Last-Translator: Jordi Esteve (Zikzakmedia) <jesteve@zikzakmedia.com>\n"
461+"Project-Id-Version: OpenERP Server 7.0-20130519-231019\n"
462+"Report-Msgid-Bugs-To: \n"
463+"POT-Creation-Date: 2013-10-11 15:27+0000\n"
464+"PO-Revision-Date: 2013-10-11 15:27+0000\n"
465+"Last-Translator: <>\n"
466 "Language-Team: \n"
467 "MIME-Version: 1.0\n"
468 "Content-Type: text/plain; charset=UTF-8\n"
469-"Content-Transfer-Encoding: 8bit\n"
470-"X-Launchpad-Export-Date: 2013-10-14 05:33+0000\n"
471-"X-Generator: Launchpad (build 16799)\n"
472+"Content-Transfer-Encoding: \n"
473+"Plural-Forms: \n"
474
475 #. module: l10n_es_aeat
476 #: field:l10n.es.aeat.report,type:0
477@@ -22,23 +21,11 @@
478 msgstr "Tipo de declaración"
479
480 #. module: l10n_es_aeat
481-#: code:addons/l10n_es_aeat/wizard/export_to_boe.py:104
482-#: code:addons/l10n_es_aeat/wizard/export_to_boe.py:144
483-#, python-format
484-msgid "The formated string must match the given length"
485-msgstr "La cadena formateada debe satisfacer el tamaño dado."
486-
487-#. module: l10n_es_aeat
488 #: selection:l10n.es.aeat.report,support_type:0
489 msgid "DVD"
490 msgstr "DVD"
491
492 #. module: l10n_es_aeat
493-#: field:account.invoice,refund_invoices_description:0
494-msgid "Refund invoices description"
495-msgstr "Descripción de facturas rectificativas."
496-
497-#. module: l10n_es_aeat
498 #: field:l10n.es.aeat.report,state:0
499 msgid "State"
500 msgstr "Estado"
501@@ -50,8 +37,8 @@
502
503 #. module: l10n_es_aeat
504 #: selection:l10n.es.aeat.report,type:0
505-msgid "Normal"
506-msgstr "Normal"
507+msgid "Complementary"
508+msgstr "Complementaria"
509
510 #. module: l10n_es_aeat
511 #: field:l10n.es.aeat.report,company_id:0
512@@ -69,9 +56,9 @@
513 msgstr "Sustitutiva"
514
515 #. module: l10n_es_aeat
516-#: field:l10n.es.aeat.report,fiscalyear_id:0
517-msgid "Fical Year"
518-msgstr "Ejercicio fiscal"
519+#: help:l10n.es.aeat.report,representative_vat:0
520+msgid "Legal Representative VAT number."
521+msgstr "Nombre del representante legal."
522
523 #. module: l10n_es_aeat
524 #: field:l10n.es.aeat.report,previous_number:0
525@@ -79,14 +66,28 @@
526 msgstr "Número de declaración previa"
527
528 #. module: l10n_es_aeat
529-#: field:account.invoice,origin_invoices_ids:0
530-msgid "Refund invoice"
531-msgstr "Factura rectificativa"
532-
533-#. module: l10n_es_aeat
534-#: help:l10n.es.aeat.report,representative_vat:0
535-msgid "Legal Representative VAT number."
536-msgstr "Nombre del representante legal."
537+#: field:l10n.es.aeat.report,company_vat:0
538+msgid "VAT number"
539+msgstr "CIF/NIF"
540+
541+#. module: l10n_es_aeat
542+#: code:addons/l10n_es_aeat/aeat_report.py:109
543+#, python-format
544+msgid "Only reports in 'draft' or 'cancel' state can be removed"
545+msgstr "Sólo declaraciones en estado 'Borrador' o 'Cancelada' pueden ser eliminadas"
546+
547+#. module: l10n_es_aeat
548+#: code:addons/l10n_es_aeat/wizard/export_to_boe.py:199
549+#, python-format
550+msgid "%Y-%m-%d"
551+msgstr "%Y-%m-%d"
552+
553+#. module: l10n_es_aeat
554+#: code:addons/l10n_es_aeat/wizard/export_to_boe.py:109
555+#: code:addons/l10n_es_aeat/wizard/export_to_boe.py:147
556+#, python-format
557+msgid "The formated string must match the given length"
558+msgstr "La cadena formateada debe satisfacer el tamaño dado."
559
560 #. module: l10n_es_aeat
561 #: field:l10n.es.aeat.report,support_type:0
562@@ -94,16 +95,20 @@
563 msgstr "Tipo de soporte"
564
565 #. module: l10n_es_aeat
566-#: help:account.invoice,origin_invoices_ids:0
567-msgid "Links to original invoice which is referred by current refund invoice"
568-msgstr ""
569-"Enlaza con la factura original a la que hace referencia la factura actual."
570-
571-#. module: l10n_es_aeat
572-#: model:ir.model,name:l10n_es_aeat.model_l10n_es_aeat
573-#: model:ir.module.module,shortdesc:l10n_es_aeat.module_meta_information
574-msgid "AEAT Base"
575-msgstr "AEAT Base"
576+#: field:l10n.es.aeat.report,attach_id:0
577+msgid "BOE file"
578+msgstr "Archivo BOE"
579+
580+#. module: l10n_es_aeat
581+#: code:addons/l10n_es_aeat/aeat_report.py:109
582+#, python-format
583+msgid "Error!"
584+msgstr "¡Error!"
585+
586+#. module: l10n_es_aeat
587+#: field:l10n.es.aeat.report,fiscalyear_id:0
588+msgid "Fiscal Year"
589+msgstr "Ejercicio fiscal"
590
591 #. module: l10n_es_aeat
592 #: model:ir.model,name:l10n_es_aeat.model_l10n_es_aeat_report
593@@ -111,9 +116,9 @@
594 msgstr "Módulo base para las declaraciones de la Agencia Tributaria"
595
596 #. module: l10n_es_aeat
597-#: field:l10n.es.aeat.report,calculation_date:0
598-msgid "Calculation date"
599-msgstr "Fecha de cálculo"
600+#: selection:l10n.es.aeat.report,state:0
601+msgid "Processed"
602+msgstr "Calculada"
603
604 #. module: l10n_es_aeat
605 #: field:l10n.es.aeat.report,representative_vat:0
606@@ -121,45 +126,11 @@
607 msgstr "CIF/NIF Repr. legal"
608
609 #. module: l10n_es_aeat
610-#: field:l10n.es.aeat.report,company_vat:0
611-msgid "VAT number"
612-msgstr "CIF/NIF"
613-
614-#. module: l10n_es_aeat
615-#: code:addons/l10n_es_aeat/aeat_report.py:107
616-#, python-format
617-msgid "Only reports in 'draft' or 'cancel' state can be removed"
618-msgstr ""
619-"Sólo declaraciones en estado 'Borrador' o 'Cancelada' pueden ser eliminadas"
620-
621-#. module: l10n_es_aeat
622 #: selection:l10n.es.aeat.report,support_type:0
623 msgid "Telematics"
624 msgstr "Telemática"
625
626 #. module: l10n_es_aeat
627-#: code:addons/l10n_es_aeat/aeat_report.py:107
628-#, python-format
629-msgid "Error!"
630-msgstr "¡Error!"
631-
632-#. module: l10n_es_aeat
633-#: field:l10n.es.aeat.report,fiscalyear_id:0
634-msgid "Fiscal Year"
635-msgstr "Ejercicio fiscal"
636-
637-#. module: l10n_es_aeat
638-#: field:l10n.es.aeat.report,number:0
639-msgid "Declaration Number"
640-msgstr "Número declaración"
641-
642-#. module: l10n_es_aeat
643-#: code:addons/l10n_es_aeat/wizard/export_to_boe.py:100
644-#, python-format
645-msgid "Wrong aling option. It should be < or >"
646-msgstr "Opción de alineamiento errónea. Debería ser < o >"
647-
648-#. module: l10n_es_aeat
649 #: model:ir.ui.menu,name:l10n_es_aeat.menu_root_aeat
650 msgid "AEAT Reports"
651 msgstr "Declaraciones Agencia Tributaria"
652@@ -171,8 +142,13 @@
653
654 #. module: l10n_es_aeat
655 #: selection:l10n.es.aeat.report,type:0
656-msgid "Complementary"
657-msgstr "Complementaria"
658+msgid "Normal"
659+msgstr "Normal"
660+
661+#. module: l10n_es_aeat
662+#: field:l10n.es.aeat.report,number:0
663+msgid "Declaration Number"
664+msgstr "Número declaración"
665
666 #. module: l10n_es_aeat
667 #: selection:l10n.es.aeat.report,state:0
668@@ -180,16 +156,24 @@
669 msgstr "Cancelada"
670
671 #. module: l10n_es_aeat
672+#: code:addons/l10n_es_aeat/wizard/export_to_boe.py:105
673+#, python-format
674+msgid "Wrong aling option. It should be < or >"
675+msgstr "Opción de alineamiento errónea. Debería ser < o >"
676+
677+#. module: l10n_es_aeat
678 #: selection:l10n.es.aeat.report,state:0
679 msgid "Done"
680 msgstr "Realizada"
681
682 #. module: l10n_es_aeat
683-#: model:ir.model,name:l10n_es_aeat.model_account_invoice
684-msgid "Invoice"
685-msgstr "Factura"
686+#: code:addons/l10n_es_aeat/wizard/export_to_boe.py:199
687+#, python-format
688+msgid "%s_report_%s.txt"
689+msgstr "%s_report_%s.txt"
690
691 #. module: l10n_es_aeat
692-#: selection:l10n.es.aeat.report,state:0
693-msgid "Processed"
694-msgstr "Calculada"
695+#: field:l10n.es.aeat.report,calculation_date:0
696+msgid "Calculation date"
697+msgstr "Fecha de cálculo"
698+
699
700=== modified file 'l10n_es_aeat/i18n/l10n_es_aeat.pot' (properties changed: +x to -x)
701--- l10n_es_aeat/i18n/l10n_es_aeat.pot 2011-03-11 21:15:22 +0000
702+++ l10n_es_aeat/i18n/l10n_es_aeat.pot 2013-11-11 18:29:02 +0000
703@@ -4,15 +4,15 @@
704 #
705 msgid ""
706 msgstr ""
707-"Project-Id-Version: OpenERP Server 6.0.0-rc1\n"
708-"Report-Msgid-Bugs-To: support@openerp.com\n"
709-"POT-Creation-Date: 2010-12-13 17:34:49+0000\n"
710-"PO-Revision-Date: 2010-12-13 18:44+0100\n"
711-"Last-Translator: Luis Manuel Angueira Blanco <manuel@pexego.es>\n"
712+"Project-Id-Version: OpenERP Server 7.0-20130519-231019\n"
713+"Report-Msgid-Bugs-To: \n"
714+"POT-Creation-Date: 2013-10-11 15:20+0000\n"
715+"PO-Revision-Date: 2013-10-11 15:20+0000\n"
716+"Last-Translator: <>\n"
717 "Language-Team: \n"
718 "MIME-Version: 1.0\n"
719 "Content-Type: text/plain; charset=UTF-8\n"
720-"Content-Transfer-Encoding: 8bit\n"
721+"Content-Transfer-Encoding: \n"
722 "Plural-Forms: \n"
723
724 #. module: l10n_es_aeat
725@@ -21,23 +21,11 @@
726 msgstr ""
727
728 #. module: l10n_es_aeat
729-#: code:addons/l10n_es_aeat/wizard/export_to_boe.py:104
730-#: code:addons/l10n_es_aeat/wizard/export_to_boe.py:144
731-#, python-format
732-msgid "The formated string must match the given length"
733-msgstr ""
734-
735-#. module: l10n_es_aeat
736 #: selection:l10n.es.aeat.report,support_type:0
737 msgid "DVD"
738 msgstr ""
739
740 #. module: l10n_es_aeat
741-#: field:account.invoice,refund_invoices_description:0
742-msgid "Refund invoices description"
743-msgstr ""
744-
745-#. module: l10n_es_aeat
746 #: field:l10n.es.aeat.report,state:0
747 msgid "State"
748 msgstr ""
749@@ -49,7 +37,7 @@
750
751 #. module: l10n_es_aeat
752 #: selection:l10n.es.aeat.report,type:0
753-msgid "Normal"
754+msgid "Complementary"
755 msgstr ""
756
757 #. module: l10n_es_aeat
758@@ -68,8 +56,8 @@
759 msgstr ""
760
761 #. module: l10n_es_aeat
762-#: field:l10n.es.aeat.report,fiscalyear_id:0
763-msgid "Fical Year"
764+#: help:l10n.es.aeat.report,representative_vat:0
765+msgid "Legal Representative VAT number."
766 msgstr ""
767
768 #. module: l10n_es_aeat
769@@ -78,13 +66,27 @@
770 msgstr ""
771
772 #. module: l10n_es_aeat
773-#: field:account.invoice,origin_invoices_ids:0
774-msgid "Refund invoice"
775-msgstr ""
776-
777-#. module: l10n_es_aeat
778-#: help:l10n.es.aeat.report,representative_vat:0
779-msgid "Legal Representative VAT number."
780+#: field:l10n.es.aeat.report,company_vat:0
781+msgid "VAT number"
782+msgstr ""
783+
784+#. module: l10n_es_aeat
785+#: code:addons/l10n_es_aeat/aeat_report.py:109
786+#, python-format
787+msgid "Only reports in 'draft' or 'cancel' state can be removed"
788+msgstr ""
789+
790+#. module: l10n_es_aeat
791+#: code:addons/l10n_es_aeat/wizard/export_to_boe.py:199
792+#, python-format
793+msgid "%Y-%m-%d"
794+msgstr ""
795+
796+#. module: l10n_es_aeat
797+#: code:addons/l10n_es_aeat/wizard/export_to_boe.py:109
798+#: code:addons/l10n_es_aeat/wizard/export_to_boe.py:147
799+#, python-format
800+msgid "The formated string must match the given length"
801 msgstr ""
802
803 #. module: l10n_es_aeat
804@@ -93,14 +95,19 @@
805 msgstr ""
806
807 #. module: l10n_es_aeat
808-#: help:account.invoice,origin_invoices_ids:0
809-msgid "Links to original invoice which is referred by current refund invoice"
810-msgstr ""
811-
812-#. module: l10n_es_aeat
813-#: model:ir.model,name:l10n_es_aeat.model_l10n_es_aeat
814-#: model:ir.module.module,shortdesc:l10n_es_aeat.module_meta_information
815-msgid "AEAT Base"
816+#: field:l10n.es.aeat.report,attach_id:0
817+msgid "BOE file"
818+msgstr ""
819+
820+#. module: l10n_es_aeat
821+#: code:addons/l10n_es_aeat/aeat_report.py:109
822+#, python-format
823+msgid "Error!"
824+msgstr ""
825+
826+#. module: l10n_es_aeat
827+#: field:l10n.es.aeat.report,fiscalyear_id:0
828+msgid "Fiscal Year"
829 msgstr ""
830
831 #. module: l10n_es_aeat
832@@ -109,8 +116,8 @@
833 msgstr ""
834
835 #. module: l10n_es_aeat
836-#: field:l10n.es.aeat.report,calculation_date:0
837-msgid "Calculation date"
838+#: selection:l10n.es.aeat.report,state:0
839+msgid "Processed"
840 msgstr ""
841
842 #. module: l10n_es_aeat
843@@ -119,44 +126,11 @@
844 msgstr ""
845
846 #. module: l10n_es_aeat
847-#: field:l10n.es.aeat.report,company_vat:0
848-msgid "VAT number"
849-msgstr ""
850-
851-#. module: l10n_es_aeat
852-#: code:addons/l10n_es_aeat/aeat_report.py:107
853-#, python-format
854-msgid "Only reports in 'draft' or 'cancel' state can be removed"
855-msgstr ""
856-
857-#. module: l10n_es_aeat
858 #: selection:l10n.es.aeat.report,support_type:0
859 msgid "Telematics"
860 msgstr ""
861
862 #. module: l10n_es_aeat
863-#: code:addons/l10n_es_aeat/aeat_report.py:107
864-#, python-format
865-msgid "Error!"
866-msgstr ""
867-
868-#. module: l10n_es_aeat
869-#: field:l10n.es.aeat.report,fiscalyear_id:0
870-msgid "Fiscal Year"
871-msgstr ""
872-
873-#. module: l10n_es_aeat
874-#: field:l10n.es.aeat.report,number:0
875-msgid "Declaration Number"
876-msgstr ""
877-
878-#. module: l10n_es_aeat
879-#: code:addons/l10n_es_aeat/wizard/export_to_boe.py:100
880-#, python-format
881-msgid "Wrong aling option. It should be < or >"
882-msgstr ""
883-
884-#. module: l10n_es_aeat
885 #: model:ir.ui.menu,name:l10n_es_aeat.menu_root_aeat
886 msgid "AEAT Reports"
887 msgstr ""
888@@ -168,7 +142,12 @@
889
890 #. module: l10n_es_aeat
891 #: selection:l10n.es.aeat.report,type:0
892-msgid "Complementary"
893+msgid "Normal"
894+msgstr ""
895+
896+#. module: l10n_es_aeat
897+#: field:l10n.es.aeat.report,number:0
898+msgid "Declaration Number"
899 msgstr ""
900
901 #. module: l10n_es_aeat
902@@ -177,16 +156,24 @@
903 msgstr ""
904
905 #. module: l10n_es_aeat
906+#: code:addons/l10n_es_aeat/wizard/export_to_boe.py:105
907+#, python-format
908+msgid "Wrong aling option. It should be < or >"
909+msgstr ""
910+
911+#. module: l10n_es_aeat
912 #: selection:l10n.es.aeat.report,state:0
913 msgid "Done"
914 msgstr ""
915
916 #. module: l10n_es_aeat
917-#: model:ir.model,name:l10n_es_aeat.model_account_invoice
918-msgid "Invoice"
919+#: code:addons/l10n_es_aeat/wizard/export_to_boe.py:199
920+#, python-format
921+msgid "%s_report_%s.txt"
922 msgstr ""
923
924 #. module: l10n_es_aeat
925-#: selection:l10n.es.aeat.report,state:0
926-msgid "Processed"
927+#: field:l10n.es.aeat.report,calculation_date:0
928+msgid "Calculation date"
929 msgstr ""
930+
931
932=== added file 'l10n_es_aeat/security/aeat_security.xml'
933--- l10n_es_aeat/security/aeat_security.xml 1970-01-01 00:00:00 +0000
934+++ l10n_es_aeat/security/aeat_security.xml 2013-11-11 18:29:02 +0000
935@@ -0,0 +1,12 @@
936+<?xml version="1.0"?>
937+<openerp>
938+<data>
939+
940+ <record model="res.groups" id="group_account_aeat">
941+ <field name="name">AEAT Manager</field>
942+ <field name="category_id" ref="base.module_category_accounting_and_finance"/>
943+ </record>
944+
945+</data>
946+</openerp>
947+
948
949=== modified file 'l10n_es_aeat/security/ir.model.access.csv'
950--- l10n_es_aeat/security/ir.model.access.csv 2011-03-04 17:52:36 +0000
951+++ l10n_es_aeat/security/ir.model.access.csv 2013-11-11 18:29:02 +0000
952@@ -1,3 +1,2 @@
953-"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink"
954-"access_l10n_es_aeat_report","l10n.es.aeat.report","model_l10n_es_aeat_report","account.group_account_user",1,0,0,0
955-"access_l10n_es_aeat_report_manager","l10n.es.aeat.report manager","model_l10n_es_aeat_report","account.group_account_manager",1,1,1,1
956\ No newline at end of file
957+id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
958+access_l10n_es_aeat_report_manager,l10n.es.aeat.report manager,model_l10n_es_aeat_report,group_account_aeat,1,1,1,1
959
960=== modified file 'l10n_es_aeat/wizard/export_to_boe.py'
961--- l10n_es_aeat/wizard/export_to_boe.py 2012-09-08 15:32:47 +0000
962+++ l10n_es_aeat/wizard/export_to_boe.py 2013-11-11 18:29:02 +0000
963@@ -3,6 +3,11 @@
964 #
965 # Copyright (C) 2004-2011
966 # Pexego Sistemas Informáticos. (http://pexego.es) All Rights Reserved
967+# Luis Manuel Angueira Blanco (Pexego)
968+#
969+# Copyright (C) 2013
970+# Ignacio Ibeas - Acysos S.L. (http://acysos.com) All Rights Reserved
971+# Migración a OpenERP 7.0
972 #
973 # This program is free software: you can redistribute it and/or modify
974 # it under the terms of the GNU Affero General Public License as
975@@ -19,20 +24,20 @@
976 #
977 ##############################################################################
978
979-__author__ = "Luis Manuel Angueira Blanco (Pexego)"
980-
981
982 import base64
983 import time
984
985-from tools.translate import _
986-from osv import osv
987-
988-
989-class l10n_es_aeat_report_export_to_boe(osv.osv_memory):
990+from openerp.osv import orm, fields
991+from openerp.tools.translate import _
992+from openerp.tools import DEFAULT_SERVER_DATE_FORMAT
993+
994+
995+class l10n_es_aeat_report_export_to_boe(orm.TransientModel):
996 _name = "l10n.es.aeat.report.export_to_boe"
997 _description = "Export Report to BOE Format"
998
999+
1000 ########################
1001 ### HELPER FUNCTIONS ###
1002 ########################
1003@@ -41,11 +46,13 @@
1004 Formats the string into a fixed length ASCII (iso-8859-1) record.
1005
1006 Note:
1007- 'Todos los campos alfanuméricos y alfabéticos se presentarán alineados a la izquierda y
1008- rellenos de blancos por la derecha, en mayúsculas sin caracteres especiales, y sin vocales acentuadas.
1009- Para los caracteres específicos del idioma se utilizará la codificación ISO-8859-1. De esta
1010- forma la letra “Ñ” tendrá el valor ASCII 209 (Hex. D1) y la “Ç”(cedilla mayúscula) el valor ASCII
1011- 199 (Hex. C7).'
1012+ 'Todos los campos alfanuméricos y alfabéticos se presentarán
1013+ alineados a la izquierda y rellenos de blancos por la derecha,
1014+ en mayúsculas sin caracteres especiales, y sin vocales acentuadas.
1015+ Para los caracteres específicos del idioma se utilizará la
1016+ codificación ISO-8859-1. De esta forma la letra “Ñ” tendrá el
1017+ valor ASCII 209 (Hex. D1) y la “Ç”(cedilla mayúscula) el valor
1018+ ASCII 199 (Hex. C7).'
1019 """
1020
1021 if not text:
1022@@ -92,22 +99,26 @@
1023 if len(ascii_string) > length:
1024 ascii_string = ascii_string[:length]
1025 # Format the string
1026- #ascii_string = '{0:{1}{2}{3}s}'.format(ascii_string, fill, align, length) #for python >= 2.6
1027+ #ascii_string = '{0:{1}{2}{3}s}'.format(ascii_string, fill, align,
1028+ # length) #for python >= 2.6
1029 if align == '<':
1030- ascii_string = str(ascii_string) + (length-len(str(ascii_string)))*fill
1031+ ascii_string = str(ascii_string) + \
1032+ (length-len(str(ascii_string)))*fill
1033 elif align == '>':
1034- ascii_string = (length-len(str(ascii_string)))*fill + str(ascii_string)
1035+ ascii_string = (length-len(str(ascii_string)))* \
1036+ fill + str(ascii_string)
1037 else:
1038 assert False, _('Wrong aling option. It should be < or >')
1039
1040 # Sanity-check
1041 assert len(ascii_string) == length, \
1042- _("The formated string must match the given length")
1043+ _("The formated string must match the given length")
1044 # Return string
1045 return ascii_string
1046
1047
1048- def _formatNumber(self, number, int_length, dec_length=0, include_sign=False):
1049+ def _formatNumber(self, number, int_length, dec_length=0,
1050+ include_sign=False):
1051 """
1052 Formats the number into a fixed length ASCII (iso-8859-1) record.
1053 Note:
1054@@ -116,7 +127,8 @@
1055 (http://www.boe.es/boe/dias/2008/10/23/pdfs/A42154-42190.pdf)
1056 """
1057 #
1058- # Separate the number parts (-55.23 => int_part=55, dec_part=0.23, sign='N')
1059+ # Separate the number parts (-55.23 => int_part=55,
1060+ # dec_part=0.23, sign='N')
1061 #
1062 if number == '':
1063 number = 0.0
1064@@ -133,14 +145,15 @@
1065 ascii_string += sign
1066
1067 if dec_length > 0:
1068- ascii_string += '%0*.*f' % (int_length+dec_length+1,dec_length, number)
1069+ ascii_string += '%0*.*f' % (int_length+ \
1070+ dec_length+1,dec_length, number)
1071 ascii_string = ascii_string.replace('.','')
1072 elif int_length > 0:
1073 ascii_string += '%.*d' % (int_length, int_part)
1074
1075 # Sanity-check
1076- assert len(ascii_string) == (include_sign and 1 or 0) + int_length + dec_length, \
1077- _("The formated string must match the given length")
1078+ assert len(ascii_string) == (include_sign and 1 or 0) + int_length + \
1079+ dec_length, _("The formated string must match the given length")
1080 # Return the string
1081 return ascii_string
1082
1083@@ -182,7 +195,8 @@
1084 ##
1085 ## Add the partner records
1086 for partner_record in report.partner_record_ids:
1087- file_contents += self._get_formated_partner_record(report, partner_record)
1088+ file_contents += self._get_formated_partner_record(report,
1089+ partner_record)
1090
1091 ##
1092 ## Adds other fields
1093@@ -192,7 +206,18 @@
1094 ## Generate the file and save as attachment
1095 file = base64.encodestring(file_contents)
1096
1097- file_name = _("%s_report_%s.txt") % (model, time.strftime(_("%Y-%m-%d")))
1098+ file_name = _("%s_report_%s.txt") % \
1099+ (model,time.strftime(_(DEFAULT_SERVER_DATE_FORMAT)))
1100+
1101+ # Delete old files
1102+ obj_attachment = self.pool.get('ir.attachment')
1103+ attachment_ids = obj_attachment.search(
1104+ cr, uid, [('name', '=', file_name),
1105+ ('res_model', '=', report._model._name)]
1106+ )
1107+ if len(attachment_ids):
1108+ obj_attachment.unlink(cr, uid, attachment_ids)
1109+
1110 self.pool.get("ir.attachment").create(cr, uid, {
1111 "name" : file_name,
1112 "datas" : file,
1113@@ -200,5 +225,10 @@
1114 "res_model" : "l10n.es.aeat.mod%s.report" % model,
1115 "res_id" : ids and ids[0]
1116 }, context=context)
1117+
1118+ mod_obj = self.pool.get(report._model._name)
1119+ mod_obj.write(cr,uid,[report.id],{'attach_id':attach_id},context)
1120+
1121+ return True
1122
1123 l10n_es_aeat_report_export_to_boe()