Merge lp:~l-turchetti/openobject-italia/add_account_central_journal into lp:~openobject-italia-core-devs/openobject-italia/italian-addons-6.1

Proposed by Lorenzo Battistini
Status: Merged
Merged at revision: 195
Proposed branch: lp:~l-turchetti/openobject-italia/add_account_central_journal
Merge into: lp:~openobject-italia-core-devs/openobject-italia/italian-addons-6.1
Diff against target: 1325 lines (+1245/-0)
15 files modified
account_central_journal/AUTHORS.txt (+1/-0)
account_central_journal/__init__.py (+25/-0)
account_central_journal/__openerp__.py (+47/-0)
account_central_journal/account.py (+44/-0)
account_central_journal/account_view.xml (+27/-0)
account_central_journal/i18n/account_central_journal.pot (+235/-0)
account_central_journal/i18n/it.po (+233/-0)
account_central_journal/report/__init__.py (+22/-0)
account_central_journal/report/central_journal_report.mako (+186/-0)
account_central_journal/report/central_journal_report.py (+88/-0)
account_central_journal/report/report.xml (+14/-0)
account_central_journal/report/webkit_model.xml (+107/-0)
account_central_journal/wizard/__init__.py (+22/-0)
account_central_journal/wizard/central_journal_report.py (+135/-0)
account_central_journal/wizard/central_journal_report.xml (+59/-0)
To merge this branch: bzr merge lp:~l-turchetti/openobject-italia/add_account_central_journal
Reviewer Review Type Date Requested Status
OpenERP Italia core devs Pending
Review via email: mp+112317@code.launchpad.net
To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== added directory 'account_central_journal'
2=== added file 'account_central_journal/AUTHORS.txt'
3--- account_central_journal/AUTHORS.txt 1970-01-01 00:00:00 +0000
4+++ account_central_journal/AUTHORS.txt 2012-06-27 10:38:24 +0000
5@@ -0,0 +1,1 @@
6+Daniele Arcangeli <d.arcangeli@isa.it>
7
8=== added file 'account_central_journal/__init__.py'
9--- account_central_journal/__init__.py 1970-01-01 00:00:00 +0000
10+++ account_central_journal/__init__.py 2012-06-27 10:38:24 +0000
11@@ -0,0 +1,25 @@
12+# -*- coding: utf-8 -*-
13+##############################################################################
14+#
15+# OpenERP, Open Source Management Solution
16+# Copyright (C) 2012 ISA s.r.l. (<http://www.isa.it>).
17+#
18+# This program is free software: you can redistribute it and/or modify
19+# it under the terms of the GNU Affero General Public License as
20+# published by the Free Software Foundation, either version 3 of the
21+# License, or (at your option) any later version.
22+#
23+# This program is distributed in the hope that it will be useful,
24+# but WITHOUT ANY WARRANTY; without even the implied warranty of
25+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
26+# GNU Affero General Public License for more details.
27+#
28+# You should have received a copy of the GNU Affero General Public License
29+# along with this program. If not, see <http://www.gnu.org/licenses/>.
30+#
31+##############################################################################
32+
33+import account
34+import wizard
35+import report
36+
37
38=== added file 'account_central_journal/__openerp__.py'
39--- account_central_journal/__openerp__.py 1970-01-01 00:00:00 +0000
40+++ account_central_journal/__openerp__.py 2012-06-27 10:38:24 +0000
41@@ -0,0 +1,47 @@
42+# -*- coding: utf-8 -*-
43+##############################################################################
44+#
45+# OpenERP, Open Source Management Solution
46+# Copyright (C) 2011 ISA s.r.l. (<http://www.isa.it>).
47+#
48+# This program is free software: you can redistribute it and/or modify
49+# it under the terms of the GNU Affero General Public License as
50+# published by the Free Software Foundation, either version 3 of the
51+# License, or (at your option) any later version.
52+#
53+# This program is distributed in the hope that it will be useful,
54+# but WITHOUT ANY WARRANTY; without even the implied warranty of
55+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
56+# GNU Affero General Public License for more details.
57+#
58+# You should have received a copy of the GNU Affero General Public License
59+# along with this program. If not, see <http://www.gnu.org/licenses/>.
60+#
61+##############################################################################
62+
63+{
64+ 'name': 'Account Central Journal',
65+ 'version': '3',
66+ 'author': "ISA S.r.l.",
67+ 'website': 'http://www.isa.it',
68+ 'category': 'Generic Modules/Accounting',
69+ 'description': """
70+Managing the printing of the "Central Journal" """,
71+ 'depends' : [
72+ 'base',
73+ 'account',
74+ 'report_webkit',
75+ ],
76+ 'init_xml' : [],
77+ 'update_xml': [
78+ 'report/report.xml',
79+ 'report/webkit_model.xml',
80+ 'wizard/central_journal_report.xml',
81+ 'account_view.xml',
82+ ],
83+ 'demo_xml': [],
84+ 'test':[],
85+ 'installable': True,
86+ 'active': False,
87+ 'certificate': '',
88+}
89
90=== added file 'account_central_journal/account.py'
91--- account_central_journal/account.py 1970-01-01 00:00:00 +0000
92+++ account_central_journal/account.py 2012-06-27 10:38:24 +0000
93@@ -0,0 +1,44 @@
94+# -*- coding: utf-8 -*-
95+##############################################################################
96+#
97+# OpenERP, Open Source Management Solution
98+# Copyright (C) 2012 ISA s.r.l. (<http://www.isa.it>).
99+#
100+# This program is free software: you can redistribute it and/or modify
101+# it under the terms of the GNU Affero General Public License as
102+# published by the Free Software Foundation, either version 3 of the
103+# License, or (at your option) any later version.
104+#
105+# This program is distributed in the hope that it will be useful,
106+# but WITHOUT ANY WARRANTY; without even the implied warranty of
107+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
108+# GNU Affero General Public License for more details.
109+#
110+# You should have received a copy of the GNU Affero General Public License
111+# along with this program. If not, see <http://www.gnu.org/licenses/>.
112+#
113+##############################################################################
114+
115+from osv import fields, osv
116+from tools.translate import _
117+import decimal_precision as dp
118+
119+class account_fiscalyear(osv.osv):
120+ _inherit = "account.fiscalyear"
121+ _description = "Fiscal Year"
122+ _columns = {
123+ 'date_last_print': fields.date('Last printed date', readonly=True),
124+ 'progressive_page_number': fields.integer('Progressive of the page', required=True, readonly=True),
125+ 'progressive_line_number': fields.integer('Progressive line', required=True, readonly=True),
126+ 'progressive_credit': fields.float('Progressive Credit', digits_compute=dp.get_precision('Account'), required=True, readonly=True),
127+ 'progressive_debit': fields.float('Progressive Debit', digits_compute=dp.get_precision('Account'), required=True, readonly=True),
128+ }
129+
130+ _defaults = {
131+ 'progressive_page_number': 0,
132+ 'progressive_line_number': 0,
133+ 'progressive_credit': lambda *a: float(),
134+ 'progressive_debit': lambda *a: float(),
135+ }
136+
137+account_fiscalyear()
138
139=== added file 'account_central_journal/account_view.xml'
140--- account_central_journal/account_view.xml 1970-01-01 00:00:00 +0000
141+++ account_central_journal/account_view.xml 2012-06-27 10:38:24 +0000
142@@ -0,0 +1,27 @@
143+<?xml version="1.0" encoding="utf-8"?>
144+<openerp>
145+ <data>
146+
147+ <!--
148+ Account Fiscal Year inheritancy
149+ -->
150+
151+ <record id="account_central_journal_form_view" model="ir.ui.view">
152+ <field name="name">account.central.journal.form</field>
153+ <field name="model">account.fiscalyear</field>
154+ <field name="inherit_id" ref="account.view_account_fiscalyear_form"/>
155+ <field name="arch" type="xml">
156+ <field name="end_journal_period_id" position="after">
157+ <separator colspan="4" string="Central journal info"/>
158+ <field name="date_last_print"/>
159+ <newline/>
160+ <field name="progressive_page_number"/>
161+ <field name="progressive_line_number"/>
162+ <field name="progressive_credit"/>
163+ <field name="progressive_debit"/>
164+ </field>
165+ </field>
166+ </record>
167+
168+ </data>
169+</openerp>
170
171=== added directory 'account_central_journal/i18n'
172=== added file 'account_central_journal/i18n/account_central_journal.pot'
173--- account_central_journal/i18n/account_central_journal.pot 1970-01-01 00:00:00 +0000
174+++ account_central_journal/i18n/account_central_journal.pot 2012-06-27 10:38:24 +0000
175@@ -0,0 +1,235 @@
176+# Translation of OpenERP Server.
177+# This file contains the translation of the following modules:
178+# * account_central_journal
179+#
180+msgid ""
181+msgstr ""
182+"Project-Id-Version: OpenERP Server 6.0.3\n"
183+"Report-Msgid-Bugs-To: support@openerp.com\n"
184+"POT-Creation-Date: 2012-03-16 14:39+0000\n"
185+"PO-Revision-Date: 2012-03-16 14:39+0000\n"
186+"Last-Translator: <>\n"
187+"Language-Team: \n"
188+"MIME-Version: 1.0\n"
189+"Content-Type: text/plain; charset=UTF-8\n"
190+"Content-Transfer-Encoding: \n"
191+"Plural-Forms: \n"
192+
193+#. module: account_central_journal
194+#: model:ir.actions.act_window,name:account_central_journal.central_journal_report_action
195+#: model:ir.ui.menu,name:account_central_journal.menu_central_journal_report_action
196+msgid "Print Central Journal"
197+msgstr ""
198+
199+#. module: account_central_journal
200+#: report:report.central_journal_report:135
201+msgid "Account code"
202+msgstr ""
203+
204+#. module: account_central_journal
205+#: report:report.central_journal_report:144
206+#: report:report.central_journal_report:170
207+msgid "Progressives =>"
208+msgstr ""
209+
210+#. module: account_central_journal
211+#: model:ir.model,name:account_central_journal.model_central_journal_report
212+#: model:ir.model,name:account_central_journal.model_wizard_central_journal_report
213+#: view:wizard.central.journal.report:0
214+msgid "Printing parameters of the Center Journal"
215+msgstr ""
216+
217+#. module: account_central_journal
218+#: field:wizard.central.journal.report,print_state:0
219+msgid "State"
220+msgstr ""
221+
222+#. module: account_central_journal
223+#: selection:wizard.central.journal.report,print_state:0
224+msgid "Draft"
225+msgstr ""
226+
227+#. module: account_central_journal
228+#: report:report.central_journal_report:134
229+msgid "Account move"
230+msgstr ""
231+
232+#. module: account_central_journal
233+#: report:report.central_journal_report:138
234+msgid "Debit"
235+msgstr ""
236+
237+#. module: account_central_journal
238+#: view:wizard.central.journal.report:0
239+msgid "Print"
240+msgstr ""
241+
242+#. module: account_central_journal
243+#: field:account.fiscalyear,progressive_credit:0
244+msgid "Progressive Credit"
245+msgstr ""
246+
247+#. module: account_central_journal
248+#: model:ir.module.module,description:account_central_journal.module_meta_information
249+msgid "\n"
250+"Managing the printing of the \"Central Journal\" "
251+msgstr ""
252+
253+#. module: account_central_journal
254+#: constraint:account.fiscalyear:0
255+msgid "Error! You cannot define overlapping fiscal years"
256+msgstr ""
257+
258+#. module: account_central_journal
259+#: report:report.central_journal_report:133
260+msgid "Ref"
261+msgstr ""
262+
263+#. module: account_central_journal
264+#: field:account.fiscalyear,date_last_print:0
265+msgid "Last printed date"
266+msgstr ""
267+
268+#. module: account_central_journal
269+#: selection:wizard.central.journal.report,print_state:0
270+msgid "Printed"
271+msgstr ""
272+
273+#. module: account_central_journal
274+#: report:report.central_journal_report:136
275+msgid "Account name"
276+msgstr ""
277+
278+#. module: account_central_journal
279+#: report:report.central_journal_report:132
280+msgid "Date"
281+msgstr ""
282+
283+#. module: account_central_journal
284+#: code:addons/account_central_journal/wizard/central_journal_report.py:51
285+#: code:addons/account_central_journal/wizard/central_journal_report.py:54
286+#, python-format
287+msgid "Wrong dates !"
288+msgstr ""
289+
290+#. module: account_central_journal
291+#: view:wizard.central.journal.report:0
292+msgid "Dates movements"
293+msgstr ""
294+
295+#. module: account_central_journal
296+#: field:account.fiscalyear,progressive_debit:0
297+msgid "Progressive Debit"
298+msgstr ""
299+
300+#. module: account_central_journal
301+#: report:report.central_journal_report:124
302+#: field:wizard.central.journal.report,date_move_line_to:0
303+msgid "to date"
304+msgstr ""
305+
306+#. module: account_central_journal
307+#: report:report.central_journal_report:137
308+msgid "Name"
309+msgstr ""
310+
311+#. module: account_central_journal
312+#: model:ir.module.module,shortdesc:account_central_journal.module_meta_information
313+msgid "Account Central Journal"
314+msgstr ""
315+
316+#. module: account_central_journal
317+#: field:account.fiscalyear,progressive_line_number:0
318+msgid "Progressive line"
319+msgstr ""
320+
321+#. module: account_central_journal
322+#: code:addons/account_central_journal/wizard/central_journal_report.py:54
323+#, python-format
324+msgid "The end date can not be greater than today's date."
325+msgstr ""
326+
327+#. module: account_central_journal
328+#: report:report.central_journal_report:139
329+msgid "Credit"
330+msgstr ""
331+
332+#. module: account_central_journal
333+#: model:ir.model,name:account_central_journal.model_account_fiscalyear
334+#: field:wizard.central.journal.report,fiscalyear:0
335+msgid "Fiscal Year"
336+msgstr ""
337+
338+#. module: account_central_journal
339+#: constraint:account.fiscalyear:0
340+msgid "Error! The duration of the Fiscal Year is invalid. "
341+msgstr ""
342+
343+#. module: account_central_journal
344+#: code:addons/account_central_journal/wizard/central_journal_report.py:51
345+#, python-format
346+msgid "The end date must be greater than the initial date."
347+msgstr ""
348+
349+#. module: account_central_journal
350+#: view:wizard.central.journal.report:0
351+msgid "Reference"
352+msgstr ""
353+
354+#. module: account_central_journal
355+#: model:ir.actions.report.xml,name:account_central_journal.central_journal_report_id
356+msgid "central_journal"
357+msgstr ""
358+
359+#. module: account_central_journal
360+#: field:account.fiscalyear,progressive_page_number:0
361+msgid "Progressive of the page"
362+msgstr ""
363+
364+#. module: account_central_journal
365+#: report:report.central_journal_report:124
366+msgid "TEST PRINTING"
367+msgstr ""
368+
369+#. module: account_central_journal
370+#: view:account.fiscalyear:0
371+msgid "Central journal info"
372+msgstr ""
373+
374+#. module: account_central_journal
375+#: report:report.central_journal_report:127
376+msgid "Page:"
377+msgstr ""
378+
379+#. module: account_central_journal
380+#: report:report.central_journal_report:124
381+#: field:wizard.central.journal.report,date_move_line_from:0
382+#: field:wizard.central.journal.report,date_move_line_from_view:0
383+msgid "From date"
384+msgstr ""
385+
386+#. module: account_central_journal
387+#: selection:wizard.central.journal.report,print_state:0
388+msgid "Ready for printing"
389+msgstr ""
390+
391+#. module: account_central_journal
392+#: view:wizard.central.journal.report:0
393+msgid "Cancel"
394+msgstr ""
395+
396+#. module: account_central_journal
397+#: report:report.central_journal_report:131
398+msgid "Row"
399+msgstr ""
400+
401+#. module: account_central_journal
402+#: view:wizard.central.journal.report:0
403+msgid "Final print"
404+msgstr ""
405+
406+#. module: account_central_journal
407+#: report:report.central_journal_report:116
408+msgid "ACCOUNT JOURNAL"
409+msgstr ""
410+
411
412=== added file 'account_central_journal/i18n/it.mo'
413Binary files account_central_journal/i18n/it.mo 1970-01-01 00:00:00 +0000 and account_central_journal/i18n/it.mo 2012-06-27 10:38:24 +0000 differ
414=== added file 'account_central_journal/i18n/it.po'
415--- account_central_journal/i18n/it.po 1970-01-01 00:00:00 +0000
416+++ account_central_journal/i18n/it.po 2012-06-27 10:38:24 +0000
417@@ -0,0 +1,233 @@
418+msgid ""
419+msgstr ""
420+"Project-Id-Version: Account Central Journal\n"
421+"Report-Msgid-Bugs-To: support@openerp.com\n"
422+"POT-Creation-Date: 2012-03-16 14:39+0000\n"
423+"PO-Revision-Date: \n"
424+"Last-Translator: Daniele Arcangeli <d.arcangeli@isa.it>\n"
425+"Language-Team: \n"
426+"MIME-Version: 1.0\n"
427+"Content-Type: text/plain; charset=UTF-8\n"
428+"Content-Transfer-Encoding: 8bit\n"
429+
430+#. module: account_central_journal
431+#: model:ir.actions.act_window,name:account_central_journal.central_journal_report_action
432+#: model:ir.ui.menu,name:account_central_journal.menu_central_journal_report_action
433+msgid "Print Central Journal"
434+msgstr "Giornale Centralizzato"
435+
436+#. module: account_central_journal
437+#: report:report.central_journal_report:135
438+msgid "Account code"
439+msgstr "Codice Conto"
440+
441+#. module: account_central_journal
442+#: report:report.central_journal_report:144
443+#: report:report.central_journal_report:170
444+msgid "Progressives =>"
445+msgstr "Progressivi =>"
446+
447+#. module: account_central_journal
448+#: model:ir.model,name:account_central_journal.model_central_journal_report
449+#: model:ir.model,name:account_central_journal.model_wizard_central_journal_report
450+#: view:wizard.central.journal.report:0
451+msgid "Printing parameters of the Center Journal"
452+msgstr "Parametri di stampa del Giornale Centralizzato"
453+
454+#. module: account_central_journal
455+#: field:wizard.central.journal.report,print_state:0
456+msgid "State"
457+msgstr "Stato"
458+
459+#. module: account_central_journal
460+#: selection:wizard.central.journal.report,print_state:0
461+msgid "Draft"
462+msgstr "Bozza"
463+
464+#. module: account_central_journal
465+#: report:report.central_journal_report:134
466+msgid "Account move"
467+msgstr "Movimento"
468+
469+#. module: account_central_journal
470+#: report:report.central_journal_report:138
471+msgid "Debit"
472+msgstr "Dare"
473+
474+#. module: account_central_journal
475+#: view:wizard.central.journal.report:0
476+msgid "Print"
477+msgstr "Stampa"
478+
479+#. module: account_central_journal
480+#: field:account.fiscalyear,progressive_credit:0
481+msgid "Progressive Credit"
482+msgstr "Progressivo Avere"
483+
484+#. module: account_central_journal
485+#: model:ir.module.module,description:account_central_journal.module_meta_information
486+msgid ""
487+"\n"
488+"Managing the printing of the \"Central Journal\" "
489+msgstr ""
490+"\n"
491+"Gestione della stampa del \"Giornale Centralizzato\""
492+
493+#. module: account_central_journal
494+#: constraint:account.fiscalyear:0
495+msgid "Error! You cannot define overlapping fiscal years"
496+msgstr "Errore! Non è possibile definire una sovrapposizione degli anni fiscali."
497+
498+#. module: account_central_journal
499+#: report:report.central_journal_report:133
500+msgid "Ref"
501+msgstr "Rif."
502+
503+#. module: account_central_journal
504+#: field:account.fiscalyear,date_last_print:0
505+msgid "Last printed date"
506+msgstr "Data ultima stampa"
507+
508+#. module: account_central_journal
509+#: selection:wizard.central.journal.report,print_state:0
510+msgid "Printed"
511+msgstr "Stampato"
512+
513+#. module: account_central_journal
514+#: report:report.central_journal_report:136
515+msgid "Account name"
516+msgstr "Conto"
517+
518+#. module: account_central_journal
519+#: report:report.central_journal_report:132
520+msgid "Date"
521+msgstr "Data"
522+
523+#. module: account_central_journal
524+#: code:addons/account_central_journal/wizard/central_journal_report.py:51
525+#: code:addons/account_central_journal/wizard/central_journal_report.py:54
526+#, python-format
527+msgid "Wrong dates !"
528+msgstr "Date errate !"
529+
530+#. module: account_central_journal
531+#: view:wizard.central.journal.report:0
532+msgid "Dates movements"
533+msgstr "Date dei movimenti"
534+
535+#. module: account_central_journal
536+#: field:account.fiscalyear,progressive_debit:0
537+msgid "Progressive Debit"
538+msgstr "Progressivo Dare"
539+
540+#. module: account_central_journal
541+#: report:report.central_journal_report:124
542+#: field:wizard.central.journal.report,date_move_line_to:0
543+msgid "to date"
544+msgstr "alla data"
545+
546+#. module: account_central_journal
547+#: report:report.central_journal_report:137
548+msgid "Name"
549+msgstr "Descrizione movimento"
550+
551+#. module: account_central_journal
552+#: model:ir.module.module,shortdesc:account_central_journal.module_meta_information
553+msgid "Account Central Journal"
554+msgstr "Giornale Centralizzato"
555+
556+#. module: account_central_journal
557+#: field:account.fiscalyear,progressive_line_number:0
558+msgid "Progressive line"
559+msgstr "Progressivo della riga"
560+
561+#. module: account_central_journal
562+#: code:addons/account_central_journal/wizard/central_journal_report.py:54
563+#, python-format
564+msgid "The end date can not be greater than today's date."
565+msgstr "La data finale non può essere maggiore della data odierna"
566+
567+#. module: account_central_journal
568+#: report:report.central_journal_report:139
569+msgid "Credit"
570+msgstr "Avere"
571+
572+#. module: account_central_journal
573+#: model:ir.model,name:account_central_journal.model_account_fiscalyear
574+#: field:wizard.central.journal.report,fiscalyear:0
575+msgid "Fiscal Year"
576+msgstr "Anno Fiscale"
577+
578+#. module: account_central_journal
579+#: constraint:account.fiscalyear:0
580+msgid "Error! The duration of the Fiscal Year is invalid. "
581+msgstr "Errore! La durata dell'anno fiscale non è valida."
582+
583+#. module: account_central_journal
584+#: code:addons/account_central_journal/wizard/central_journal_report.py:51
585+#, python-format
586+msgid "The end date must be greater than the initial date."
587+msgstr "La data finale deve essere maggiore della data iniziale"
588+
589+#. module: account_central_journal
590+#: view:wizard.central.journal.report:0
591+msgid "Reference"
592+msgstr "Riferimento"
593+
594+#. module: account_central_journal
595+#: model:ir.actions.report.xml,name:account_central_journal.central_journal_report_id
596+msgid "central_journal"
597+msgstr "Giornale Centralizzato Report Webkit"
598+
599+#. module: account_central_journal
600+#: field:account.fiscalyear,progressive_page_number:0
601+msgid "Progressive of the page"
602+msgstr "Progressivo della pagina"
603+
604+#. module: account_central_journal
605+#: report:report.central_journal_report:124
606+msgid "TEST PRINTING"
607+msgstr "STAMPA DI PROVA"
608+
609+#. module: account_central_journal
610+#: view:account.fiscalyear:0
611+msgid "Central journal info"
612+msgstr "Informazione del Giornale Centralizzato"
613+
614+#. module: account_central_journal
615+#: report:report.central_journal_report:127
616+msgid "Page:"
617+msgstr "Pagina:"
618+
619+#. module: account_central_journal
620+#: report:report.central_journal_report:124
621+#: field:wizard.central.journal.report,date_move_line_from:0
622+#: field:wizard.central.journal.report,date_move_line_from_view:0
623+msgid "From date"
624+msgstr "Dalla data"
625+
626+#. module: account_central_journal
627+#: selection:wizard.central.journal.report,print_state:0
628+msgid "Ready for printing"
629+msgstr "Pronto per la stampa"
630+
631+#. module: account_central_journal
632+#: view:wizard.central.journal.report:0
633+msgid "Cancel"
634+msgstr "Annulla"
635+
636+#. module: account_central_journal
637+#: report:report.central_journal_report:131
638+msgid "Row"
639+msgstr "N.riga"
640+
641+#. module: account_central_journal
642+#: view:wizard.central.journal.report:0
643+msgid "Final print"
644+msgstr "Stampa definitiva"
645+
646+#. module: account_central_journal
647+#: report:report.central_journal_report:116
648+msgid "ACCOUNT JOURNAL"
649+msgstr "Giornale di Contabilità"
650+
651
652=== added directory 'account_central_journal/report'
653=== added file 'account_central_journal/report/__init__.py'
654--- account_central_journal/report/__init__.py 1970-01-01 00:00:00 +0000
655+++ account_central_journal/report/__init__.py 2012-06-27 10:38:24 +0000
656@@ -0,0 +1,22 @@
657+# -*- coding: utf-8 -*-
658+##############################################################################
659+#
660+# OpenERP, Open Source Management Solution
661+# Copyright (C) 2012 ISA s.r.l. (<http://www.isa.it>).
662+#
663+# This program is free software: you can redistribute it and/or modify
664+# it under the terms of the GNU Affero General Public License as
665+# published by the Free Software Foundation, either version 3 of the
666+# License, or (at your option) any later version.
667+#
668+# This program is distributed in the hope that it will be useful,
669+# but WITHOUT ANY WARRANTY; without even the implied warranty of
670+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
671+# GNU Affero General Public License for more details.
672+#
673+# You should have received a copy of the GNU Affero General Public License
674+# along with this program. If not, see <http://www.gnu.org/licenses/>.
675+#
676+##############################################################################
677+
678+import central_journal_report
679
680=== added file 'account_central_journal/report/central_journal_report.mako'
681--- account_central_journal/report/central_journal_report.mako 1970-01-01 00:00:00 +0000
682+++ account_central_journal/report/central_journal_report.mako 2012-06-27 10:38:24 +0000
683@@ -0,0 +1,186 @@
684+<html>
685+<head>
686+ <meta content="text/html; charset=UTF-8" http-equiv="content-type"/>
687+ <style type="text/css">
688+ ${css}
689+
690+ .page_block {
691+ /*border: 1px solid red;*/
692+ page-break-after: always;
693+ /*page-break-inside: avoid;*/
694+ }
695+ .p_row {
696+ page-break-inside: avoid;
697+ vertical-align:text-top;
698+ }
699+ .p_cell {
700+ overflow: hidden;
701+ padding: 1px 5px;
702+ }
703+ .p_text {
704+ color: black;
705+ font-size: 9px;
706+ font-family: "Courier New", Courier, monospace;
707+ }
708+ .p_cell_progr_row, .p_cell_debit, .p_cell_credit {
709+ text-align: right;
710+ }
711+
712+ .p_row_head {
713+ border: 1px solid black;
714+ border-width: 1px 0px;
715+ }
716+ .p_cell_head {
717+ font-weight: bold;
718+ padding: 3px 5px;
719+ }
720+
721+ .p_row_page {
722+ font-weight: bold;
723+ }
724+ .p_cell_test {
725+ padding: 5px 5px;
726+ }
727+ .p_cell_page {
728+ padding: 5px 5px;
729+ text-align: right;
730+ }
731+
732+ .p_row_total {
733+ font-weight: bold;
734+ border: 1px solid gray;
735+ }
736+ .p_row_total_up {
737+ border-width: 0px 0px 1px 0px;
738+ }
739+ .p_row_total_down {
740+ border-width: 1px 0px 0px 0px;
741+ }
742+ .p_cell_progressive {
743+ padding: 3px 5px;
744+ text-align: right;
745+ }
746+
747+ /* COLUMNS WIDTH */
748+ .p_cell_progr_row { width: 40px;}
749+ .p_cell_date { width: 65px;}
750+ .p_cell_ref { width: 70px;}
751+ .p_cell_move_id_name { width: 70px;}
752+ .p_cell_account_id_code { width: 50px;}
753+ .p_cell_account_id_name { width: 200px;}
754+ .p_cell_name { width: 250px;}
755+ .p_cell_debit { width: 70px;}
756+ .p_cell_credit { width: 70px;}
757+ </style>
758+</head>
759+
760+<body>
761+ <% setLang(user.context_lang) %>
762+ <%
763+ flag_print_final = data["print_final"]
764+ fiscalyear_id = data["form"]["fiscalyear"]
765+ date_from = data["form"]["date_move_line_from"]
766+ date_to = data["form"]["date_move_line_to"]
767+ %>
768+ <%
769+ print_info = get_print_info(fiscalyear_id)
770+ result_wizard = set_wizard_params(data["form"])
771+ result_rows = get_movements()
772+ %>
773+ <%
774+ page_rows = 50
775+
776+ num_rows = len(result_rows)
777+ num_row = 0
778+ new_page = True
779+
780+ progr_page = print_info['start_page']
781+ progr_row = print_info['start_row']
782+ %>
783+ <%
784+ debit_tot = print_info['start_debit']
785+ credit_tot = print_info['start_credit']
786+ %>
787+
788+ %for line in result_rows :
789+ <% num_row = num_row + 1 %>
790+ <% progr_row = progr_row + 1 %>
791+ % if new_page == True:
792+ <%
793+ new_page = False
794+ progr_page = progr_page + 1
795+ %>
796+ <div class="page_block">
797+ <table class="header" style="border-bottom: 0px solid black; width: 100%">
798+ <tr>
799+ <td style="text-align:center;"><span style="font-weight: bold; font-size: 14px;">${_("ACCOUNT JOURNAL")}</span></td>
800+ </tr>
801+ </table>
802+
803+ <table>
804+ <tr class="p_row p_row_page">
805+ <td colspan="7" class="p_cell p_cell_test">
806+ % if flag_print_final == False:
807+ <span class="p_text">${ _("TEST PRINTING") }&nbsp;${ _("From date") }&nbsp;${ formatLang(date_from, date=True) or ''|entity }&nbsp;${ _("to date") }&nbsp;${ formatLang(date_to, date=True) or ''|entity }</span>
808+ % endif
809+ </td>
810+ <td colspan="2" class="p_cell p_cell_page"><span class="p_text p_page">${ _("Page:") }&nbsp;&nbsp;${progr_page}</span></td>
811+ </tr>
812+
813+ <tr class="p_row p_row_head">
814+ <td class="p_cell p_cell_head"><span class="p_text">${ _("Row") }</span></td>
815+ <td class="p_cell p_cell_head"><span class="p_text">${ _("Date") }</span></td>
816+ <td class="p_cell p_cell_head"><span class="p_text">${ _("Ref") }</span></td>
817+ <td class="p_cell p_cell_head"><span class="p_text">${ _("Account move") }</span></td>
818+ <td class="p_cell p_cell_head"><span class="p_text">${ _("Account code") }</span></td>
819+ <td class="p_cell p_cell_head"><span class="p_text">${ _("Account name") }</span></td>
820+ <td class="p_cell p_cell_head"><span class="p_text">${ _("Name") }</span></td>
821+ <td class="p_cell p_cell_head p_cell_debit"><span class="p_text">${ _("Debit") }</span></td>
822+ <td class="p_cell p_cell_head p_cell_credit"><span class="p_text">${ _("Credit") }</span></td>
823+ </tr>
824+
825+ <tr class="p_row p_row_total p_row_total_up">
826+ <td colspan="6"></td>
827+ <td class="p_cell p_cell_progressive"><span class="p_text">${ _("Progressives =>") }</span></td>
828+ <td class="p_cell p_cell_debit"><span class="p_text p_debit">${ formatLang(debit_tot, digits=get_digits(dp='Account')) |entity }</span></td>
829+ <td class="p_cell p_cell_credit"><span class="p_text p_credit">${ formatLang(credit_tot, digits=get_digits(dp='Account')) |entity }</span></td>
830+ </tr>
831+ % endif
832+ <tr class="p_row">
833+ <td class="p_cell p_cell_progr_row"><span class="p_text p_progr_row">${progr_row}</span></td>
834+ <td class="p_cell p_cell_date"><span class="p_text p_date">${ formatLang(line.date, date=True) or ''|entity }</span></td>
835+ <td class="p_cell p_cell_ref"><span class="p_text p_ref">${ line.ref or ''|entity }</span></td>
836+ <td class="p_cell p_cell_move_id_name"><span class="p_text p_move_id_name">${ line.move_id.name or ''|entity }</span></td>
837+ <td class="p_cell p_cell_account_id_code"><span class="p_text p_account_id_code">${ line.account_id.code or ''|entity }</span></td>
838+ <td class="p_cell p_cell_account_id_name"><span class="p_text p_account_id_name">${ line.account_id.name or ''|entity }</span></td>
839+ <td class="p_cell p_cell_name"><span class="p_text p_name">${ line.name or ''|entity }</span></td>
840+ <td class="p_cell p_cell_debit"><span class="p_text p_debit">${ formatLang(line.debit, digits=get_digits(dp='Account')) |entity }</span></td>
841+ <td class="p_cell p_cell_credit"><span class="p_text p_credit">${ formatLang(line.credit, digits=get_digits(dp='Account')) |entity }</span></td>
842+ </tr>
843+ <%
844+ debit_tot = debit_tot + line.debit
845+ credit_tot = credit_tot + line.credit
846+ %>
847+ % if (num_row % page_rows) == 0 or num_row == num_rows :
848+ <%
849+ new_page = True
850+ %>
851+ <tr class="p_row p_row_total p_row_total_down">
852+ <td colspan="6"></td>
853+ <td class="p_cell p_cell_progressive"><span class="p_text">${ _("Progressives =>") }</span></td>
854+ <td class="p_cell p_cell_debit"><span class="p_text p_debit">${ formatLang(debit_tot, digits=get_digits(dp='Account')) |entity }</span></td>
855+ <td class="p_cell p_cell_credit"><span class="p_text p_credit">${ formatLang(credit_tot, digits=get_digits(dp='Account')) |entity }</span></td>
856+ </tr>
857+ </table>
858+ </div>
859+ % endif
860+ %endfor
861+
862+ <%
863+ if flag_print_final == True:
864+ print_info = set_print_info(fiscalyear_id, date_to, progr_row, progr_page, debit_tot, credit_tot)
865+ %>
866+
867+</body>
868+</html>
869+
870
871=== added file 'account_central_journal/report/central_journal_report.py'
872--- account_central_journal/report/central_journal_report.py 1970-01-01 00:00:00 +0000
873+++ account_central_journal/report/central_journal_report.py 2012-06-27 10:38:24 +0000
874@@ -0,0 +1,88 @@
875+# -*- coding: utf-8 -*-
876+##############################################################################
877+#
878+# OpenERP, Open Source Management Solution
879+# Copyright (C) 2012 ISA s.r.l. (<http://www.isa.it>).
880+#
881+# This program is free software: you can redistribute it and/or modify
882+# it under the terms of the GNU Affero General Public License as
883+# published by the Free Software Foundation, either version 3 of the
884+# License, or (at your option) any later version.
885+#
886+# This program is distributed in the hope that it will be useful,
887+# but WITHOUT ANY WARRANTY; without even the implied warranty of
888+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
889+# GNU Affero General Public License for more details.
890+#
891+# You should have received a copy of the GNU Affero General Public License
892+# along with this program. If not, see <http://www.gnu.org/licenses/>.
893+#
894+##############################################################################
895+
896+import time
897+from report import report_sxw
898+from osv import osv
899+from tools.translate import _
900+
901+class central_journal_report(report_sxw.rml_parse):
902+
903+ def _set_wizard_params(self,form_values):
904+ if form_values['date_move_line_from'] :
905+ date_move_line_from=form_values['date_move_line_from']
906+ filter=("date",">=",date_move_line_from)
907+ self.filters.append(filter)
908+ if form_values['date_move_line_to'] :
909+ date_move_line_to=form_values['date_move_line_to']
910+ filter=("date","<=",date_move_line_to)
911+ self.filters.append(filter)
912+ return True
913+
914+ def _get_print_info(self, fiscalyear_id):
915+ fiscalyear_obj = self.pool.get('account.fiscalyear')
916+ fiscalyear_ids=fiscalyear_obj.search(self.cr,self.uid,[('id','=',fiscalyear_id),])
917+ fiscalyear_data=fiscalyear_obj.browse(self.cr,self.uid,fiscalyear_ids)[0]
918+ print_info = {
919+ 'start_row': fiscalyear_data.progressive_line_number,
920+ 'start_page': fiscalyear_data.progressive_page_number,
921+ 'start_debit': fiscalyear_data.progressive_debit,
922+ 'start_credit': fiscalyear_data.progressive_credit,
923+ }
924+ return print_info
925+
926+ def _set_print_info(self, fiscalyear_id, end_date_print, end_row, end_page, end_debit, end_credit):
927+ fiscalyear_obj = self.pool.get('account.fiscalyear')
928+ fiscalyear_ids=fiscalyear_obj.search(self.cr,self.uid,[('id','=',fiscalyear_id),])
929+ fiscalyear_data=fiscalyear_obj.browse(self.cr,self.uid,fiscalyear_ids)[0]
930+ print_info = {
931+ 'date_last_print': end_date_print,
932+ 'progressive_line_number': end_row,
933+ 'progressive_page_number': end_page,
934+ 'progressive_debit': end_debit,
935+ 'progressive_credit': end_credit,
936+ }
937+ res = fiscalyear_obj.write(self.cr, self.uid, fiscalyear_ids, print_info)
938+ return res
939+
940+ def _get_movements(self):
941+ move_line_obj = self.pool.get('account.move.line')
942+ line_ids=move_line_obj.search(self.cr,self.uid,self.filters,order="id asc")
943+ report_lines=move_line_obj.browse(self.cr,self.uid,line_ids)
944+ return report_lines
945+
946+ def __init__(self, cr, uid, name, context):
947+ self.filters=[]
948+ super(central_journal_report, self).__init__(cr, uid, name, context)
949+ self.localcontext.update({
950+ 'time': time,
951+ 'cr':cr,
952+ 'uid': uid,
953+ 'get_print_info': self._get_print_info,
954+ 'set_print_info': self._set_print_info,
955+ 'set_wizard_params': self._set_wizard_params,
956+ 'get_movements': self._get_movements,
957+ })
958+
959+report_sxw.report_sxw('report.central_journal_report',
960+ 'account.move.line',
961+ 'addons/account_central_journal/report/central_journal_report.mako',
962+ parser=central_journal_report)
963
964=== added file 'account_central_journal/report/report.xml'
965--- account_central_journal/report/report.xml 1970-01-01 00:00:00 +0000
966+++ account_central_journal/report/report.xml 2012-06-27 10:38:24 +0000
967@@ -0,0 +1,14 @@
968+<?xml version="1.0"?>
969+<openerp>
970+ <data>
971+ <record id="central_journal_report_id" model="ir.actions.report.xml">
972+ <field name="name">central_journal</field>
973+ <field name="type">ir.actions.report.xml</field>
974+ <field name="model">account.move.line</field>
975+ <field name="report_name">central_journal_report</field>
976+ <field name="report_rml">account_central_journal/report/central_journal_report.mako</field>
977+ <field name="report_type">webkit</field>
978+ </record>
979+ </data>
980+</openerp>
981+
982
983=== added file 'account_central_journal/report/webkit_model.xml'
984--- account_central_journal/report/webkit_model.xml 1970-01-01 00:00:00 +0000
985+++ account_central_journal/report/webkit_model.xml 2012-06-27 10:38:24 +0000
986@@ -0,0 +1,107 @@
987+<?xml version="1.0" ?>
988+<openerp>
989+ <data noupdate="1">
990+ <record id="ir_header_central_journal_report" model="ir.header_webkit">
991+ <field name="footer_html"></field>
992+ <field eval="&quot;&quot;&quot;Landscape&quot;&quot;&quot;" name="orientation"/>
993+ <field eval="&quot;&quot;&quot;A4&quot;&quot;&quot;" name="format"/>
994+ <field name="html"><![CDATA[<html>
995+ <head>
996+ <meta content="text/html; charset=UTF-8" http-equiv="content-type"/>
997+ <script>
998+ function subst() {
999+ var vars={};
1000+ var x=document.location.search.substring(1).split('&');
1001+ for(var i in x) {var z=x[i].split('=',2);vars[z[0]] = unescape(z[1]);}
1002+ var x=['frompage','topage','page','webpage','section','subsection','subsubsection'];
1003+ for(var i in x) {
1004+ var y = document.getElementsByClassName(x[i]);
1005+ for(var j=0; j<y.length; ++j) y[j].textContent = vars[x[i]];
1006+ }
1007+ }
1008+ </script>
1009+ <style type="text/css">
1010+ ${css}
1011+ </style>
1012+ </head>
1013+ <body style="border:0; margin:0;" onload="subst()">
1014+ <table class="header" style="border-bottom: 0px solid black; width: 100%">
1015+ <tr>
1016+ <td style="text-align:left; padding: 5px 0px;">
1017+ <span style="font-weight: bold;">
1018+ ${company.partner_id.name |entity}&nbsp;
1019+ ${company.partner_id.vat or '' |entity}&nbsp;
1020+ ${company.partner_id.address and company.partner_id.address[0].street or '' |entity}&nbsp;
1021+ ${company.partner_id.address and company.partner_id.address[0].street2 or '' |entity}&nbsp;
1022+ ${company.partner_id.address and company.partner_id.address[0].zip or '' |entity}&nbsp;
1023+ ${company.partner_id.address and company.partner_id.address[0].city or '' |entity}&nbsp;</span>
1024+ </td>
1025+ </tr>
1026+ </table> ${_debug or ''|n}
1027+ </body>
1028+</html>]]>
1029+</field>
1030+ <field eval="20.0" name="margin_top"/>
1031+ <field eval="15.0" name="margin_bottom"/>
1032+ <field eval="15.0" name="margin_left"/>
1033+ <field eval="15.0" name="margin_right"/>
1034+ <field name="css" ><![CDATA[
1035+ /* http://meyerweb.com/eric/tools/css/reset/
1036+ v2.0 | 20110126
1037+ License: none (public domain)
1038+ */
1039+ /* START OF RESET CSS */
1040+ html, body, div, span, applet, object, iframe,
1041+ h1, h2, h3, h4, h5, h6, p, blockquote, pre,
1042+ a, abbr, acronym, address, big, cite, code,
1043+ del, dfn, em, img, ins, kbd, q, s, samp,
1044+ small, strike, strong, sub, sup, tt, var,
1045+ b, u, i, center,
1046+ dl, dt, dd, ol, ul, li,
1047+ fieldset, form, label, legend,
1048+ table, caption, tbody, tfoot, thead, tr, th, td,
1049+ article, aside, canvas, details, embed,
1050+ figure, figcaption, footer, header, hgroup,
1051+ menu, nav, output, ruby, section, summary,
1052+ time, mark, audio, video {
1053+ margin: 0;
1054+ padding: 0;
1055+ border: 0;
1056+ font-size: 100%;
1057+ font: inherit;
1058+ vertical-align: baseline;
1059+ }
1060+ /* HTML5 display-role reset for older browsers */
1061+ article, aside, details, figcaption, figure,
1062+ footer, header, hgroup, menu, nav, section {
1063+ display: block;
1064+ }
1065+ body {
1066+ line-height: 1;
1067+ }
1068+ ol, ul {
1069+ list-style: none;
1070+ }
1071+ blockquote, q {
1072+ quotes: none;
1073+ }
1074+ blockquote:before, blockquote:after,
1075+ q:before, q:after {
1076+ content: '';
1077+ content: none;
1078+ }
1079+ table {
1080+ border-collapse: collapse;
1081+ border-spacing: 0;
1082+ }
1083+ /* END OF RESET CSS */
1084+
1085+ body {
1086+ font-family: font-family: Verdana, Arial, Helvetica, sans-serif;
1087+ font-size: 12px;
1088+ }
1089+]]> </field>
1090+ <field eval="&quot;&quot;&quot;Central Journal Report&quot;&quot;&quot;" name="name"/>
1091+ </record>
1092+ </data>
1093+</openerp>
1094
1095=== added directory 'account_central_journal/wizard'
1096=== added file 'account_central_journal/wizard/__init__.py'
1097--- account_central_journal/wizard/__init__.py 1970-01-01 00:00:00 +0000
1098+++ account_central_journal/wizard/__init__.py 2012-06-27 10:38:24 +0000
1099@@ -0,0 +1,22 @@
1100+# -*- coding: utf-8 -*-
1101+##############################################################################
1102+#
1103+# OpenERP, Open Source Management Solution
1104+# Copyright (C) 2012 ISA s.r.l. (<http://www.isa.it>).
1105+#
1106+# This program is free software: you can redistribute it and/or modify
1107+# it under the terms of the GNU Affero General Public License as
1108+# published by the Free Software Foundation, either version 3 of the
1109+# License, or (at your option) any later version.
1110+#
1111+# This program is distributed in the hope that it will be useful,
1112+# but WITHOUT ANY WARRANTY; without even the implied warranty of
1113+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1114+# GNU Affero General Public License for more details.
1115+#
1116+# You should have received a copy of the GNU Affero General Public License
1117+# along with this program. If not, see <http://www.gnu.org/licenses/>.
1118+#
1119+##############################################################################
1120+
1121+import central_journal_report
1122
1123=== added file 'account_central_journal/wizard/central_journal_report.py'
1124--- account_central_journal/wizard/central_journal_report.py 1970-01-01 00:00:00 +0000
1125+++ account_central_journal/wizard/central_journal_report.py 2012-06-27 10:38:24 +0000
1126@@ -0,0 +1,135 @@
1127+# -*- coding: utf-8 -*-
1128+##############################################################################
1129+#
1130+# OpenERP, Open Source Management Solution
1131+# Copyright (C) 2012 ISA s.r.l. (<http://www.isa.it>).
1132+#
1133+# This program is free software: you can redistribute it and/or modify
1134+# it under the terms of the GNU Affero General Public License as
1135+# published by the Free Software Foundation, either version 3 of the
1136+# License, or (at your option) any later version.
1137+#
1138+# This program is distributed in the hope that it will be useful,
1139+# but WITHOUT ANY WARRANTY; without even the implied warranty of
1140+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1141+# GNU Affero General Public License for more details.
1142+#
1143+# You should have received a copy of the GNU Affero General Public License
1144+# along with this program. If not, see <http://www.gnu.org/licenses/>.
1145+#
1146+##############################################################################
1147+
1148+import time
1149+from datetime import datetime, date, timedelta
1150+from osv import osv, fields
1151+from tools.translate import _
1152+
1153+class central_journal_report(osv.osv_memory):
1154+
1155+ _name = 'wizard.central.journal.report'
1156+ _description = 'Printing parameters of the Center Journal'
1157+
1158+ def _get_fiscal_years(self, cr, uid, context=None):
1159+ fiscalyear_obj = self.pool.get('account.fiscalyear')
1160+ fiscalyear_ids = fiscalyear_obj.search(cr, uid, [], order="id desc")
1161+ fiscalyears = []
1162+ for account_fiscalyear in fiscalyear_obj.browse(cr,uid,fiscalyear_ids) :
1163+ fiscalyears.append((account_fiscalyear.id, account_fiscalyear.name))
1164+ return fiscalyears
1165+
1166+ def _get_account_fiscalyear_data(self, cr, uid, ids, fiscalyear_id):
1167+ fiscalyear_obj = self.pool.get('account.fiscalyear')
1168+ fiscalyear_ids=fiscalyear_obj.search(cr,uid,[('id','=',fiscalyear_id),])
1169+ fiscalyear_data=fiscalyear_obj.browse(cr,uid,fiscalyear_ids)[0]
1170+ return fiscalyear_data
1171+
1172+ def _dates_control(self, str_date_start, str_date_end):
1173+ today_date = date.today()
1174+ date_start = datetime.strptime(str_date_start,"%Y-%m-%d").date()
1175+ date_stop = datetime.strptime(str_date_end,"%Y-%m-%d").date()
1176+ if date_start > date_stop:
1177+ raise osv.except_osv(_('Wrong dates !'), _("The end date must be greater than the initial date."))
1178+ return False
1179+ if date_stop > today_date:
1180+ raise osv.except_osv(_('Wrong dates !'), _("The end date can not be greater than today's date."))
1181+ return False
1182+ return True
1183+
1184+ def _get_report_datas(self, cr, uid, ids, context={}):
1185+ wizard_form_datas = self.read(cr, uid, ids)[0]
1186+ datas = {
1187+ 'ids': [],
1188+ 'model': 'account.move.line',
1189+ 'form': wizard_form_datas,
1190+ }
1191+ return datas
1192+
1193+ _columns = {
1194+ 'date_move_line_from': fields.date('From date', required=True,),
1195+ 'date_move_line_from_view': fields.date('From date'),
1196+ 'date_move_line_to': fields.date('to date', required=True),
1197+ 'fiscalyear': fields.selection(_get_fiscal_years, 'Fiscal Year', required=True),
1198+ 'print_state': fields.selection([('draft','Draft'),('print','Ready for printing'),('printed','Printed')],'State',readonly=True),
1199+ }
1200+
1201+ def onchange_fiscalyear(self, cr, uid, ids, fiscalyear_id=False, context=None):
1202+ print_state = 'draft'
1203+ date_move_line_from = date_move_line_from_view = False
1204+ date_move_line_to = False
1205+ if fiscalyear_id:
1206+ print_state = 'print'
1207+ fiscalyear_data = self._get_account_fiscalyear_data(cr, uid, ids, fiscalyear_id)
1208+ #set values
1209+ today_date = date.today()
1210+ date_start = datetime.strptime(fiscalyear_data.date_start,"%Y-%m-%d").date()
1211+ date_stop = datetime.strptime(fiscalyear_data.date_stop,"%Y-%m-%d").date()
1212+ #set date_move_line_from
1213+ if fiscalyear_data.date_last_print:
1214+ date_last_print = datetime.strptime(fiscalyear_data.date_last_print,"%Y-%m-%d").date()
1215+ date_move_line_from = date_move_line_from_view = (date_last_print+timedelta(days=1)).__str__()
1216+ if date_last_print == date_stop:
1217+ date_move_line_from = date_move_line_from_view = date_start.__str__()
1218+ print_state = 'printed'
1219+ else:
1220+ date_move_line_from = date_move_line_from_view = date_start.__str__()
1221+ #set date_move_line_to
1222+ if today_date > date_stop:
1223+ date_move_line_to = date_stop.__str__()
1224+ else:
1225+ date_move_line_to = (today_date-timedelta(days=1)).__str__()
1226+
1227+ return {'value': {
1228+ 'date_move_line_from': date_move_line_from,
1229+ 'date_move_line_from_view': date_move_line_from_view,
1230+ 'date_move_line_to': date_move_line_to,
1231+ 'print_state': print_state,
1232+ }
1233+ }
1234+
1235+ def print_report(self, cr, uid, ids, context={}):
1236+ datas = self._get_report_datas(cr, uid, ids, context)
1237+ if self._dates_control(datas['form']['date_move_line_from'],datas['form']['date_move_line_to']) == False:
1238+ return False
1239+ datas['print_final'] = False
1240+ return {
1241+ 'type': 'ir.actions.report.xml',
1242+ 'report_name': 'central_journal_report',
1243+ 'datas': datas,
1244+ }
1245+
1246+ def print_report_final(self, cr, uid, ids, context={}):
1247+ datas = self._get_report_datas(cr, uid, ids, context)
1248+ if self._dates_control(datas['form']['date_move_line_from'],datas['form']['date_move_line_to']) == False:
1249+ return False
1250+ datas['print_final'] = True
1251+ return {
1252+ 'type': 'ir.actions.report.xml',
1253+ 'report_name': 'central_journal_report',
1254+ 'datas': datas,
1255+ }
1256+
1257+ _defaults = {
1258+ 'print_state': 'draft',
1259+ }
1260+
1261+central_journal_report()
1262
1263=== added file 'account_central_journal/wizard/central_journal_report.xml'
1264--- account_central_journal/wizard/central_journal_report.xml 1970-01-01 00:00:00 +0000
1265+++ account_central_journal/wizard/central_journal_report.xml 2012-06-27 10:38:24 +0000
1266@@ -0,0 +1,59 @@
1267+<?xml version="1.0" encoding="utf-8"?>
1268+<openerp>
1269+ <data>
1270+
1271+ <!--
1272+ Central Journal Report Filter View
1273+ -->
1274+
1275+ <record model="ir.ui.view" id="central_journal_report_form_view">
1276+ <field name="name">wizard.central.journal.report.form</field>
1277+ <field name="model">wizard.central.journal.report</field>
1278+ <field name="type">form</field>
1279+ <field name="arch" type="xml">
1280+ <form string="Printing parameters of the Center Journal">
1281+ <group colspan="4" col="4">
1282+ <separator colspan="4" string="Reference"/>
1283+ <field name="fiscalyear" on_change="onchange_fiscalyear(fiscalyear)"/>
1284+ <separator colspan="4" string="Dates movements"/>
1285+ <field name="date_move_line_from" invisible="1"/>
1286+ <field name="date_move_line_from_view" readonly="1"/>
1287+ <field name="date_move_line_to" attrs="{'readonly':[('print_state','!=','print')]}"/>
1288+ </group>
1289+ <newline/>
1290+ <separator colspan="4"/>
1291+ <group colspan="4" col="6">
1292+ <field name="print_state"/>
1293+ <button special="cancel" string="Cancel" icon='gtk-cancel'/>
1294+ <button name="print_report" string="Print" type="object" icon="gtk-print" attrs="{'invisible':[('print_state','=','printed')]}"/>
1295+ <button name="print_report_final" string="Final print" type="object" icon="gtk-print" attrs="{'invisible':[('print_state','=','printed')]}"/>
1296+ </group>
1297+ </form>
1298+ </field>
1299+ </record>
1300+
1301+ <!--action -->
1302+ <record model="ir.actions.act_window" id="central_journal_report_action">
1303+ <field name="name">Print Central Journal</field>
1304+ <field name="type">ir.actions.act_window</field>
1305+ <field name="res_model">wizard.central.journal.report</field>
1306+ <field name="view_type">form</field>
1307+ <field name="view_mode">form</field>
1308+ <field name="target">new</field>
1309+ </record>
1310+
1311+ <!--this feature works only in this file. Don't move-->
1312+ <record model="ir.values" id="central_journal_report_webkit">
1313+ <field name="model_id" ref="account.model_account_move_line" />
1314+ <field name="object" eval="1" />
1315+ <field name="name">central_journal</field>
1316+ <field name="key2">client_print_multi</field>
1317+ <field name="value" eval="'ir.actions.act_window,' + str(ref('central_journal_report_action'))" />
1318+ <field name="key">action</field>
1319+ <field name="model">account.move.line</field>
1320+ </record>
1321+
1322+ <menuitem id="menu_central_journal_report_action" parent="account.menu_finance_legal_statement" action="central_journal_report_action"/>
1323+
1324+ </data>
1325+</openerp>

Subscribers

People subscribed via source and target branches