Merge lp:~pexego/openerp-spain/6.1_account_balance_reporting_imp into lp:~openerp-spain-team/openerp-spain/6.1

Proposed by Omar (Pexego)
Status: Needs review
Proposed branch: lp:~pexego/openerp-spain/6.1_account_balance_reporting_imp
Merge into: lp:~openerp-spain-team/openerp-spain/6.1
Diff against target: 1982 lines (+602/-526)
10 files modified
account_balance_reporting/__init__.py (+5/-7)
account_balance_reporting/__openerp__.py (+24/-31)
account_balance_reporting/account_balance_reporting.py (+260/-117)
account_balance_reporting/account_balance_reporting_template.py (+58/-54)
account_balance_reporting/account_balance_reporting_view.xml (+14/-7)
account_balance_reporting/i18n/account_balance_reporting.pot (+95/-95)
account_balance_reporting/i18n/es.po (+113/-175)
account_balance_reporting/report/__init__.py (+4/-5)
account_balance_reporting/wizard/__init__.py (+3/-4)
account_balance_reporting/wizard/wizard_print.py (+26/-31)
To merge this branch: bzr merge lp:~pexego/openerp-spain/6.1_account_balance_reporting_imp
Reviewer Review Type Date Requested Status
Pedro Manuel Baeza Needs Resubmitting
Alejandro Santana test Needs Fixing
Review via email: mp+219525@code.launchpad.net

Description of the change

Se permite filtran por fechas los informes de la misma forma que ya se podía por periodos y se permite hacer un desglose por nivel en el informe.

To post a comment you must log in.
397. By Omar (Pexego)

[UPD] account_balance_reporting: Actualizamos la licencia a AGPL

Revision history for this message
Pedro Manuel Baeza (pedro.baeza) wrote :
Download full text (4.9 KiB)

Buenas, Omar,

Muchas gracias por la mejora aportada. Cuando terminemos de refinarla, la llevaré también a la versión 7.

Te hago una primera revisión mirando código, y luego la probaré funcionalmente:

- ¿Por qué el filtro de fechas se añade al de periodos en lugar de ser excluyentes (mediante un selection o similar), como los de los informes financieros? No veo ningún caso de uso en el que haga falta filtrar por los dos a la vez. Es más, eso puede provocar confusión al usuario, ya que puede dar con una combinación de filtros de periodos y de fechas que saque datos distintos a si lo hiciera por separado (debido a las diferencias que pueden haber a veces de fechas y periodos en los asientos de proveedor).

- He visto que has mejorado bastante la convención PEP8 en el código Python, pero todavía quedan algunas cosas que corregir, por lo que te paso la salida de errores que me da un comprobador del mismo (flake8), que ya que estamos estaría bien corregir:

account_balance_reporting.py:86:9: E128 continuation line under-indented for visual indent
account_balance_reporting.py:87:9: E128 continuation line under-indented for visual indent
account_balance_reporting.py:88:9: E128 continuation line under-indented for visual indent
account_balance_reporting.py:96:9: E128 continuation line under-indented for visual indent
account_balance_reporting.py:97:9: E128 continuation line under-indented for visual indent
account_balance_reporting.py:98:9: E128 continuation line under-indented for visual indent
account_balance_reporting.py:156:46: E128 continuation line under-indented for visual indent
account_balance_reporting.py:233:9: E122 continuation line missing indentation or outdented
account_balance_reporting.py:234:9: E122 continuation line missing indentation or outdented
account_balance_reporting.py:298:49: E128 continuation line under-indented for visual indent
account_balance_reporting.py:318:49: E128 continuation line under-indented for visual indent
account_balance_reporting.py:542:9: F841 local variable 'child_ids' is assigned to but never used
account_balance_reporting_template.py:30:28: E231 missing whitespace after ','
account_balance_reporting_template.py:33:80: E501 line too long (104 > 79 characters)
account_balance_reporting_template.py:39:80: E501 line too long (119 > 79 characters)
account_balance_reporting_template.py:42:80: E501 line too long (84 > 79 characters)
account_balance_reporting_template.py:48:26: E231 missing whitespace after ','
account_balance_reporting_template.py:55:1: E302 expected 2 blank lines, found 1
account_balance_reporting_template.py:72:29: E126 continuation line over-indented for hanging indent
account_balance_reporting_template.py:76:29: E126 continuation line over-indented for hanging indent
account_balance_reporting_template.py:98:21: E126 continuation line over-indented for hanging indent
account_balance_reporting_template.py:98:36: E225 missing whitespace around operator
account_balance_reporting_template.py:99:36: E261 at least two spaces before inline comment
account_balance_reporting_template.py:104:17: E126 continuation line over-indented for hanging indent
account_balance_reporting_template.py:108:21: ...

Read more...

review: Needs Fixing (code review)
398. By Omar (Pexego)

[UPD] account_balance_reporting: Actualizamos pep8

Revision history for this message
Omar (Pexego) (omar7r) wrote :

Hola Pedro,

Ya está adaptado todo el código a Pep8.

Sobre cambiar de checkboxes a un selection, no lo veo apropiado al menos en está versión, quizás se podría hacer para futuras versiones, porque se cambiaría la estructura de la tabla, perdiendo información los informes que ya se tengan creados.

Un saludo

Revision history for this message
Alejandro Santana (alejandrosantana) wrote :
Download full text (3.9 KiB)

Hola, Omar.

Genial el cambio.

Lo estoy probando y tengo 1 error, 1 duda y 2 sugerencias menores.
Por mí, en cuanto se corrija el error (seguro que no es complicado), aceptaré la propuesta. Aparte, valorar las dudas y sugerencias para un próximo MP.

1) ERROR:
Sólo me da error en una situación concreta:
Cuando no hay líneas distintas de 0 en el periodo o fecha seleccionado e intento imprimir en formato "Informe balance genérico (sin líneasa cero)", da el siguiente error:
-------------------------------------
2014-06-06 15:27:45,808 14015 ERROR ? openerp.service.web_services: Exception:
Traceback (most recent call last):
  File "/mnt/workZone/openerp/openerp_61_ocb_devel/ocb-server/openerp/service/web_services.py", line 727, in go
    (result, format) = obj.create(cr, uid, ids, datas, context)
  File "/mnt/workZone/openerp/openerp_61_ocb_devel/ocb-server/openerp/report/report_sxw.py", line 440, in create
    fnct_ret = fnct(cr, uid, ids, data, report_xml, context)
  File "/mnt/workZone/openerp/openerp_61_ocb_devel/ocb-server/openerp/report/report_sxw.py", line 509, in create_source_pdf
    return self.create_single_pdf(cr, uid, ids, data, report_xml, context)
  File "/mnt/workZone/openerp/openerp_61_ocb_devel/ocb-server/openerp/report/report_sxw.py", line 531, in create_single_pdf
    pdf = create_doc(etree.tostring(processed_rml),rml_parser.localcontext,logo,title.encode('utf8'))
  File "/mnt/workZone/openerp/openerp_61_ocb_devel/ocb-server/openerp/report/interface.py", line 207, in create_pdf
    obj.render()
  File "/mnt/workZone/openerp/openerp_61_ocb_devel/ocb-server/openerp/report/render/render.py", line 59, in render
    self._result = self._render()
  File "/mnt/workZone/openerp/openerp_61_ocb_devel/ocb-server/openerp/report/render/rml.py", line 41, in _render
    return rml2pdf.parseNode(self.rml, self.localcontext, images=self.bin_datas, path=self.path,title=self.title)
  File "/mnt/workZone/openerp/openerp_61_ocb_devel/ocb-server/openerp/report/render/rml2pdf/trml2pdf.py", line 1016, in parseNode
    r.render(fp)
  File "/mnt/workZone/openerp/openerp_61_ocb_devel/ocb-server/openerp/report/render/rml2pdf/trml2pdf.py", line 314, in render
    pt_obj.render(el)
  File "/mnt/workZone/openerp/openerp_61_ocb_devel/ocb-server/openerp/report/render/rml2pdf/trml2pdf.py", line 992, in render
    fis += r.render(node_story)
  File "/mnt/workZone/openerp/openerp_61_ocb_devel/ocb-server/openerp/report/render/rml2pdf/trml2pdf.py", line 886, in render
    return process_story(node_story)
  File "/mnt/workZone/openerp/openerp_61_ocb_devel/ocb-server/openerp/report/render/rml2pdf/trml2pdf.py", line 879, in process_story
    flow = self._flowable(node)
  File "/mnt/workZone/openerp/openerp_61_ocb_devel/ocb-server/openerp/report/render/rml2pdf/trml2pdf.py", line 802, in _flowable
    return self._table(node)
  File "/mnt/workZone/openerp/openerp_61_ocb_devel/ocb-server/openerp/report/render/rml2pdf/trml2pdf.py", line 697, in _table
    assert length == len(node.get('colWidths').split(','))
AssertionError
2014-06-06 15:27:45,969 14015 ERROR ? openerp.netsvc:
(<type 'exceptions.AssertionError'>, AssertionError(), <traceback object at 0x7f517b61c128>...

Read more...

review: Needs Fixing (test)
Revision history for this message
Alejandro Santana (alejandrosantana) wrote :

Hola, Omar.
He corregiso el error del informe sin líneas a cero cuando no hay líneas diferentes a cero.
El MP:
https://code.launchpad.net/~alejandrosantana/openerp-spain/6.1_account_balance_reporting_imp_fix_report_non_zero/+merge/223536

Revision history for this message
Omar (Pexego) (omar7r) wrote :

Perfecto Alejandro,

Estuve de vacaciones hasta ayer y no lo mirara todavía, en cuanto saque un momento pruebo el merge.

Un saludo

Revision history for this message
Alejandro Santana (alejandrosantana) wrote :

Por cierto, ¿quién lo va a portar a v7/v8?
¿Hay trabajo hecho? ¿Se le quiere dar una vuelta?
Nosotros podemos intentarlo, porque lo vamos a necesitar en unas semanas.

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

El proyecto está hospedado ahora en https://github.com/OCA/l10n-spain.

Mueve por favor tu propuesta allí. Esta guía puede ayudarte: https://github.com/OCA/maintainers-tools/wiki/How-to-move-a-Merge-Proposal-to-GitHub

Un saludo.

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

Alejandro, ¿llegaste a portar algo de esto?

Omar, ¿podéis repetir la propuesta de inclusión en Github?

Revision history for this message
Alejandro Santana (alejandrosantana) wrote :

El cliente se cayó y el trabajo quedó a medias. Me gustaría retomarlo yo cuando vuelva (hasta finales de noviembre apenas estoy para apagar fuegos) y ver dónde lo dejaron.

Unmerged revisions

398. By Omar (Pexego)

[UPD] account_balance_reporting: Actualizamos pep8

397. By Omar (Pexego)

[UPD] account_balance_reporting: Actualizamos la licencia a AGPL

396. By Omar (Pexego)

[REF] account_balance_reporting: PEP8 y traducciones

395. By Omar (Pexego)

[IMP] account_balance_reporting: Añadimos la posibilidad de filtrar entre fechas y desglosar por niveles al calcular los informes

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'account_balance_reporting/__init__.py'
2--- account_balance_reporting/__init__.py 2014-01-10 10:36:59 +0000
3+++ account_balance_reporting/__init__.py 2014-05-26 16:36:55 +0000
4@@ -1,16 +1,14 @@
5 # -*- coding: utf-8 -*-
6-# -*- encoding: utf-8 -*-
7 ##############################################################################
8 #
9 # OpenERP - Account balance reporting engine
10 # Copyright (C) 2009 Pexego Sistemas Informáticos. All Rights Reserved
11-# AvanzOSC, Avanzed Open Source Consulting
12-# Copyright (C) 2011-2012 Iker Coranti (www.avanzosc.com). All Rights Reserved
13-# $Id$
14+# AvanzOSC, Avanzed Open Source Consulting
15+# Copyright (C) 2011-2012 Iker Coranti (www.avanzosc.com).
16 #
17 # This program is free software: you can redistribute it and/or modify
18-# it under the terms of the GNU General Public License as published by
19-# the Free Software Foundation, either version 3 of the License, or
20+# it under the terms of the GNU Affero General Public License as published
21+# by the Free Software Foundation, either version 3 of the License, or
22 # (at your option) any later version.
23 #
24 # This program is distributed in the hope that it will be useful,
25@@ -18,7 +16,7 @@
26 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
27 # GNU General Public License for more details.
28 #
29-# You should have received a copy of the GNU General Public License
30+# You should have received a copy of the GNU Affero General Public License
31 # along with this program. If not, see <http://www.gnu.org/licenses/>.
32 #
33 ##############################################################################
34
35=== modified file 'account_balance_reporting/__openerp__.py'
36--- account_balance_reporting/__openerp__.py 2014-01-10 10:36:59 +0000
37+++ account_balance_reporting/__openerp__.py 2014-05-26 16:36:55 +0000
38@@ -1,16 +1,14 @@
39 # -*- coding: utf-8 -*-
40-# -*- encoding: utf-8 -*-
41 ##############################################################################
42 #
43 # OpenERP - Account balance reporting engine
44 # Copyright (C) 2009 Pexego Sistemas Informáticos. All Rights Reserved
45-# AvanzOSC, Avanzed Open Source Consulting
46-# Copyright (C) 2011-2012 Iker Coranti (www.avanzosc.com). All Rights Reserved
47-# $Id$
48+# AvanzOSC, Avanzed Open Source Consulting
49+# Copyright (C) 2011-2012 Iker Coranti (www.avanzosc.com).
50 #
51 # This program is free software: you can redistribute it and/or modify
52-# it under the terms of the GNU General Public License as published by
53-# the Free Software Foundation, either version 3 of the License, or
54+# it under the terms of the GNU Affero General Public License as published
55+# by the Free Software Foundation, either version 3 of the License, or
56 # (at your option) any later version.
57 #
58 # This program is distributed in the hope that it will be useful,
59@@ -18,24 +16,24 @@
60 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
61 # GNU General Public License for more details.
62 #
63-# You should have received a copy of the GNU General Public License
64+# You should have received a copy of the GNU Affero General Public License
65 # along with this program. If not, see <http://www.gnu.org/licenses/>.
66 #
67 ##############################################################################
68
69 {
70- "name" : "Account balance reporting engine",
71- "version" : "0.3",
72- "author" : "Pexego",
73- "website" : "http://www.pexego.es",
74- "category" : "Enterprise Specific Modules",
75- "description": """
76+ "name": "Account balance reporting engine",
77+ "version": "0.3",
78+ "author": "Pexego",
79+ "website": "http://www.pexego.es",
80+ "category": "Enterprise Specific Modules",
81+ "description": """
82 The module allows the user to create account balance reports and templates,
83 comparing the values of 'accounting concepts' between two fiscal years
84 or a set of fiscal periods.
85
86-Accounting concepts values can be calculated as the sum of some account balances,
87-the sum of its children, other account concepts or constant values.
88+Accounting concepts values can be calculated as the sum of some account
89+balances, the sum of its children, other account concepts or constant values.
90
91 Generated reports are stored as objects on the server,
92 so you can check them anytime later or edit them
93@@ -51,20 +49,15 @@
94 Note: It has been designed to meet Spanish/Spain localization needs,
95 but it might be used as a generic accounting report engine.
96 """,
97- "depends" : [
98- 'base',
99- 'account',
100- ],
101- "init_xml" : [
102- ],
103- "demo_xml" : [ ],
104- "update_xml" : [
105- 'security/ir.model.access.csv',
106- 'account_balance_reporting_wizard.xml',
107- 'account_balance_reporting_template_view.xml',
108- 'account_balance_reporting_view.xml',
109- 'account_balance_reporting_workflow.xml',
110- 'account_balance_reporting_reports.xml',
111- ],
112- "installable": True
113+ "depends": ['base',
114+ 'account'],
115+ "init_xml": [],
116+ "demo_xml": [],
117+ "update_xml": ['security/ir.model.access.csv',
118+ 'account_balance_reporting_wizard.xml',
119+ 'account_balance_reporting_template_view.xml',
120+ 'account_balance_reporting_view.xml',
121+ 'account_balance_reporting_workflow.xml',
122+ 'account_balance_reporting_reports.xml'],
123+ "installable": True
124 }
125
126=== modified file 'account_balance_reporting/account_balance_reporting.py'
127--- account_balance_reporting/account_balance_reporting.py 2014-01-10 10:36:59 +0000
128+++ account_balance_reporting/account_balance_reporting.py 2014-05-26 16:36:55 +0000
129@@ -6,8 +6,8 @@
130 # $Id$
131 #
132 # This program is free software: you can redistribute it and/or modify
133-# it under the terms of the GNU General Public License as published by
134-# the Free Software Foundation, either version 3 of the License, or
135+# it under the terms of the GNU Affero General Public License as published
136+# by the Free Software Foundation, either version 3 of the License, or
137 # (at your option) any later version.
138 #
139 # This program is distributed in the hope that it will be useful,
140@@ -15,7 +15,7 @@
141 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
142 # GNU General Public License for more details.
143 #
144-# You should have received a copy of the GNU General Public License
145+# You should have received a copy of the GNU Affero General Public License
146 # along with this program. If not, see <http://www.gnu.org/licenses/>.
147 #
148 ##############################################################################
149@@ -26,7 +26,7 @@
150 Designed following the needs of the
151 Spanish/Spain localization.
152 """
153-from openerp.osv import orm,fields
154+from openerp.osv import orm, fields
155 from openerp.tools.translate import _
156 import re
157 import time
158@@ -34,8 +34,9 @@
159 import logging
160
161 # CSS classes for the account line templates
162-CSS_CLASSES = [('default','Default'),('l1', 'Level 1'), ('l2', 'Level 2'),
163- ('l3', 'Level 3'), ('l4', 'Level 4'), ('l5', 'Level 5')]
164+CSS_CLASSES = [('default', 'Default'), ('l1', 'Level 1'), ('l2', 'Level 2'),
165+ ('l3', 'Level 3'), ('l4', 'Level 4'), ('l5', 'Level 5')]
166+
167
168 class account_balance_reporting(orm.Model):
169 """
170@@ -46,48 +47,69 @@
171 """
172 _name = "account.balance.reporting"
173
174+ READONLY_STATES = {'calc_done': [('readonly', True)],
175+ 'done': [('readonly', True)]}
176+
177+ def _get_levels(self, cr, uid, context=None):
178+ cr.execute("select distinct level from account_account order by level")
179+ reg = cr.fetchall()
180+ res = [(str(x[0]), str(x[0])) for x in reg if x[0]]
181+ return res
182+
183 _columns = {
184 'name': fields.char('Name', size=64, required=True, select=True),
185 'template_id': fields.many2one('account.balance.reporting.template',
186- 'Template', ondelete='set null', required=True, select=True,
187- states={'calc_done': [('readonly', True)],
188- 'done': [('readonly', True)]}),
189+ 'Template', ondelete='set null',
190+ required=True, select=True,
191+ states=READONLY_STATES),
192 'calc_date': fields.datetime("Calculation date", readonly=True),
193- 'state': fields.selection([('draft','Draft'),
194- ('calc','Processing'),
195- ('calc_done','Processed'),
196- ('done','Done'),
197- ('canceled','Canceled')], 'State'),
198+ 'state': fields.selection([('draft', 'Draft'),
199+ ('calc', 'Processing'),
200+ ('calc_done', 'Processed'),
201+ ('done', 'Done'),
202+ ('canceled', 'Canceled')], 'State'),
203 'company_id': fields.many2one('res.company', 'Company',
204- ondelete='cascade', required=True, readonly=True,
205- states={'draft': [('readonly', False)]}),
206+ ondelete='cascade', required=True,
207+ readonly=True, states=READONLY_STATES),
208+ 'check_periods': fields.boolean('Compute by periods',
209+ states=READONLY_STATES),
210+ 'check_dates': fields.boolean('Compute by dates',
211+ states=READONLY_STATES),
212+ 'level': fields.selection(_get_levels, string='Level',
213+ states=READONLY_STATES),
214 'current_fiscalyear_id': fields.many2one('account.fiscalyear',
215- 'Fiscal year 1', select=True, required=True,
216- states={'calc_done': [('readonly', True)],
217- 'done': [('readonly', True)]}),
218- 'current_period_ids': fields.many2many('account.period',
219- 'account_balance_reporting_account_period_current_rel',
220- 'account_balance_reporting_id', 'period_id',
221- 'Fiscal year 1 periods',
222- states={'calc_done': [('readonly', True)],
223- 'done': [('readonly', True)]}),
224+ 'Fiscal year 1', select=True,
225+ required=True,
226+ states=READONLY_STATES),
227+ 'current_period_ids':
228+ fields.many2many(
229+ 'account.period',
230+ 'account_balance_reporting_account_period_current_rel',
231+ 'account_balance_reporting_id', 'period_id',
232+ 'Fiscal year 1 periods', states=READONLY_STATES),
233+
234+ 'current_date_from': fields.date('Date From', states=READONLY_STATES),
235+ 'current_date_to': fields.date('Date To', states=READONLY_STATES),
236 'previous_fiscalyear_id': fields.many2one('account.fiscalyear',
237- 'Fiscal year 2', select=True,
238- states={'calc_done': [('readonly', True)],
239- 'done': [('readonly', True)]}),
240- 'previous_period_ids': fields.many2many('account.period',
241- 'account_balance_reporting_account_period_previous_rel',
242- 'account_balance_reporting_id', 'period_id',
243- 'Fiscal year 2 periods',
244- states={'calc_done': [('readonly', True)],
245- 'done': [('readonly', True)]}),
246+ 'Fiscal year 2', select=True,
247+ states=READONLY_STATES),
248+ 'previous_period_ids':
249+ fields.many2many(
250+ 'account.period',
251+ 'account_balance_reporting_account_period_previous_rel',
252+ 'account_balance_reporting_id',
253+ 'period_id', 'Fiscal year 2 periods', states=READONLY_STATES),
254+
255+ 'previous_date_from': fields.date('Date From', states=READONLY_STATES),
256+ 'previous_date_to': fields.date('Date To', states=READONLY_STATES),
257 'line_ids': fields.one2many('account.balance.reporting.line',
258 'report_id', 'Lines',
259- states = {'done': [('readonly', True)]}),
260+ states={'done': [('readonly', True)]}),
261 }
262
263 _defaults = {
264- 'company_id': lambda self, cr, uid, context: self.pool.get('res.users').browse(cr, uid, uid, context).company_id.id,
265+ 'company_id': lambda self, cr, uid, context:
266+ self.pool.get('res.users').browse(cr, uid, uid, context).company_id.id,
267 'state': 'draft',
268 }
269
270@@ -107,20 +129,21 @@
271 # Clear the report data (unlink the lines of detail)
272 line_obj.unlink(cr, uid, [line.id for line in report.line_ids],
273 context=context)
274- # Fill the report with a 'copy' of the lines of its template (if it has one)
275+ # Fill the report with a 'copy' of the lines
276+ # of its template (if it has one)
277 if report.template_id:
278 for template_line in report.template_id.line_ids:
279- line_obj.create(cr, uid, {
280- 'code': template_line.code,
281- 'name': template_line.name,
282- 'report_id': report.id,
283- 'template_line_id': template_line.id,
284- 'parent_id': None,
285- 'current_value': None,
286- 'previous_value': None,
287- 'sequence': template_line.sequence,
288- 'css_class': template_line.css_class,
289- }, context=context)
290+ line_obj.create(cr, uid,
291+ {'code': template_line.code,
292+ 'name': template_line.name,
293+ 'report_id': report.id,
294+ 'template_line_id': template_line.id,
295+ 'parent_id': None,
296+ 'current_value': None,
297+ 'previous_value': None,
298+ 'sequence': template_line.sequence,
299+ 'css_class': template_line.css_class},
300+ context=context)
301 # Set the parents of the lines in the report
302 # Note: We reload the reports objects to refresh the lines of detail.
303 for report in self.browse(cr, uid, ids, context=context):
304@@ -129,13 +152,16 @@
305 for line in report.line_ids:
306 tmpl_line = line.template_line_id
307 if tmpl_line and tmpl_line.parent_id:
308- parent_line_ids = line_obj.search(cr, uid,
309- [('report_id', '=', report.id),
310- ('code', '=', tmpl_line.parent_id.code)])
311- line_obj.write(cr, uid, line.id, {
312- 'parent_id': (parent_line_ids and
313- parent_line_ids[0] or False),
314- }, context=context)
315+ parent_line_ids = \
316+ line_obj.search(cr, uid,
317+ [('report_id', '=', report.id),
318+ ('code', '=',
319+ tmpl_line.parent_id.code)])
320+ line_obj.write(cr, uid, line.id,
321+ {'parent_id': (parent_line_ids and
322+ parent_line_ids[0] or
323+ False)},
324+ context=context)
325 # Calculate the values of the lines
326 # Note: We reload the reports objects to refresh the lines of detail.
327 for report in self.browse(cr, uid, ids, context=context):
328@@ -202,13 +228,14 @@
329 'code': fields.char('Code', size=64, required=True, select=True),
330 'name': fields.char('Name', size=256, required=True, select=True),
331 'notes': fields.text('Notes'),
332- 'current_value': fields.float('Fiscal year 1', digits=(16,2)),
333- 'previous_value': fields.float('Fiscal year 2', digits=(16,2)),
334+ 'current_value': fields.float('Fiscal year 1', digits=(16, 2)),
335+ 'previous_value': fields.float('Fiscal year 2', digits=(16, 2)),
336 'calc_date': fields.datetime("Calculation date"),
337 'css_class': fields.selection(CSS_CLASSES, 'CSS Class'),
338- 'template_line_id': fields.many2one(
339- 'account.balance.reporting.template.line',
340- 'Line template', ondelete='set null'),
341+ 'template_line_id':
342+ fields.many2one('account.balance.reporting.template.line',
343+ 'Line template', ondelete='set null'),
344+
345 'parent_id': fields.many2one('account.balance.reporting.line',
346 'Parent', ondelete='cascade'),
347 'child_ids': fields.one2many('account.balance.reporting.line',
348@@ -216,11 +243,12 @@
349 }
350
351 _defaults = {
352- 'report_id': lambda self, cr, uid, context: context.get('report_id', None),
353+ 'report_id':
354+ lambda self, cr, uid, context: context.get('report_id', None),
355 'css_class': 'default',
356 }
357
358- _order = "sequence, code"
359+ _order = "sequence asc, code asc"
360
361 _sql_constraints = [
362 ('report_code_uniq', 'unique(report_id, code)',
363@@ -239,13 +267,90 @@
364 """Redefine the method to allow searching by code."""
365 ids = []
366 if name:
367- ids = self.search(cr, uid, [('code','ilike',name)]+ args,
368+ ids = self.search(cr, uid, [('code', 'ilike', name)] + args,
369 limit=limit, context=context)
370 if not ids:
371- ids = self.search(cr, uid, [('name',operator,name)]+ args,
372+ ids = self.search(cr, uid, [('name', operator, name)] + args,
373 limit=limit, context=context)
374 return self.name_get(cr, uid, ids, context=context)
375
376+ def _create_child_lines(self, cr, uid, ids, code, bmode, fyear,
377+ context=None):
378+ acc_obj = self.pool.get('account.account')
379+ line = self.browse(cr, uid, ids[0], context=context)
380+ cont = 1000
381+ for acc_code in re.findall('(-?\w*\(?[0-9a-zA-Z_]*\)?)', code):
382+ # Check if the code is valid (findall might return empty strings)
383+ acc_code = acc_code.strip()
384+ if acc_code:
385+ sign, acc_code, mode, sign_mode = \
386+ self._get_code_sign_mode(acc_code, bmode)
387+
388+ # Search for the account (perfect match)
389+ account_ids = acc_obj.search(cr, uid,
390+ [('code', '=', acc_code),
391+ ('company_id', '=',
392+ line.report_id.company_id.id)],
393+ context=context)
394+
395+ for account in acc_obj.browse(cr, uid, account_ids,
396+ context=context):
397+ child_ids = acc_obj.search(cr, uid,
398+ [('id', 'child_of', account.id),
399+ ('level', '<=',
400+ line.report_id.level)],
401+ order="code asc")
402+ for child_account in acc_obj.browse(cr, uid, child_ids,
403+ context=context):
404+ value = 0.0
405+ if mode == 'debit':
406+ value -= child_account.debit * sign
407+ elif mode == 'credit':
408+ value += child_account.credit * sign
409+ else:
410+ value += child_account.balance * sign * sign_mode
411+
412+ line_ids = self.search(cr, uid,
413+ [('template_line_id', '=',
414+ line.template_line_id.id),
415+ ('name', '=',
416+ child_account.code +
417+ u": " +
418+ child_account.name),
419+ ('report_id', '=',
420+ line.report_id.id)])
421+ if not line_ids:
422+ line_id = self.create(cr, uid, {
423+ 'code': line.code + u"/" + str(cont),
424+ 'name': (child_account.code + u": " +
425+ child_account.name),
426+ 'report_id': line.report_id.id,
427+ 'template_line_id': line.template_line_id.id,
428+ 'parent_id': line.id,
429+ 'current_value': None,
430+ 'previous_value': None,
431+ 'sequence': line.sequence,
432+ 'css_class':
433+ (child_account.level and
434+ child_account.level < 5) and
435+ u'l' + str(child_account.level)
436+ or'default'
437+ }, context=context)
438+ cont += 1
439+ else:
440+ line_id = line_ids[0]
441+
442+ if line.template_line_id.negate:
443+ value = -value
444+ vals = {}
445+ if fyear == 'current':
446+ vals = {'current_value': value,
447+ 'calc_date': line.report_id.calc_date}
448+ elif fyear == 'previous':
449+ vals = {'previous_value': value,
450+ 'calc_date': line.report_id.calc_date}
451+ self.write(cr, uid, [line_id], vals, context=context)
452+
453 def refresh_values(self, cr, uid, ids, context=None):
454 """
455 Recalculates the values of this report line using the
456@@ -254,9 +359,11 @@
457 Depending on this formula the final value is calculated as follows:
458 - Empy report value: sum of (this concept) children values.
459 - Number with decimal point ("10.2"): that value (constant).
460- - Account numbers separated by commas ("430,431,(437)"): Sum of the account balances.
461+ - Account numbers separated by commas ("430,431,(437)"):
462+ Sum of the account balances.
463 (The sign of the balance depends on the balance mode)
464- - Concept codes separated by "+" ("11000+12000"): Sum of those concepts values.
465+ - Concept codes separated by "+" ("11000+12000"):
466+ Sum of those concepts values.
467 """
468 if context is None:
469 context = {}
470@@ -274,12 +381,13 @@
471 tmpl_value = tmpl_line.current_value
472 elif fyear == 'previous':
473 tmpl_value = (tmpl_line.previous_value or
474- tmpl_line.current_value)
475+ tmpl_line.current_value)
476 # Remove characters after a ";" (we use ; for comments)
477 if tmpl_value:
478 tmpl_value = tmpl_value.split(';')[0]
479 if (fyear == 'current' and not report.current_fiscalyear_id) \
480- or (fyear == 'previous' and not report.previous_fiscalyear_id):
481+ or (fyear == 'previous' and
482+ not report.previous_fiscalyear_id):
483 value = 0
484 else:
485 if not tmpl_value:
486@@ -307,15 +415,38 @@
487 if fyear == 'current':
488 ctx.update({
489 'fiscalyear': report.current_fiscalyear_id.id,
490- 'periods': [p.id for p in report.current_period_ids],
491 })
492 elif fyear == 'previous':
493 ctx.update({
494 'fiscalyear': report.previous_fiscalyear_id.id,
495- 'periods': [p.id for p in report.previous_period_ids],
496 })
497+ if line.report_id.check_dates:
498+ if fyear == 'current':
499+ ctx.update({
500+ 'date_from': report.current_date_from,
501+ 'date_to': report.current_date_to
502+ })
503+ elif fyear == 'previous':
504+ ctx.update({
505+ 'date_from': report.previous_date_from,
506+ 'date_to': report.previous_date_to
507+ })
508+ if line.report_id.check_periods:
509+ if fyear == 'current':
510+ ctx.update({
511+ 'periods':
512+ [p.id for p in report.current_period_ids]
513+ })
514+ elif fyear == 'previous':
515+ ctx.update({
516+ 'periods':
517+ [p.id for p in report.previous_period_ids]
518+ })
519 value = line._get_account_balance(tmpl_value,
520 balance_mode, ctx)
521+ if line.report_id.level:
522+ line._create_child_lines(tmpl_value, balance_mode,
523+ fyear, ctx)
524 elif re.match(r'^[\+\-0-9a-zA-Z_\*\ ]*$', tmpl_value):
525 # Account concept codes separated by "+" => sum of the
526 # concepts (template lines) values.
527@@ -323,20 +454,22 @@
528 tmpl_value):
529 sign = 1
530 if line_code.startswith('-') or \
531- (line_code.startswith('(') and
532+ (line_code.startswith('(') and
533 balance_mode in (2, 4)):
534 sign = -1
535 line_code = line_code.strip('-()*')
536 # findall might return empty strings
537 if line_code:
538 # Search for the line (perfect match)
539- line_ids = self.search(cr, uid, [
540- ('report_id','=', report.id),
541- ('code', '=', line_code),
542- ], context=context)
543+ line_ids = \
544+ self.search(cr, uid,
545+ [('report_id', '=', report.id),
546+ ('code', '=', line_code)],
547+ context=context)
548 for child in self.browse(cr, uid, line_ids,
549 context=context):
550- if child.calc_date != child.report_id.calc_date:
551+ if (child.calc_date !=
552+ child.report_id.calc_date):
553 child.refresh_values()
554 # Reload the child data
555 child = self.browse(cr, uid, child.id,
556@@ -353,13 +486,43 @@
557 elif fyear == 'previous':
558 previous_value = value
559 # Write the values
560- self.write(cr, uid, line.id, {
561- 'current_value': current_value,
562- 'previous_value': previous_value,
563- 'calc_date': line.report_id.calc_date,
564- }, context=context)
565+ self.write(cr, uid, line.id,
566+ {'current_value': current_value,
567+ 'previous_value': previous_value,
568+ 'calc_date': line.report_id.calc_date},
569+ context=context)
570 return True
571
572+ def _get_code_sign_mode(self, acc_code, balance_mode):
573+ # Check the sign of the code (substraction)
574+ if acc_code.startswith('-'):
575+ sign = -1
576+ acc_code = acc_code[1:].strip() # Strip the sign
577+ else:
578+ sign = 1
579+ if re.match(r'^debit\(.*\)$', acc_code):
580+ # Use debit instead of balance
581+ mode = 'debit'
582+ acc_code = acc_code[6:-1] # Strip debit()
583+ elif re.match(r'^credit\(.*\)$', acc_code):
584+ # Use credit instead of balance
585+ mode = 'credit'
586+ acc_code = acc_code[7:-1] # Strip credit()
587+ else:
588+ mode = 'balance'
589+ # Calculate sign of the balance mode
590+ sign_mode = 1
591+ if balance_mode in (1, 2, 3):
592+ # for accounts in brackets or mode 2, the sign is reversed
593+ if (acc_code.startswith('(') and acc_code.endswith(')')) \
594+ or balance_mode == 2:
595+ sign_mode = -1
596+ # Strip the brackets (if any)
597+ if acc_code.startswith('(') and acc_code.endswith(')'):
598+ acc_code = acc_code[1:-1]
599+
600+ return sign, acc_code, mode, sign_mode
601+
602 def _get_account_balance(self, cr, uid, ids, code, balance_mode=0,
603 context=None):
604 """
605@@ -373,12 +536,13 @@
606 Mode 2: credit-debit for all accounts;
607 Mode 3: credit-debit, debit-credit for accounts in brackets.
608
609- Also the user may specify to use only the debit or credit of the account
610+ Also the user may specify to use only the debit or credit of account
611 instead of the balance writing "debit(551)" or "credit(551)".
612 """
613 acc_obj = self.pool.get('account.account')
614 logger = logging.getLogger(__name__)
615 res = 0.0
616+
617 line = self.browse(cr, uid, ids[0], context=context)
618 company_id = line.report_id.company_id.id
619 # We iterate over the accounts listed in "code", so code can be
620@@ -388,46 +552,25 @@
621 # Check if the code is valid (findall might return empty strings)
622 acc_code = acc_code.strip()
623 if acc_code:
624- # Check the sign of the code (substraction)
625- if acc_code.startswith('-'):
626- sign = -1
627- acc_code = acc_code[1:].strip() # Strip the sign
628- else:
629- sign = 1
630- if re.match(r'^debit\(.*\)$', acc_code):
631- # Use debit instead of balance
632- mode = 'debit'
633- acc_code = acc_code[6:-1] # Strip debit()
634- elif re.match(r'^credit\(.*\)$', acc_code):
635- # Use credit instead of balance
636- mode = 'credit'
637- acc_code = acc_code[7:-1] # Strip credit()
638- else:
639- mode = 'balance'
640- # Calculate sign of the balance mode
641- sign_mode = 1
642- if balance_mode in (1, 2, 3):
643- # for accounts in brackets or mode 2, the sign is reversed
644- if (acc_code.startswith('(') and acc_code.endswith(')')) \
645- or balance_mode == 2:
646- sign_mode = -1
647- # Strip the brackets (if any)
648- if acc_code.startswith('(') and acc_code.endswith(')'):
649- acc_code = acc_code[1:-1]
650+ sign, acc_code, mode, sign_mode = \
651+ self._get_code_sign_mode(acc_code, balance_mode)
652 # Search for the account (perfect match)
653- account_ids = acc_obj.search(cr, uid, [
654- ('code', '=', acc_code),
655- ('company_id','=', company_id)
656- ], context=context)
657+ account_ids = acc_obj.search(cr, uid,
658+ [('code', '=', acc_code),
659+ ('company_id', '=', company_id)],
660+ context=context)
661 if not account_ids:
662 # Search for a subaccount ending with '0'
663- account_ids = acc_obj.search(cr, uid, [
664- ('code', '=like', '%s%%0' % acc_code),
665- ('company_id','=', company_id)
666- ], context=context)
667+ account_ids = acc_obj.search(cr, uid,
668+ [('code', '=like',
669+ '%s%%0' % acc_code),
670+ ('company_id', '=',
671+ company_id)],
672+ context=context)
673 if not account_ids:
674 logger.warning("Account with code '%s' not found!"
675- %acc_code)
676+ % acc_code)
677+
678 for account in acc_obj.browse(cr, uid, account_ids,
679 context=context):
680 if mode == 'debit':
681
682=== modified file 'account_balance_reporting/account_balance_reporting_template.py'
683--- account_balance_reporting/account_balance_reporting_template.py 2014-01-10 10:36:59 +0000
684+++ account_balance_reporting/account_balance_reporting_template.py 2014-05-26 16:36:55 +0000
685@@ -6,8 +6,8 @@
686 # $Id$
687 #
688 # This program is free software: you can redistribute it and/or modify
689-# it under the terms of the GNU General Public License as published by
690-# the Free Software Foundation, either version 3 of the License, or
691+# it under the terms of the GNU Affero General Public License as published
692+# by the Free Software Foundation, either version 3 of the License, or
693 # (at your option) any later version.
694 #
695 # This program is distributed in the hope that it will be useful,
696@@ -15,7 +15,7 @@
697 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
698 # GNU General Public License for more details.
699 #
700-# You should have received a copy of the GNU General Public License
701+# You should have received a copy of the GNU Affero General Public License
702 # along with this program. If not, see <http://www.gnu.org/licenses/>.
703 #
704 ##############################################################################
705@@ -27,31 +27,35 @@
706 Designed following the needs of the Spanish/Spain localization.
707 """
708
709-from openerp.osv import orm,fields
710+from openerp.osv import orm, fields
711 from openerp.tools.translate import _
712
713-_BALANCE_MODE_HELP = """Formula calculation mode: Depending on it, the balance is calculated as follows:
714+_BALANCE_MODE_HELP = """Formula calculation mode: Depending on it,
715+ the balance is calculated as follows:
716 Mode 0: debit-credit (default);
717 Mode 1: debit-credit, credit-debit for accounts in brackets;
718 Mode 2: credit-debit;
719 Mode 3: credit-debit, debit-credit for accounts in brackets."""
720
721-_VALUE_FORMULA_HELP = """Value calculation formula: Depending on this formula the final value is calculated as follows:
722+_VALUE_FORMULA_HELP = """Value calculation formula: Depending on this formula
723+ the final value is calculated as follows:
724 Empy template value: sum of (this concept) children values.
725 Number with decimal point ("10.2"): that value (constant).
726- Account numbers separated by commas ("430,431,(437)"): Sum of the account balances
727+ Account numbers separated by commas ("430,431,(437)"):
728+ Sum of the account balances
729 (the sign of the balance depends on the balance mode).
730 Concept codes separated by "+" ("11000+12000"): Sum of those concepts values.
731 """
732
733 # CSS classes for the account lines
734-CSS_CLASSES = [('default','Default'),
735- ('l1', 'Level 1'),
736+CSS_CLASSES = [('default', 'Default'),
737+ ('l1', 'Level 1'),
738 ('l2', 'Level 2'),
739- ('l3', 'Level 3'),
740- ('l4', 'Level 4'),
741+ ('l3', 'Level 3'),
742+ ('l4', 'Level 4'),
743 ('l5', 'Level 5')]
744
745+
746 class account_balance_reporting_template(orm.Model):
747 """
748 Account balance report template.
749@@ -68,12 +72,12 @@
750 'report_xml_id': fields.many2one('ir.actions.report.xml',
751 'Report design', ondelete='set null'),
752 'description': fields.text('Description'),
753- 'balance_mode': fields.selection(
754- [('0', 'Debit-Credit'),
755- ('1', 'Debit-Credit, reversed with brackets'),
756- ('2', 'Credit-Debit'),
757- ('3', 'Credit-Debit, reversed with brackets')],
758- 'Balance mode', help=_BALANCE_MODE_HELP),
759+ 'balance_mode':
760+ fields.selection([('0', 'Debit-Credit'),
761+ ('1', 'Debit-Credit, reversed with brackets'),
762+ ('2', 'Credit-Debit'),
763+ ('3', 'Credit-Debit, reversed with brackets')],
764+ 'Balance mode', help=_BALANCE_MODE_HELP),
765 'line_ids': fields.one2many('account.balance.reporting.template.line',
766 'report_id', 'Lines'),
767 }
768@@ -94,45 +98,43 @@
769 # Read the current item data:
770 template = self.browse(cr, uid, id, context=context)
771 # Create the template
772- new_id = self.create(cr, uid, {
773- 'name': '%s*' %template.name,
774- 'type': 'user', # Copies are always user templates
775- 'report_xml_id': template.report_xml_id.id,
776- 'description': template.description,
777- 'balance_mode': template.balance_mode,
778- 'line_ids': None,
779- }, context=context)
780+ new_id = self.create(cr, uid,
781+ {'name': '%s*' % template.name,
782+ 'type': 'user',
783+ 'report_xml_id': template.report_xml_id.id,
784+ 'description': template.description,
785+ 'balance_mode': template.balance_mode,
786+ 'line_ids': None}, context=context)
787 # Now create the lines (without parents)
788 for line in template.line_ids:
789- line_obj.create(cr, uid, {
790- 'report_id': new_id,
791- 'sequence': line.sequence,
792- 'css_class': line.css_class,
793- 'code': line.code,
794- 'name': line.name,
795- 'current_value': line.current_value,
796- 'previous_value': line.previous_value,
797- 'negate': line.negate,
798- 'parent_id': None,
799- 'child_ids': None,
800- }, context=context)
801+ line_obj.create(cr, uid,
802+ {'report_id': new_id,
803+ 'sequence': line.sequence,
804+ 'css_class': line.css_class,
805+ 'code': line.code,
806+ 'name': line.name,
807+ 'current_value': line.current_value,
808+ 'previous_value': line.previous_value,
809+ 'negate': line.negate,
810+ 'parent_id': None,
811+ 'child_ids': None}, context=context)
812 # Now set the (lines) parents
813 for line in template.line_ids:
814 if line.parent_id:
815 # Search for the copied line
816- new_line_id = line_obj.search(cr, uid, [
817- ('report_id', '=', new_id),
818- ('code', '=', line.code),
819- ], context=context)[0]
820+ new_line_id = line_obj.search(cr, uid,
821+ [('report_id', '=', new_id),
822+ ('code', '=', line.code)],
823+ context=context)[0]
824 # Search for the copied parent line
825- new_parent_id = line_obj.search(cr, uid, [
826- ('report_id', '=', new_id),
827- ('code', '=', line.parent_id.code),
828- ], context=context)[0]
829+ new_parent_id = \
830+ line_obj.search(cr, uid,
831+ [('report_id', '=', new_id),
832+ ('code', '=', line.parent_id.code)],
833+ context=context)[0]
834 # Set the parent
835- line_obj.write(cr, uid, new_line_id, {
836- 'parent_id': new_parent_id,
837- }, context=context)
838+ line_obj.write(cr, uid, new_line_id,
839+ {'parent_id': new_parent_id}, context=context)
840 return new_id
841
842
843@@ -147,9 +149,10 @@
844
845 _columns = {
846 'report_id': fields.many2one('account.balance.reporting.template',
847- 'Template', ondelete='cascade'),
848+ 'Template', ondelete='cascade'),
849 'sequence': fields.char('Sequence', size=32, required=False,
850- help="Lines will be sorted/grouped by this field"),
851+ help="Lines will be sorted/grouped \
852+ by this field"),
853 'css_class': fields.selection(CSS_CLASSES, 'CSS Class', required=False,
854 help="Style-sheet class"),
855 'code': fields.char('Code', size=64, required=True, select=True,
856@@ -162,7 +165,8 @@
857 'previous_value': fields.text('Fiscal year 2 formula',
858 help=_VALUE_FORMULA_HELP),
859 'negate': fields.boolean('Negate',
860- help="Negate the value (change the sign of the balance)"),
861+ help="Negate the value (change the sign \
862+ of the balance)"),
863 'parent_id': fields.many2one('account.balance.reporting.template.line',
864 'Parent', ondelete='cascade'),
865 'child_ids': fields.one2many('account.balance.reporting.template.line',
866@@ -170,8 +174,8 @@
867 }
868
869 _defaults = {
870- 'report_id': lambda self, cr, uid, context: context.get(
871- 'report_id', None),
872+ 'report_id': lambda self, cr, uid, context:
873+ context.get('report_id', None),
874 'negate': False,
875 'css_class': 'default',
876 }
877@@ -192,7 +196,7 @@
878 context = {}
879 res = []
880 for item in self.browse(cr, uid, ids, context=context):
881- res.append((item.id, "[%s] %s" %(item.code, item.name)))
882+ res.append((item.id, "[%s] %s" % (item.code, item.name)))
883 return res
884
885 def name_search(self, cr, uid, name, args=[], operator='ilike',
886
887=== modified file 'account_balance_reporting/account_balance_reporting_view.xml'
888--- account_balance_reporting/account_balance_reporting_view.xml 2014-01-10 10:36:59 +0000
889+++ account_balance_reporting/account_balance_reporting_view.xml 2014-05-26 16:36:55 +0000
890@@ -44,15 +44,22 @@
891 <group colspan="4">
892 <field name="company_id" select="1"/>
893 <field name="template_id" select="1"/>
894+ <field name="check_periods"/>
895+ <field name="check_dates"/>
896+ <field name="level"/>
897 </group>
898 <group colspan="4">
899 <group string="Fiscal year 1" colspan="2">
900 <field name="current_fiscalyear_id" select="2" colspan="4" nolabel="1"/>
901- <field name="current_period_ids" colspan="4" nolabel="1" domain="[('fiscalyear_id','=',current_fiscalyear_id)]"/>
902+ <field name="current_date_from" colspan="2" attrs="{'invisible':[('check_dates','=',False)]}"/>
903+ <field name="current_date_to" colspan="2" attrs="{'invisible':[('check_dates','=',False)]}"/>
904+ <field name="current_period_ids" colspan="4" nolabel="1" attrs="{'invisible':[('check_periods','=',False)]}" domain="[('fiscalyear_id','=',current_fiscalyear_id)]"/>
905 </group>
906 <group string="Fiscal year 2" colspan="2">
907 <field name="previous_fiscalyear_id" colspan="4" nolabel="1"/>
908- <field name="previous_period_ids" colspan="4" nolabel="1" domain="[('fiscalyear_id','=',previous_fiscalyear_id)]"/>
909+ <field name="previous_date_from" colspan="2" attrs="{'invisible':[('check_dates','=',False)]}"/>
910+ <field name="previous_date_to" colspan="2" attrs="{'invisible':[('check_dates','=',False)]}"/>
911+ <field name="previous_period_ids" colspan="4" nolabel="1" attrs="{'invisible':[('check_periods','=',False)]}" domain="[('fiscalyear_id','=',previous_fiscalyear_id)]"/>
912 </group>
913 </group>
914 </group>
915@@ -63,11 +70,11 @@
916 <group colspan="4">
917 <button name="calculate_action" type="object" string="Calculate" states="draft"/>
918 <!--
919- <button name="%(wiz_account_balance_reporting_calculate)d" type="action" string="Calculate" states="draft" icon="gtk-execute"/>
920- -->
921+ <button name="%(wiz_account_balance_reporting_calculate)d" type="action" string="Calculate" states="draft" icon="gtk-execute"/>
922+ -->
923 <button name="confirm" string="Confirm" states="calc_done" icon="gtk-apply"/>
924 <button name="cancel" string="Cancel" states="calc_done,done" icon="gtk-cancel"/>
925- <button name="action_recover" string="Draft" type="object" states="canceled" icon="gtk-undo"/>
926+ <button name="action_recover" string="Draft" type="object" states="canceled" icon="gtk-undo"/>
927 </group>
928 </page>
929 <page string="Lines">
930@@ -183,14 +190,14 @@
931 <field name="type">ir.actions.act_window</field>
932 <field name="res_model">account.balance.reporting</field>
933 <field name="view_type">form</field>
934- <field name="view_mode">tree,form</field>
935+ <field name="view_mode">tree,form</field>
936 <field name="view_id" ref="view_account_balance_reporting_tree"/>
937 </record>
938
939 <menuitem id="menu_account_balance_reporting"
940 name="Account balance reports"
941 parent="account.menu_finance_legal_statement"/>
942-
943+
944 <menuitem id="menu_account_balance_reporting_reports"
945 name="Reports"
946 parent="menu_account_balance_reporting"
947
948=== modified file 'account_balance_reporting/i18n/account_balance_reporting.pot'
949--- account_balance_reporting/i18n/account_balance_reporting.pot 2014-01-10 10:36:59 +0000
950+++ account_balance_reporting/i18n/account_balance_reporting.pot 2014-05-26 16:36:55 +0000
951@@ -1,23 +1,23 @@
952 # Translation of OpenERP Server.
953 # This file contains the translation of the following modules:
954-# * account_balance_reporting
955+# * account_balance_reporting
956 #
957 msgid ""
958 msgstr ""
959-"Project-Id-Version: OpenERP Server 5.0.5-bzr\n"
960-"Report-Msgid-Bugs-To: support@openerp.com\n"
961-"POT-Creation-Date: 2009-09-27 08:18:06+0000\n"
962-"PO-Revision-Date: 2009-09-22 16:49+0100\n"
963-"Last-Translator: Borja López Soilán (Pexego) <borjals@pexego.es>\n"
964+"Project-Id-Version: OpenERP Server 6.1\n"
965+"Report-Msgid-Bugs-To: \n"
966+"POT-Creation-Date: 2014-05-14 13:03+0000\n"
967+"PO-Revision-Date: 2014-05-14 13:03+0000\n"
968+"Last-Translator: <>\n"
969 "Language-Team: \n"
970 "MIME-Version: 1.0\n"
971 "Content-Type: text/plain; charset=UTF-8\n"
972-"Content-Transfer-Encoding: 8bit\n"
973+"Content-Transfer-Encoding: \n"
974 "Plural-Forms: \n"
975
976 #. module: account_balance_reporting
977-#: field:account.balance.reporting,current_period_ids:0
978-msgid "Fiscal year 1 periods"
979+#: field:account.balance.reporting,check_dates:0
980+msgid "Compute by dates"
981 msgstr ""
982
983 #. module: account_balance_reporting
984@@ -26,8 +26,14 @@
985 msgstr ""
986
987 #. module: account_balance_reporting
988-#: constraint:ir.actions.act_window:0
989-msgid "Invalid model name in the action definition."
990+#: field:account.balance.reporting,template_id:0
991+#: field:account.balance.reporting.template.line,report_id:0
992+msgid "Template"
993+msgstr ""
994+
995+#. module: account_balance_reporting
996+#: selection:account.balance.reporting.template,balance_mode:0
997+msgid "Debit-Credit, reversed with brackets"
998 msgstr ""
999
1000 #. module: account_balance_reporting
1001@@ -62,11 +68,21 @@
1002 msgstr ""
1003
1004 #. module: account_balance_reporting
1005+#: field:account.balance.reporting,level:0
1006+msgid "Level"
1007+msgstr ""
1008+
1009+#. module: account_balance_reporting
1010 #: field:account.balance.reporting.line,notes:0
1011 msgid "Notes"
1012 msgstr ""
1013
1014 #. module: account_balance_reporting
1015+#: model:ir.model,name:account_balance_reporting.model_account_balance_reporting_print_wizard
1016+msgid "account.balance.reporting.print.wizard"
1017+msgstr ""
1018+
1019+#. module: account_balance_reporting
1020 #: view:account.balance.reporting:0
1021 #: model:ir.actions.act_window,name:account_balance_reporting.action_view_account_balance_reporting
1022 #: model:ir.ui.menu,name:account_balance_reporting.menu_account_balance_reporting
1023@@ -93,11 +109,6 @@
1024 msgstr ""
1025
1026 #. module: account_balance_reporting
1027-#: selection:account.balance.reporting.template,balance_mode:0
1028-msgid "Debit-Credit, reversed with brakets"
1029-msgstr ""
1030-
1031-#. module: account_balance_reporting
1032 #: help:account.balance.reporting.template.line,code:0
1033 msgid "Concept code, may be used on formulas to reference this line"
1034 msgstr ""
1035@@ -113,23 +124,12 @@
1036 msgstr ""
1037
1038 #. module: account_balance_reporting
1039-#: model:ir.model,name:account_balance_reporting.model_account_balance_reporting_template_line
1040-msgid "account.balance.reporting.template.line"
1041-msgstr ""
1042-
1043-#. module: account_balance_reporting
1044-#: rml:report_account_balance_reporting.generic:0
1045-#: rml:report_account_balance_reporting.generic_non_zero:0
1046+#: report:report_account_balance_reporting.generic:0
1047+#: report:report_account_balance_reporting.generic_non_zero:0
1048 msgid "CODE"
1049 msgstr ""
1050
1051 #. module: account_balance_reporting
1052-#: field:account.balance.reporting,template_id:0
1053-#: field:account.balance.reporting.template.line,report_id:0
1054-msgid "Template"
1055-msgstr ""
1056-
1057-#. module: account_balance_reporting
1058 #: view:account.balance.reporting:0
1059 msgid "Parameters"
1060 msgstr ""
1061@@ -140,20 +140,15 @@
1062 msgstr ""
1063
1064 #. module: account_balance_reporting
1065-#: rml:report_account_balance_reporting.generic:0
1066-#: rml:report_account_balance_reporting.generic_non_zero:0
1067+#: report:report_account_balance_reporting.generic:0
1068+#: report:report_account_balance_reporting.generic_non_zero:0
1069 msgid "NOTES"
1070 msgstr ""
1071
1072 #. module: account_balance_reporting
1073 #: view:account.balance.reporting.template.line:0
1074 msgid "Account balance report template lines"
1075-msgstr ""
1076-
1077-#. module: account_balance_reporting
1078-#: wizard_view:account_balance_reporting.print_wizard,init:0
1079-msgid "Report data"
1080-msgstr ""
1081+msgstr "
1082
1083 #. module: account_balance_reporting
1084 #: view:account.balance.reporting:0
1085@@ -162,7 +157,7 @@
1086 msgstr ""
1087
1088 #. module: account_balance_reporting
1089-#: wizard_button:account_balance_reporting.print_wizard,init,print:0
1090+#: view:account.balance.reporting.print.wizard:0
1091 msgid "Print"
1092 msgstr ""
1093
1094@@ -191,33 +186,19 @@
1095 msgstr ""
1096
1097 #. module: account_balance_reporting
1098-#: model:ir.module.module,description:account_balance_reporting.module_meta_information
1099-msgid "\n"
1100-"The module allows the user to create account balance reports and templates,\n"
1101-"comparing the values of 'accounting concepts' between two fiscal years\n"
1102-"or a set of fiscal periods.\n"
1103-"\n"
1104-"Accounting concepts values can be calculated as the sum of some account balances,\n"
1105-"the sum of its children, other account concepts or constant values.\n"
1106-"\n"
1107-"Generated reports are stored as objects on the server,\n"
1108-"so you can check them anytime later or edit them\n"
1109-"(to add notes for example) before printing.\n"
1110-"\n"
1111-"The module lets the user add new templates of the reports concepts,\n"
1112-"and associate them a specific \"XML reports\" (OpenERP RML files for example)\n"
1113-"with the design used when printing.\n"
1114-"So it is very easy to add predefined country-specific official reports.\n"
1115-"\n"
1116-"The user interface has been designed to be as much user-friendly as it can be.\n"
1117-"\n"
1118-"Note: It has been designed to meet Spanish/Spain localization needs,\n"
1119-"but it might be used as a generic accounting report engine.\n"
1120-" "
1121+#: model:ir.model,name:account_balance_reporting.model_account_balance_reporting_template_line
1122+msgid "account.balance.reporting.template.line"
1123+msgstr ""
1124+
1125+#. module: account_balance_reporting
1126+#: model:ir.model,name:account_balance_reporting.model_account_balance_reporting
1127+msgid "account.balance.reporting"
1128 msgstr ""
1129
1130 #. module: account_balance_reporting
1131 #: field:account.balance.reporting.line,report_id:0
1132+#: view:account.balance.reporting.print.wizard:0
1133+#: field:account.balance.reporting.print.wizard,report_id:0
1134 msgid "Report"
1135 msgstr ""
1136
1137@@ -234,13 +215,12 @@
1138
1139 #. module: account_balance_reporting
1140 #: field:account.balance.reporting.template,report_xml_id:0
1141-#: wizard_view:account_balance_reporting.print_wizard,init:0
1142 msgid "Report design"
1143 msgstr ""
1144
1145 #. module: account_balance_reporting
1146-#: constraint:ir.ui.view:0
1147-msgid "Invalid XML for View Architecture!"
1148+#: selection:account.balance.reporting.template,balance_mode:0
1149+msgid "Credit-Debit, reversed with brackets"
1150 msgstr ""
1151
1152 #. module: account_balance_reporting
1153@@ -254,6 +234,12 @@
1154 msgstr ""
1155
1156 #. module: account_balance_reporting
1157+#: field:account.balance.reporting,current_date_to:0
1158+#: field:account.balance.reporting,previous_date_to:0
1159+msgid "Date To"
1160+msgstr ""
1161+
1162+#. module: account_balance_reporting
1163 #: field:account.balance.reporting,calc_date:0
1164 #: field:account.balance.reporting.line,calc_date:0
1165 msgid "Calculation date"
1166@@ -265,6 +251,29 @@
1167 msgstr ""
1168
1169 #. module: account_balance_reporting
1170+#: selection:account.balance.reporting,state:0
1171+msgid "Canceled"
1172+msgstr ""
1173+
1174+#. module: account_balance_reporting
1175+#: view:account.balance.reporting.print.wizard:0
1176+#: field:account.balance.reporting.print.wizard,report_xml_id:0
1177+msgid "Design"
1178+msgstr ""
1179+
1180+#. module: account_balance_reporting
1181+#: sql_constraint:account.balance.reporting.line:0
1182+#: sql_constraint:account.balance.reporting.template.line:0
1183+#: code:addons/account_balance_reporting/account_balance_reporting.py:252
1184+#: code:addons/account_balance_reporting/account_balance_reporting.py:254
1185+#: code:addons/account_balance_reporting/account_balance_reporting.py:268
1186+#: code:addons/account_balance_reporting/account_balance_reporting_template.py:183
1187+#: code:addons/account_balance_reporting/account_balance_reporting_template.py:211
1188+#, python-format
1189+msgid "The code must be unique for this report!"
1190+msgstr ""
1191+
1192+#. module: account_balance_reporting
1193 #: view:account.balance.reporting.template:0
1194 msgid "Template line"
1195 msgstr ""
1196@@ -295,8 +304,9 @@
1197 msgstr ""
1198
1199 #. module: account_balance_reporting
1200-#: constraint:ir.model:0
1201-msgid "The Object name must start with x_ and not contain any special character !"
1202+#: field:account.balance.reporting,current_date_from:0
1203+#: field:account.balance.reporting,previous_date_from:0
1204+msgid "Date From"
1205 msgstr ""
1206
1207 #. module: account_balance_reporting
1208@@ -325,11 +335,6 @@
1209 msgstr ""
1210
1211 #. module: account_balance_reporting
1212-#: selection:account.balance.reporting.template,balance_mode:0
1213-msgid "Credit-Debit, reversed with brakets"
1214-msgstr ""
1215-
1216-#. module: account_balance_reporting
1217 #: selection:account.balance.reporting.line,css_class:0
1218 #: selection:account.balance.reporting.template.line,css_class:0
1219 msgid "Default"
1220@@ -361,8 +366,8 @@
1221 msgstr ""
1222
1223 #. module: account_balance_reporting
1224-#: model:ir.model,name:account_balance_reporting.model_account_balance_reporting_line
1225-msgid "account.balance.reporting.line"
1226+#: field:account.balance.reporting,check_periods:0
1227+msgid "Compute by periods"
1228 msgstr ""
1229
1230 #. module: account_balance_reporting
1231@@ -377,13 +382,13 @@
1232 msgstr ""
1233
1234 #. module: account_balance_reporting
1235-#: model:ir.model,name:account_balance_reporting.model_account_balance_reporting
1236-msgid "account.balance.reporting"
1237+#: field:account.balance.reporting,current_period_ids:0
1238+msgid "Fiscal year 1 periods"
1239 msgstr ""
1240
1241 #. module: account_balance_reporting
1242 #: view:account.balance.reporting:0
1243-#: wizard_button:account_balance_reporting.print_wizard,init,end:0
1244+#: view:account.balance.reporting.print.wizard:0
1245 msgid "Cancel"
1246 msgstr ""
1247
1248@@ -438,6 +443,11 @@
1249 msgstr ""
1250
1251 #. module: account_balance_reporting
1252+#: model:ir.model,name:account_balance_reporting.model_account_balance_reporting_template
1253+msgid "account.balance.reporting.template"
1254+msgstr ""
1255+
1256+#. module: account_balance_reporting
1257 #: model:ir.ui.menu,name:account_balance_reporting.menu_account_balance_reporting_templates
1258 msgid "Templates"
1259 msgstr ""
1260@@ -482,11 +492,6 @@
1261 msgstr ""
1262
1263 #. module: account_balance_reporting
1264-#: model:ir.model,name:account_balance_reporting.model_account_balance_reporting_template
1265-msgid "account.balance.reporting.template"
1266-msgstr ""
1267-
1268-#. module: account_balance_reporting
1269 #: help:account.balance.reporting.template.line,current_value:0
1270 #: help:account.balance.reporting.template.line,previous_value:0
1271 msgid "Value calculation formula: Depending on this formula the final value is calculated as follows:\n"
1272@@ -499,12 +504,17 @@
1273 msgstr ""
1274
1275 #. module: account_balance_reporting
1276-#: rml:report_account_balance_reporting.generic:0
1277-#: rml:report_account_balance_reporting.generic_non_zero:0
1278+#: report:report_account_balance_reporting.generic:0
1279+#: report:report_account_balance_reporting.generic_non_zero:0
1280 msgid "CONCEPT"
1281 msgstr ""
1282
1283 #. module: account_balance_reporting
1284+#: model:ir.model,name:account_balance_reporting.model_account_balance_reporting_line
1285+msgid "account.balance.reporting.line"
1286+msgstr ""
1287+
1288+#. module: account_balance_reporting
1289 #: view:account.balance.reporting.line:0
1290 msgid "Account balance report line"
1291 msgstr ""
1292@@ -516,8 +526,8 @@
1293 msgstr ""
1294
1295 #. module: account_balance_reporting
1296-#: wizard_view:account_balance_reporting.print_wizard,init:0
1297-#: model:ir.actions.wizard,name:account_balance_reporting.wiz_account_balance_reporting_print
1298+#: view:account.balance.reporting.print.wizard:0
1299+#: model:ir.actions.act_window,name:account_balance_reporting.account_balance_reporting_print_wizard_act_window
1300 msgid "Print report"
1301 msgstr ""
1302
1303@@ -526,13 +536,3 @@
1304 msgid "Account balance report"
1305 msgstr ""
1306
1307-#. module: account_balance_reporting
1308-#: model:ir.module.module,shortdesc:account_balance_reporting.module_meta_information
1309-msgid "Account balance reporting engine"
1310-msgstr ""
1311-
1312-#. module: account_balance_reporting
1313-#: selection:account.balance.reporting,state:0
1314-msgid "Canceled"
1315-msgstr ""
1316-
1317
1318=== modified file 'account_balance_reporting/i18n/es.po'
1319--- account_balance_reporting/i18n/es.po 2014-01-10 10:36:59 +0000
1320+++ account_balance_reporting/i18n/es.po 2014-05-26 16:36:55 +0000
1321@@ -1,26 +1,24 @@
1322 # Translation of OpenERP Server.
1323 # This file contains the translation of the following modules:
1324-# * account_balance_reporting
1325+# * account_balance_reporting
1326 #
1327 msgid ""
1328 msgstr ""
1329-"Project-Id-Version: OpenERP Server 5.0.6\n"
1330-"Report-Msgid-Bugs-To: support@openerp.com\n"
1331-"POT-Creation-Date: 2009-09-27 08:18+0000\n"
1332-"PO-Revision-Date: 2010-12-13 22:27+0000\n"
1333-"Last-Translator: Jordi Esteve (www.zikzakmedia.com) "
1334-"<jesteve@zikzakmedia.com>\n"
1335+"Project-Id-Version: OpenERP Server 6.1\n"
1336+"Report-Msgid-Bugs-To: \n"
1337+"POT-Creation-Date: 2014-05-14 13:03+0000\n"
1338+"PO-Revision-Date: 2014-05-14 13:03+0000\n"
1339+"Last-Translator: <>\n"
1340 "Language-Team: \n"
1341 "MIME-Version: 1.0\n"
1342 "Content-Type: text/plain; charset=UTF-8\n"
1343-"Content-Transfer-Encoding: 8bit\n"
1344-"X-Launchpad-Export-Date: 2012-05-24 11:38+0000\n"
1345-"X-Generator: Launchpad (build 15288)\n"
1346+"Content-Transfer-Encoding: \n"
1347+"Plural-Forms: \n"
1348
1349 #. module: account_balance_reporting
1350-#: field:account.balance.reporting,current_period_ids:0
1351-msgid "Fiscal year 1 periods"
1352-msgstr "Periodos ejercicio fiscal 1"
1353+#: field:account.balance.reporting,check_dates:0
1354+msgid "Compute by dates"
1355+msgstr "Calcular entre fechas"
1356
1357 #. module: account_balance_reporting
1358 #: help:account.balance.reporting.template.line,css_class:0
1359@@ -28,9 +26,15 @@
1360 msgstr "Clase de hoja de estilos"
1361
1362 #. module: account_balance_reporting
1363-#: constraint:ir.actions.act_window:0
1364-msgid "Invalid model name in the action definition."
1365-msgstr "Nombre de modelo no válido en la definición de la acción."
1366+#: field:account.balance.reporting,template_id:0
1367+#: field:account.balance.reporting.template.line,report_id:0
1368+msgid "Template"
1369+msgstr "Plantilla"
1370+
1371+#. module: account_balance_reporting
1372+#: selection:account.balance.reporting.template,balance_mode:0
1373+msgid "Debit-Credit, reversed with brackets"
1374+msgstr "Debe-Haber, invertidos entre paréntisis"
1375
1376 #. module: account_balance_reporting
1377 #: selection:account.balance.reporting.template,balance_mode:0
1378@@ -64,11 +68,21 @@
1379 msgstr "Calcular informe"
1380
1381 #. module: account_balance_reporting
1382+#: field:account.balance.reporting,level:0
1383+msgid "Level"
1384+msgstr "Nivel"
1385+
1386+#. module: account_balance_reporting
1387 #: field:account.balance.reporting.line,notes:0
1388 msgid "Notes"
1389 msgstr "Notas"
1390
1391 #. module: account_balance_reporting
1392+#: model:ir.model,name:account_balance_reporting.model_account_balance_reporting_print_wizard
1393+msgid "account.balance.reporting.print.wizard"
1394+msgstr "account.balance.reporting.print.wizard"
1395+
1396+#. module: account_balance_reporting
1397 #: view:account.balance.reporting:0
1398 #: model:ir.actions.act_window,name:account_balance_reporting.action_view_account_balance_reporting
1399 #: model:ir.ui.menu,name:account_balance_reporting.menu_account_balance_reporting
1400@@ -95,16 +109,9 @@
1401 msgstr "Ejercicio fiscal 2"
1402
1403 #. module: account_balance_reporting
1404-#: selection:account.balance.reporting.template,balance_mode:0
1405-msgid "Debit-Credit, reversed with brakets"
1406-msgstr "Debe-Haber, inverso con paréntesis"
1407-
1408-#. module: account_balance_reporting
1409 #: help:account.balance.reporting.template.line,code:0
1410 msgid "Concept code, may be used on formulas to reference this line"
1411-msgstr ""
1412-"Código de concepto, puede ser usado en las fórmulas para referenciar esta "
1413-"línea."
1414+msgstr "Código de concepto, puede ser usado en las fórmulas para referenciar esta línea."
1415
1416 #. module: account_balance_reporting
1417 #: help:account.balance.reporting.template.line,sequence:0
1418@@ -117,23 +124,12 @@
1419 msgstr "Negar"
1420
1421 #. module: account_balance_reporting
1422-#: model:ir.model,name:account_balance_reporting.model_account_balance_reporting_template_line
1423-msgid "account.balance.reporting.template.line"
1424-msgstr "account.balance.reporting.template.line"
1425-
1426-#. module: account_balance_reporting
1427-#: rml:report_account_balance_reporting.generic:0
1428-#: rml:report_account_balance_reporting.generic_non_zero:0
1429+#: report:report_account_balance_reporting.generic:0
1430+#: report:report_account_balance_reporting.generic_non_zero:0
1431 msgid "CODE"
1432 msgstr "CÓDIGO"
1433
1434 #. module: account_balance_reporting
1435-#: field:account.balance.reporting,template_id:0
1436-#: field:account.balance.reporting.template.line,report_id:0
1437-msgid "Template"
1438-msgstr "Plantilla"
1439-
1440-#. module: account_balance_reporting
1441 #: view:account.balance.reporting:0
1442 msgid "Parameters"
1443 msgstr "Parámetros"
1444@@ -144,8 +140,8 @@
1445 msgstr "Confirmar"
1446
1447 #. module: account_balance_reporting
1448-#: rml:report_account_balance_reporting.generic:0
1449-#: rml:report_account_balance_reporting.generic_non_zero:0
1450+#: report:report_account_balance_reporting.generic:0
1451+#: report:report_account_balance_reporting.generic_non_zero:0
1452 msgid "NOTES"
1453 msgstr "NOTAS"
1454
1455@@ -155,18 +151,13 @@
1456 msgstr "Líneas plantilla informe cuentas anuales"
1457
1458 #. module: account_balance_reporting
1459-#: wizard_view:account_balance_reporting.print_wizard,init:0
1460-msgid "Report data"
1461-msgstr "Datos del informe"
1462-
1463-#. module: account_balance_reporting
1464 #: view:account.balance.reporting:0
1465 #: field:account.balance.reporting,state:0
1466 msgid "State"
1467 msgstr "Estado"
1468
1469 #. module: account_balance_reporting
1470-#: wizard_button:account_balance_reporting.print_wizard,init,print:0
1471+#: view:account.balance.reporting.print.wizard:0
1472 msgid "Print"
1473 msgstr "Imprimir"
1474
1475@@ -177,16 +168,12 @@
1476
1477 #. module: account_balance_reporting
1478 #: help:account.balance.reporting.template,balance_mode:0
1479-msgid ""
1480-"Formula calculation mode: Depending on it, the balance is calculated as "
1481-"follows:\n"
1482+msgid "Formula calculation mode: Depending on it, the balance is calculated as follows:\n"
1483 " Mode 0: debit-credit (default);\n"
1484 " Mode 1: debit-credit, credit-debit for accounts in brackets;\n"
1485 " Mode 2: credit-debit;\n"
1486 " Mode 3: credit-debit, debit-credit for accounts in brackets."
1487-msgstr ""
1488-"Modo de cálculo de la fórmula: Dependiendo de éste, el saldo se calcula como "
1489-"sigue:\n"
1490+msgstr "Modo de cálculo de la fórmula: Dependiendo de éste, el saldo se calcula como sigue:\n"
1491 " Modo 0: debe-haber (por defecto);\n"
1492 " Modo 1: debe-haber, haber-debe para las cuentas con paréntesis;\n"
1493 " Modo 2: haber-debe;\n"
1494@@ -203,67 +190,19 @@
1495 msgstr "Línea de informe"
1496
1497 #. module: account_balance_reporting
1498-#: model:ir.module.module,description:account_balance_reporting.module_meta_information
1499-msgid ""
1500-"\n"
1501-"The module allows the user to create account balance reports and templates,\n"
1502-"comparing the values of 'accounting concepts' between two fiscal years\n"
1503-"or a set of fiscal periods.\n"
1504-"\n"
1505-"Accounting concepts values can be calculated as the sum of some account "
1506-"balances,\n"
1507-"the sum of its children, other account concepts or constant values.\n"
1508-"\n"
1509-"Generated reports are stored as objects on the server,\n"
1510-"so you can check them anytime later or edit them\n"
1511-"(to add notes for example) before printing.\n"
1512-"\n"
1513-"The module lets the user add new templates of the reports concepts,\n"
1514-"and associate them a specific \"XML reports\" (OpenERP RML files for "
1515-"example)\n"
1516-"with the design used when printing.\n"
1517-"So it is very easy to add predefined country-specific official reports.\n"
1518-"\n"
1519-"The user interface has been designed to be as much user-friendly as it can "
1520-"be.\n"
1521-"\n"
1522-"Note: It has been designed to meet Spanish/Spain localization needs,\n"
1523-"but it might be used as a generic accounting report engine.\n"
1524-" "
1525-msgstr ""
1526-"\n"
1527-"El módulo permite al usuario crear informes y plantillas de balances "
1528-"contables,\n"
1529-"comparando los valores de 'conceptos contables' entre dos ejercicios "
1530-"fiscales\n"
1531-"o un conjunto de periodos fiscales.\n"
1532-"\n"
1533-"Los valores de los conceptos contables pueden ser calculados como la suma de "
1534-"los saldos de algunas cuentas,\n"
1535-"la suma de sus hijos, otros conceptos contables o valores constantes.\n"
1536-"\n"
1537-"Los informes generados se almacenan como objetos en el servidor,\n"
1538-"así que se pueden consultar más tarde o editar\n"
1539-"(para añadir notas por ejemplo) antes de imprimir.\n"
1540-"\n"
1541-"El módulo permite al usuario añadir nuevas plantillas de conceptos "
1542-"fiscales,\n"
1543-"y asociarles \"informes XML\" (archivos RML de OpenERP por ejemplo) "
1544-"específicos\n"
1545-"con el diseño a usar en la impresión.\n"
1546-"Así que es muy fácil añadir informes oficiales predefinidos específicos de "
1547-"un país.\n"
1548-"\n"
1549-"La interfaz de usuario ha sido diseñada para ser tan amigable como es "
1550-"posible.\n"
1551-"\n"
1552-"Nota: Ha sido diseñado para cubrir las necesidades de la localización "
1553-"Española/España,\n"
1554-"pero puede ser usado como un motor de informes contables genérico.\n"
1555-" "
1556+#: model:ir.model,name:account_balance_reporting.model_account_balance_reporting_template_line
1557+msgid "account.balance.reporting.template.line"
1558+msgstr "account.balance.reporting.template.line"
1559+
1560+#. module: account_balance_reporting
1561+#: model:ir.model,name:account_balance_reporting.model_account_balance_reporting
1562+msgid "account.balance.reporting"
1563+msgstr "account.balance.reporting"
1564
1565 #. module: account_balance_reporting
1566 #: field:account.balance.reporting.line,report_id:0
1567+#: view:account.balance.reporting.print.wizard:0
1568+#: field:account.balance.reporting.print.wizard,report_id:0
1569 msgid "Report"
1570 msgstr "Informe"
1571
1572@@ -280,14 +219,13 @@
1573
1574 #. module: account_balance_reporting
1575 #: field:account.balance.reporting.template,report_xml_id:0
1576-#: wizard_view:account_balance_reporting.print_wizard,init:0
1577 msgid "Report design"
1578 msgstr "Diseño del informe"
1579
1580 #. module: account_balance_reporting
1581-#: constraint:ir.ui.view:0
1582-msgid "Invalid XML for View Architecture!"
1583-msgstr "¡XML no válido para la definición de la vista!"
1584+#: selection:account.balance.reporting.template,balance_mode:0
1585+msgid "Credit-Debit, reversed with brackets"
1586+msgstr "Haber-Debe, invertido entre paréntisis"
1587
1588 #. module: account_balance_reporting
1589 #: view:account.balance.reporting.template:0
1590@@ -300,6 +238,12 @@
1591 msgstr "Informe balance genérico (sin líneas a cero)"
1592
1593 #. module: account_balance_reporting
1594+#: field:account.balance.reporting,current_date_to:0
1595+#: field:account.balance.reporting,previous_date_to:0
1596+msgid "Date To"
1597+msgstr "Hasta"
1598+
1599+#. module: account_balance_reporting
1600 #: field:account.balance.reporting,calc_date:0
1601 #: field:account.balance.reporting.line,calc_date:0
1602 msgid "Calculation date"
1603@@ -311,6 +255,29 @@
1604 msgstr "Periodos ejercicio fiscal 2"
1605
1606 #. module: account_balance_reporting
1607+#: selection:account.balance.reporting,state:0
1608+msgid "Canceled"
1609+msgstr "Cancelado"
1610+
1611+#. module: account_balance_reporting
1612+#: view:account.balance.reporting.print.wizard:0
1613+#: field:account.balance.reporting.print.wizard,report_xml_id:0
1614+msgid "Design"
1615+msgstr "Diseño"
1616+
1617+#. module: account_balance_reporting
1618+#: sql_constraint:account.balance.reporting.line:0
1619+#: sql_constraint:account.balance.reporting.template.line:0
1620+#: code:addons/account_balance_reporting/account_balance_reporting.py:252
1621+#: code:addons/account_balance_reporting/account_balance_reporting.py:254
1622+#: code:addons/account_balance_reporting/account_balance_reporting.py:268
1623+#: code:addons/account_balance_reporting/account_balance_reporting_template.py:183
1624+#: code:addons/account_balance_reporting/account_balance_reporting_template.py:211
1625+#, python-format
1626+msgid "The code must be unique for this report!"
1627+msgstr "¡El código debe ser único para este informe!"
1628+
1629+#. module: account_balance_reporting
1630 #: view:account.balance.reporting.template:0
1631 msgid "Template line"
1632 msgstr "Línea de plantilla"
1633@@ -341,12 +308,10 @@
1634 msgstr "Borrador"
1635
1636 #. module: account_balance_reporting
1637-#: constraint:ir.model:0
1638-msgid ""
1639-"The Object name must start with x_ and not contain any special character !"
1640-msgstr ""
1641-"¡El nombre del objeto debe empezar con x_ y no contener ningún carácter "
1642-"especial!"
1643+#: field:account.balance.reporting,current_date_from:0
1644+#: field:account.balance.reporting,previous_date_from:0
1645+msgid "Date From"
1646+msgstr "Desde"
1647
1648 #. module: account_balance_reporting
1649 #: help:account.balance.reporting.template.line,name:0
1650@@ -374,11 +339,6 @@
1651 msgstr "Plantilla de línea"
1652
1653 #. module: account_balance_reporting
1654-#: selection:account.balance.reporting.template,balance_mode:0
1655-msgid "Credit-Debit, reversed with brakets"
1656-msgstr "Haber-Debe, inverso con paréntesis"
1657-
1658-#. module: account_balance_reporting
1659 #: selection:account.balance.reporting.line,css_class:0
1660 #: selection:account.balance.reporting.template.line,css_class:0
1661 msgid "Default"
1662@@ -410,9 +370,9 @@
1663 msgstr "Modo de saldo"
1664
1665 #. module: account_balance_reporting
1666-#: model:ir.model,name:account_balance_reporting.model_account_balance_reporting_line
1667-msgid "account.balance.reporting.line"
1668-msgstr "account.balance.reporting.line"
1669+#: field:account.balance.reporting,check_periods:0
1670+msgid "Compute by periods"
1671+msgstr "Calcular por periodos"
1672
1673 #. module: account_balance_reporting
1674 #: field:account.balance.reporting.line,code:0
1675@@ -426,13 +386,13 @@
1676 msgstr "Realizado"
1677
1678 #. module: account_balance_reporting
1679-#: model:ir.model,name:account_balance_reporting.model_account_balance_reporting
1680-msgid "account.balance.reporting"
1681-msgstr "account.balance.reporting"
1682+#: field:account.balance.reporting,current_period_ids:0
1683+msgid "Fiscal year 1 periods"
1684+msgstr "Periodos ejercicio fiscal 1"
1685
1686 #. module: account_balance_reporting
1687 #: view:account.balance.reporting:0
1688-#: wizard_button:account_balance_reporting.print_wizard,init,end:0
1689+#: view:account.balance.reporting.print.wizard:0
1690 msgid "Cancel"
1691 msgstr "Cancelar"
1692
1693@@ -487,6 +447,11 @@
1694 msgstr "Plantillas informe cuentas anuales"
1695
1696 #. module: account_balance_reporting
1697+#: model:ir.model,name:account_balance_reporting.model_account_balance_reporting_template
1698+msgid "account.balance.reporting.template"
1699+msgstr "account.balance.reporting.template"
1700+
1701+#. module: account_balance_reporting
1702 #: model:ir.ui.menu,name:account_balance_reporting.menu_account_balance_reporting_templates
1703 msgid "Templates"
1704 msgstr "Plantillas"
1705@@ -531,41 +496,35 @@
1706 msgstr "Valores"
1707
1708 #. module: account_balance_reporting
1709-#: model:ir.model,name:account_balance_reporting.model_account_balance_reporting_template
1710-msgid "account.balance.reporting.template"
1711-msgstr "account.balance.reporting.template"
1712-
1713-#. module: account_balance_reporting
1714 #: help:account.balance.reporting.template.line,current_value:0
1715 #: help:account.balance.reporting.template.line,previous_value:0
1716-msgid ""
1717-"Value calculation formula: Depending on this formula the final value is "
1718-"calculated as follows:\n"
1719+msgid "Value calculation formula: Depending on this formula the final value is calculated as follows:\n"
1720 " Empy template value: sum of (this concept) children values.\n"
1721 " Number with decimal point (\"10.2\"): that value (constant).\n"
1722-" Account numbers separated by commas (\"430,431,(437)\"): Sum of the "
1723-"account balances\n"
1724+" Account numbers separated by commas (\"430,431,(437)\"): Sum of the account balances\n"
1725 " (the sign of the balance depends on the balance mode).\n"
1726-" Concept codes separated by \"+\" (\"11000+12000\"): Sum of those concepts "
1727-"values.\n"
1728-msgstr ""
1729-"Fórmula de cálculo del valor: Dependiendo de esta fórmula el valor final se "
1730-"calcula como sigue:\n"
1731+" Concept codes separated by \"+\" (\"11000+12000\"): Sum of those concepts values.\n"
1732+""
1733+msgstr "Fórmula de cálculo del valor: Dependiendo de esta fórmula el valor final se calcula como sigue:\n"
1734 " Valor vacío: suma de los valores de los hijos (de este concepto).\n"
1735 " Número con punto decimal (\"10.2\"): ese número (constante).\n"
1736-" Números de cuentas separados por comas (\"430,431,(437)\"): Suma de los "
1737-"saldos de las cuentas\n"
1738+" Números de cuentas separados por comas (\"430,431,(437)\"): Suma de los saldos de las cuentas\n"
1739 " (el signo del saldo depende del modo de saldo).\n"
1740-" Códigos de conceptos separados por \"+\" (\"11000+12000\"): Suma de los "
1741-"valores de dichos conceptos.\n"
1742+" Códigos de conceptos separados por \"+\" (\"11000+12000\"): Suma de los valores de dichos conceptos.\n"
1743+""
1744
1745 #. module: account_balance_reporting
1746-#: rml:report_account_balance_reporting.generic:0
1747-#: rml:report_account_balance_reporting.generic_non_zero:0
1748+#: report:report_account_balance_reporting.generic:0
1749+#: report:report_account_balance_reporting.generic_non_zero:0
1750 msgid "CONCEPT"
1751 msgstr "CONCEPTO"
1752
1753 #. module: account_balance_reporting
1754+#: model:ir.model,name:account_balance_reporting.model_account_balance_reporting_line
1755+msgid "account.balance.reporting.line"
1756+msgstr "account.balance.reporting.line"
1757+
1758+#. module: account_balance_reporting
1759 #: view:account.balance.reporting.line:0
1760 msgid "Account balance report line"
1761 msgstr "Línea informe cuentas anuales"
1762@@ -577,8 +536,8 @@
1763 msgstr "Orden"
1764
1765 #. module: account_balance_reporting
1766-#: wizard_view:account_balance_reporting.print_wizard,init:0
1767-#: model:ir.actions.wizard,name:account_balance_reporting.wiz_account_balance_reporting_print
1768+#: view:account.balance.reporting.print.wizard:0
1769+#: model:ir.actions.act_window,name:account_balance_reporting.account_balance_reporting_print_wizard_act_window
1770 msgid "Print report"
1771 msgstr "Imprimir informe"
1772
1773@@ -587,24 +546,3 @@
1774 msgid "Account balance report"
1775 msgstr "Informe cuentas anuales"
1776
1777-#. module: account_balance_reporting
1778-#: model:ir.module.module,shortdesc:account_balance_reporting.module_meta_information
1779-msgid "Account balance reporting engine"
1780-msgstr "Motor de informes de balances contables"
1781-
1782-#. module: account_balance_reporting
1783-#: selection:account.balance.reporting,state:0
1784-msgid "Canceled"
1785-msgstr "Cancelado"
1786-
1787-#~ msgid "account.balance.report.template.line"
1788-#~ msgstr "account.balance.report.template.line"
1789-
1790-#~ msgid "account.balance.report.line"
1791-#~ msgstr "account.balance.report.line"
1792-
1793-#~ msgid "account.balance.report"
1794-#~ msgstr "account.balance.report"
1795-
1796-#~ msgid "account.balance.report.template"
1797-#~ msgstr "account.balance.report.template"
1798
1799=== modified file 'account_balance_reporting/report/__init__.py'
1800--- account_balance_reporting/report/__init__.py 2014-01-10 10:36:59 +0000
1801+++ account_balance_reporting/report/__init__.py 2014-05-26 16:36:55 +0000
1802@@ -1,5 +1,4 @@
1803 # -*- coding: utf-8 -*-
1804-# -*- encoding: utf-8 -*-
1805 ##############################################################################
1806 #
1807 # OpenERP - Account balance reporting engine
1808@@ -7,8 +6,8 @@
1809 # $Id$
1810 #
1811 # This program is free software: you can redistribute it and/or modify
1812-# it under the terms of the GNU General Public License as published by
1813-# the Free Software Foundation, either version 3 of the License, or
1814+# it under the terms of the GNU Affero General Public License as published
1815+# by the Free Software Foundation, either version 3 of the License, or
1816 # (at your option) any later version.
1817 #
1818 # This program is distributed in the hope that it will be useful,
1819@@ -16,7 +15,7 @@
1820 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1821 # GNU General Public License for more details.
1822 #
1823-# You should have received a copy of the GNU General Public License
1824+# You should have received a copy of the GNU Affero General Public License
1825 # along with this program. If not, see <http://www.gnu.org/licenses/>.
1826 #
1827 ##############################################################################
1828@@ -24,4 +23,4 @@
1829 """
1830 Account balance reporting engine generic reports
1831 """
1832-__author__ = "Borja López Soilán (Pexego) - borjals@pexego.es"
1833\ No newline at end of file
1834+__author__ = "Borja López Soilán (Pexego) - borjals@pexego.es"
1835
1836=== modified file 'account_balance_reporting/wizard/__init__.py'
1837--- account_balance_reporting/wizard/__init__.py 2014-01-10 10:36:59 +0000
1838+++ account_balance_reporting/wizard/__init__.py 2014-05-26 16:36:55 +0000
1839@@ -1,5 +1,4 @@
1840 # -*- coding: utf-8 -*-
1841-# -*- encoding: utf-8 -*-
1842 ##############################################################################
1843 #
1844 # OpenERP - Account balance reporting engine
1845@@ -7,8 +6,8 @@
1846 # $Id$
1847 #
1848 # This program is free software: you can redistribute it and/or modify
1849-# it under the terms of the GNU General Public License as published by
1850-# the Free Software Foundation, either version 3 of the License, or
1851+# it under the terms of the GNU Affero General Public License as published
1852+# by the Free Software Foundation, either version 3 of the License, or
1853 # (at your option) any later version.
1854 #
1855 # This program is distributed in the hope that it will be useful,
1856@@ -16,7 +15,7 @@
1857 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1858 # GNU General Public License for more details.
1859 #
1860-# You should have received a copy of the GNU General Public License
1861+# You should have received a copy of the GNU Affero General Public License
1862 # along with this program. If not, see <http://www.gnu.org/licenses/>.
1863 #
1864 ##############################################################################
1865
1866=== modified file 'account_balance_reporting/wizard/wizard_print.py'
1867--- account_balance_reporting/wizard/wizard_print.py 2014-01-10 10:36:59 +0000
1868+++ account_balance_reporting/wizard/wizard_print.py 2014-05-26 16:36:55 +0000
1869@@ -1,5 +1,4 @@
1870 # -*- coding: utf-8 -*-
1871-# -*- encoding: utf-8 -*-
1872 ##############################################################################
1873 #
1874 # OpenERP - Account balance reporting engine
1875@@ -7,8 +6,8 @@
1876 # $Id$
1877 #
1878 # This program is free software: you can redistribute it and/or modify
1879-# it under the terms of the GNU General Public License as published by
1880-# the Free Software Foundation, either version 3 of the License, or
1881+# it under the terms of the GNU Affero General Public License as published
1882+# by the Free Software Foundation, either version 3 of the License, or
1883 # (at your option) any later version.
1884 #
1885 # This program is distributed in the hope that it will be useful,
1886@@ -16,7 +15,7 @@
1887 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1888 # GNU General Public License for more details.
1889 #
1890-# You should have received a copy of the GNU General Public License
1891+# You should have received a copy of the GNU Affero General Public License
1892 # along with this program. If not, see <http://www.gnu.org/licenses/>.
1893 #
1894 ##############################################################################
1895@@ -32,12 +31,14 @@
1896
1897
1898 class print_wizard(osv.osv_memory):
1899- _name='account.balance.reporting.print.wizard'
1900-
1901- def _get_current_report_id(self, cr, uid, ctx):
1902- rpt_facade = pooler.get_pool(cr.dbname).get('account.balance.reporting')
1903+ _name = 'account.balance.reporting.print.wizard'
1904+
1905+ def _get_current_report_id(self, cr, uid, ctx):
1906+ pool = pooler.get_pool(cr.dbname)
1907+ rpt_facade = pool.get('account.balance.reporting')
1908 report_id = None
1909- if ctx.get('active_model') == 'account.balance.reporting' and ctx.get('active_ids') and ctx.get('active_ids')[0]:
1910+ if ctx.get('active_model') == 'account.balance.reporting' and \
1911+ ctx.get('active_ids') and ctx.get('active_ids')[0]:
1912 report_id = ctx.get('active_ids')[0]
1913 report_ids = rpt_facade.search(cr, uid, [('id', '=', report_id)])
1914 report_id = report_ids and report_ids[0] or None
1915@@ -45,7 +46,8 @@
1916
1917 def _get_current_report_xml_id(self, cr, uid, ctx):
1918 report_id = self._get_current_report_id(cr, uid, ctx)
1919- rpt_facade = pooler.get_pool(cr.dbname).get('account.balance.reporting')
1920+ pool = pooler.get_pool(cr.dbname)
1921+ rpt_facade = pool.get('account.balance.reporting')
1922 report = rpt_facade.browse(cr, uid, [report_id])[0]
1923 report_xml_id = None
1924 if report.template_id and report.template_id.report_xml_id:
1925@@ -53,43 +55,36 @@
1926 return report_xml_id
1927
1928 def print_report(self, cr, uid, ids, context=None):
1929- data = self.read(cr,uid,ids)[-1]
1930- #rpt_facade_lines = pooler.get_pool(cr.dbname).get('account.balance.reporting.line')
1931- #var = data.get('report_id') and data['report_id'][0] or None
1932- #report_lines_ids = rpt_facade_lines.search(cr, uid, [('report_id', '=', var)])
1933- #print data
1934- #print str(data.get('report_id'))
1935- #print str(data['report_id'][0])
1936- datas ={
1937- 'ids': [data.get('report_id') and data['report_id'][0] or None],
1938- 'model':'account.balance.reporting',
1939- 'form': data
1940- }
1941+ data = self.read(cr, uid, ids)[-1]
1942+ datas = {'ids': [data.get('report_id') and
1943+ data['report_id'][0] or None],
1944+ 'model': 'account.balance.reporting',
1945+ 'form': data}
1946 rpt_facade = pooler.get_pool(cr.dbname).get('ir.actions.report.xml')
1947 report_xml = None
1948 if data.get('report_xml_id'):
1949 report_xml_id = data['report_xml_id']
1950- report_xml_ids = rpt_facade.search(cr, uid, [('id', '=', report_xml_id[0])])
1951+ report_xml_ids = rpt_facade.search(cr, uid,
1952+ [('id', '=', report_xml_id[0])])
1953 report_xml_id = report_xml_ids and report_xml_ids[0] or None
1954 if report_xml_id:
1955 report_xml = rpt_facade.browse(cr, uid, [report_xml_id])[0]
1956 if report_xml:
1957 return {
1958- 'type' : 'ir.actions.report.xml',
1959- 'report_name' : report_xml.report_name,
1960- 'datas' : datas #{'ids': [data.get('report_id') and data['report_id'][0] or None]},
1961+ 'type': 'ir.actions.report.xml',
1962+ 'report_name': report_xml.report_name,
1963+ 'datas': datas
1964 }
1965- return { 'type': 'ir.actions.act_window_close' }
1966-
1967+ return {'type': 'ir.actions.act_window_close'}
1968+
1969 _columns = {
1970- 'report_id' : fields.many2one('account.balance.reporting', "Report"),
1971+ 'report_id': fields.many2one('account.balance.reporting', "Report"),
1972 'report_xml_id': fields.many2one('ir.actions.report.xml', "Design"),
1973 }
1974-
1975+
1976 _defaults = {
1977 'report_id': _get_current_report_id,
1978 'report_xml_id': _get_current_report_xml_id
1979 }
1980
1981 print_wizard()
1982-