Merge lp:~a-camilli/openobject-italia/7.0-libro_giornale into lp:~openobject-italia-core-devs/openobject-italia/italian-addons-7.0

Proposed by Alessandro Camilli
Status: Merged
Approved by: Alessandro Camilli
Approved revision: 237
Merged at revision: 239
Proposed branch: lp:~a-camilli/openobject-italia/7.0-libro_giornale
Merge into: lp:~openobject-italia-core-devs/openobject-italia/italian-addons-7.0
Diff against target: 1331 lines (+1250/-0)
15 files modified
account_central_journal/AUTHORS.txt (+2/-0)
account_central_journal/__init__.py (+25/-0)
account_central_journal/__openerp__.py (+47/-0)
account_central_journal/account.py (+42/-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 (+190/-0)
account_central_journal/report/central_journal_report.py (+89/-0)
account_central_journal/report/report.xml (+15/-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:~a-camilli/openobject-italia/7.0-libro_giornale
Reviewer Review Type Date Requested Status
Lorenzo Battistini code review Approve
Francesco Apruzzese (community) Approve
andrea_cg (community) Approve
Review via email: mp+208756@code.launchpad.net

Description of the change

Porting dalla 6.1

To post a comment you must log in.
Revision history for this message
andrea_cg (a-gallina) wrote :

Bel Lavoro! Approvo!

review: Approve
Revision history for this message
Francesco Apruzzese (opencode) wrote :

Interessante! Approve!

review: Approve
Revision history for this message
Lorenzo Battistini (elbati) wrote :

Riporto il diff per completezza

http://pastie.org/8882130

Revision history for this message
Lorenzo Battistini (elbati) wrote :

Ciao Alessandro, Grazie.
Non credo sia corretto rimuovere il
noupdate="1"
in quanto se un utente modificasse l'header del report a proprio piacere e successivamente aggiornasse il modulo, perderebbe le modifiche fatte.

review: Needs Fixing
Revision history for this message
Alessandro Camilli (a-camilli) wrote :

In effetti io ho pensato solo al fatto che se la comunità aggiorna l'header per correggere un bug mi sembrava giusto fare il replace di quello esistente.

In questo caso (di una aggiornamento dell'header dovuto ad un bug), come si deve comportare un utente che manualmente va a cambiare quello caricato dalla prima installazione?

237. By Alessandro Camilli

noupdate attivo su header

Revision history for this message
Lorenzo Battistini (elbati) wrote :

In questo caso non è un bug ma una modifica necessaria al passaggio di versione. Quindi la modifica teoricamente dovrebbe essere messa in uno script di migrazione. In mancanza di questo, si può sempre modificare a mano.

In generale, tutti i dati di "configurazione" (vedi gli header webkit, ma anche le sequenze, le traduzioni, le imposte e tante oltre cose) non dovrebbero essere sovrascritte dall'aggiornamento dei moduli. Altrimenti le modifiche fatte dagli utenti o amministratori di sistema sarebbero vane

Revision history for this message
Alessandro Camilli (a-camilli) wrote :

grazie. Ora penso dovrebbe andar bene.

Revision history for this message
Lorenzo Battistini (elbati) :
review: Approve (code review)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== added directory 'account_central_journal'
=== added file 'account_central_journal/AUTHORS.txt'
--- account_central_journal/AUTHORS.txt 1970-01-01 00:00:00 +0000
+++ account_central_journal/AUTHORS.txt 2014-03-06 15:06:22 +0000
@@ -0,0 +1,2 @@
1Daniele Arcangeli <d.arcangeli@isa.it>
2Alessandro Camilli <a.camilli@yahoo.it>
0\ No newline at end of file3\ No newline at end of file
14
=== added file 'account_central_journal/__init__.py'
--- account_central_journal/__init__.py 1970-01-01 00:00:00 +0000
+++ account_central_journal/__init__.py 2014-03-06 15:06:22 +0000
@@ -0,0 +1,25 @@
1# -*- coding: utf-8 -*-
2##############################################################################
3#
4# OpenERP, Open Source Management Solution
5# Copyright (C) 2012 ISA s.r.l. (<http://www.isa.it>).
6#
7# This program is free software: you can redistribute it and/or modify
8# it under the terms of the GNU Affero General Public License as
9# published by the Free Software Foundation, either version 3 of the
10# License, or (at your option) any later version.
11#
12# This program is distributed in the hope that it will be useful,
13# but WITHOUT ANY WARRANTY; without even the implied warranty of
14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15# GNU Affero General Public License for more details.
16#
17# You should have received a copy of the GNU Affero General Public License
18# along with this program. If not, see <http://www.gnu.org/licenses/>.
19#
20##############################################################################
21
22import account
23import wizard
24import report
25
026
=== added file 'account_central_journal/__openerp__.py'
--- account_central_journal/__openerp__.py 1970-01-01 00:00:00 +0000
+++ account_central_journal/__openerp__.py 2014-03-06 15:06:22 +0000
@@ -0,0 +1,47 @@
1# -*- coding: utf-8 -*-
2##############################################################################
3#
4# OpenERP, Open Source Management Solution
5# Copyright (C) 2011 ISA s.r.l. (<http://www.isa.it>).
6#
7# This program is free software: you can redistribute it and/or modify
8# it under the terms of the GNU Affero General Public License as
9# published by the Free Software Foundation, either version 3 of the
10# License, or (at your option) any later version.
11#
12# This program is distributed in the hope that it will be useful,
13# but WITHOUT ANY WARRANTY; without even the implied warranty of
14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15# GNU Affero General Public License for more details.
16#
17# You should have received a copy of the GNU Affero General Public License
18# along with this program. If not, see <http://www.gnu.org/licenses/>.
19#
20##############################################################################
21
22{
23 'name': 'Account Central Journal',
24 'version': '3',
25 'author': "ISA S.r.l.",
26 'website': 'http://www.isa.it',
27 'category': 'Generic Modules/Accounting',
28 'description': """
29Managing the printing of the "Central Journal" """,
30 'depends' : [
31 'base',
32 'account',
33 'report_webkit',
34 ],
35 'init_xml' : [],
36 'update_xml': [
37 'report/webkit_model.xml',
38 'report/report.xml',
39 'wizard/central_journal_report.xml',
40 'account_view.xml',
41 ],
42 'demo_xml': [],
43 'test':[],
44 'installable': True,
45 'active': False,
46 'certificate': '',
47}
048
=== added file 'account_central_journal/account.py'
--- account_central_journal/account.py 1970-01-01 00:00:00 +0000
+++ account_central_journal/account.py 2014-03-06 15:06:22 +0000
@@ -0,0 +1,42 @@
1# -*- coding: utf-8 -*-
2##############################################################################
3#
4# OpenERP, Open Source Management Solution
5# Copyright (C) 2012 ISA s.r.l. (<http://www.isa.it>).
6#
7# This program is free software: you can redistribute it and/or modify
8# it under the terms of the GNU Affero General Public License as
9# published by the Free Software Foundation, either version 3 of the
10# License, or (at your option) any later version.
11#
12# This program is distributed in the hope that it will be useful,
13# but WITHOUT ANY WARRANTY; without even the implied warranty of
14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15# GNU Affero General Public License for more details.
16#
17# You should have received a copy of the GNU Affero General Public License
18# along with this program. If not, see <http://www.gnu.org/licenses/>.
19#
20##############################################################################
21
22from osv import fields, orm
23from tools.translate import _
24import decimal_precision as dp
25
26class account_fiscalyear(orm.Model):
27 _inherit = "account.fiscalyear"
28 _description = "Fiscal Year"
29 _columns = {
30 'date_last_print': fields.date('Last printed date', readonly=True),
31 'progressive_page_number': fields.integer('Progressive of the page', required=True, readonly=True),
32 'progressive_line_number': fields.integer('Progressive line', required=True, readonly=True),
33 'progressive_credit': fields.float('Progressive Credit', digits_compute=dp.get_precision('Account'), required=True, readonly=True),
34 'progressive_debit': fields.float('Progressive Debit', digits_compute=dp.get_precision('Account'), required=True, readonly=True),
35 }
36
37 _defaults = {
38 'progressive_page_number': 0,
39 'progressive_line_number': 0,
40 'progressive_credit': lambda *a: float(),
41 'progressive_debit': lambda *a: float(),
42 }
043
=== added file 'account_central_journal/account_view.xml'
--- account_central_journal/account_view.xml 1970-01-01 00:00:00 +0000
+++ account_central_journal/account_view.xml 2014-03-06 15:06:22 +0000
@@ -0,0 +1,27 @@
1<?xml version="1.0" encoding="utf-8"?>
2<openerp>
3 <data>
4
5 <!--
6 Account Fiscal Year inheritancy
7 -->
8
9 <record id="account_central_journal_form_view" model="ir.ui.view">
10 <field name="name">account.central.journal.form</field>
11 <field name="model">account.fiscalyear</field>
12 <field name="inherit_id" ref="account.view_account_fiscalyear_form"/>
13 <field name="arch" type="xml">
14 <field name="end_journal_period_id" position="after">
15 <separator colspan="4" string="Central journal info"/>
16 <field name="date_last_print"/>
17 <newline/>
18 <field name="progressive_page_number"/>
19 <field name="progressive_line_number"/>
20 <field name="progressive_credit"/>
21 <field name="progressive_debit"/>
22 </field>
23 </field>
24 </record>
25
26 </data>
27</openerp>
028
=== added directory 'account_central_journal/i18n'
=== added file 'account_central_journal/i18n/account_central_journal.pot'
--- account_central_journal/i18n/account_central_journal.pot 1970-01-01 00:00:00 +0000
+++ account_central_journal/i18n/account_central_journal.pot 2014-03-06 15:06:22 +0000
@@ -0,0 +1,235 @@
1# Translation of OpenERP Server.
2# This file contains the translation of the following modules:
3# * account_central_journal
4#
5msgid ""
6msgstr ""
7"Project-Id-Version: OpenERP Server 6.0.3\n"
8"Report-Msgid-Bugs-To: support@openerp.com\n"
9"POT-Creation-Date: 2012-03-16 14:39+0000\n"
10"PO-Revision-Date: 2012-03-16 14:39+0000\n"
11"Last-Translator: <>\n"
12"Language-Team: \n"
13"MIME-Version: 1.0\n"
14"Content-Type: text/plain; charset=UTF-8\n"
15"Content-Transfer-Encoding: \n"
16"Plural-Forms: \n"
17
18#. module: account_central_journal
19#: model:ir.actions.act_window,name:account_central_journal.central_journal_report_action
20#: model:ir.ui.menu,name:account_central_journal.menu_central_journal_report_action
21msgid "Print Central Journal"
22msgstr ""
23
24#. module: account_central_journal
25#: report:report.central_journal_report:135
26msgid "Account code"
27msgstr ""
28
29#. module: account_central_journal
30#: report:report.central_journal_report:144
31#: report:report.central_journal_report:170
32msgid "Progressives =>"
33msgstr ""
34
35#. module: account_central_journal
36#: model:ir.model,name:account_central_journal.model_central_journal_report
37#: model:ir.model,name:account_central_journal.model_wizard_central_journal_report
38#: view:wizard.central.journal.report:0
39msgid "Printing parameters of the Center Journal"
40msgstr ""
41
42#. module: account_central_journal
43#: field:wizard.central.journal.report,print_state:0
44msgid "State"
45msgstr ""
46
47#. module: account_central_journal
48#: selection:wizard.central.journal.report,print_state:0
49msgid "Draft"
50msgstr ""
51
52#. module: account_central_journal
53#: report:report.central_journal_report:134
54msgid "Account move"
55msgstr ""
56
57#. module: account_central_journal
58#: report:report.central_journal_report:138
59msgid "Debit"
60msgstr ""
61
62#. module: account_central_journal
63#: view:wizard.central.journal.report:0
64msgid "Print"
65msgstr ""
66
67#. module: account_central_journal
68#: field:account.fiscalyear,progressive_credit:0
69msgid "Progressive Credit"
70msgstr ""
71
72#. module: account_central_journal
73#: model:ir.module.module,description:account_central_journal.module_meta_information
74msgid "\n"
75"Managing the printing of the \"Central Journal\" "
76msgstr ""
77
78#. module: account_central_journal
79#: constraint:account.fiscalyear:0
80msgid "Error! You cannot define overlapping fiscal years"
81msgstr ""
82
83#. module: account_central_journal
84#: report:report.central_journal_report:133
85msgid "Ref"
86msgstr ""
87
88#. module: account_central_journal
89#: field:account.fiscalyear,date_last_print:0
90msgid "Last printed date"
91msgstr ""
92
93#. module: account_central_journal
94#: selection:wizard.central.journal.report,print_state:0
95msgid "Printed"
96msgstr ""
97
98#. module: account_central_journal
99#: report:report.central_journal_report:136
100msgid "Account name"
101msgstr ""
102
103#. module: account_central_journal
104#: report:report.central_journal_report:132
105msgid "Date"
106msgstr ""
107
108#. module: account_central_journal
109#: code:addons/account_central_journal/wizard/central_journal_report.py:51
110#: code:addons/account_central_journal/wizard/central_journal_report.py:54
111#, python-format
112msgid "Wrong dates !"
113msgstr ""
114
115#. module: account_central_journal
116#: view:wizard.central.journal.report:0
117msgid "Dates movements"
118msgstr ""
119
120#. module: account_central_journal
121#: field:account.fiscalyear,progressive_debit:0
122msgid "Progressive Debit"
123msgstr ""
124
125#. module: account_central_journal
126#: report:report.central_journal_report:124
127#: field:wizard.central.journal.report,date_move_line_to:0
128msgid "to date"
129msgstr ""
130
131#. module: account_central_journal
132#: report:report.central_journal_report:137
133msgid "Name"
134msgstr ""
135
136#. module: account_central_journal
137#: model:ir.module.module,shortdesc:account_central_journal.module_meta_information
138msgid "Account Central Journal"
139msgstr ""
140
141#. module: account_central_journal
142#: field:account.fiscalyear,progressive_line_number:0
143msgid "Progressive line"
144msgstr ""
145
146#. module: account_central_journal
147#: code:addons/account_central_journal/wizard/central_journal_report.py:54
148#, python-format
149msgid "The end date can not be greater than today's date."
150msgstr ""
151
152#. module: account_central_journal
153#: report:report.central_journal_report:139
154msgid "Credit"
155msgstr ""
156
157#. module: account_central_journal
158#: model:ir.model,name:account_central_journal.model_account_fiscalyear
159#: field:wizard.central.journal.report,fiscalyear:0
160msgid "Fiscal Year"
161msgstr ""
162
163#. module: account_central_journal
164#: constraint:account.fiscalyear:0
165msgid "Error! The duration of the Fiscal Year is invalid. "
166msgstr ""
167
168#. module: account_central_journal
169#: code:addons/account_central_journal/wizard/central_journal_report.py:51
170#, python-format
171msgid "The end date must be greater than the initial date."
172msgstr ""
173
174#. module: account_central_journal
175#: view:wizard.central.journal.report:0
176msgid "Reference"
177msgstr ""
178
179#. module: account_central_journal
180#: model:ir.actions.report.xml,name:account_central_journal.central_journal_report_id
181msgid "central_journal"
182msgstr ""
183
184#. module: account_central_journal
185#: field:account.fiscalyear,progressive_page_number:0
186msgid "Progressive of the page"
187msgstr ""
188
189#. module: account_central_journal
190#: report:report.central_journal_report:124
191msgid "TEST PRINTING"
192msgstr ""
193
194#. module: account_central_journal
195#: view:account.fiscalyear:0
196msgid "Central journal info"
197msgstr ""
198
199#. module: account_central_journal
200#: report:report.central_journal_report:127
201msgid "Page:"
202msgstr ""
203
204#. module: account_central_journal
205#: report:report.central_journal_report:124
206#: field:wizard.central.journal.report,date_move_line_from:0
207#: field:wizard.central.journal.report,date_move_line_from_view:0
208msgid "From date"
209msgstr ""
210
211#. module: account_central_journal
212#: selection:wizard.central.journal.report,print_state:0
213msgid "Ready for printing"
214msgstr ""
215
216#. module: account_central_journal
217#: view:wizard.central.journal.report:0
218msgid "Cancel"
219msgstr ""
220
221#. module: account_central_journal
222#: report:report.central_journal_report:131
223msgid "Row"
224msgstr ""
225
226#. module: account_central_journal
227#: view:wizard.central.journal.report:0
228msgid "Final print"
229msgstr ""
230
231#. module: account_central_journal
232#: report:report.central_journal_report:116
233msgid "ACCOUNT JOURNAL"
234msgstr ""
235
0236
=== added file 'account_central_journal/i18n/it.mo'
1Binary files account_central_journal/i18n/it.mo 1970-01-01 00:00:00 +0000 and account_central_journal/i18n/it.mo 2014-03-06 15:06:22 +0000 differ237Binary files account_central_journal/i18n/it.mo 1970-01-01 00:00:00 +0000 and account_central_journal/i18n/it.mo 2014-03-06 15:06:22 +0000 differ
=== added file 'account_central_journal/i18n/it.po'
--- account_central_journal/i18n/it.po 1970-01-01 00:00:00 +0000
+++ account_central_journal/i18n/it.po 2014-03-06 15:06:22 +0000
@@ -0,0 +1,233 @@
1msgid ""
2msgstr ""
3"Project-Id-Version: Account Central Journal\n"
4"Report-Msgid-Bugs-To: support@openerp.com\n"
5"POT-Creation-Date: 2012-03-16 14:39+0000\n"
6"PO-Revision-Date: \n"
7"Last-Translator: Daniele Arcangeli <d.arcangeli@isa.it>\n"
8"Language-Team: \n"
9"MIME-Version: 1.0\n"
10"Content-Type: text/plain; charset=UTF-8\n"
11"Content-Transfer-Encoding: 8bit\n"
12
13#. module: account_central_journal
14#: model:ir.actions.act_window,name:account_central_journal.central_journal_report_action
15#: model:ir.ui.menu,name:account_central_journal.menu_central_journal_report_action
16msgid "Print Central Journal"
17msgstr "Giornale Centralizzato"
18
19#. module: account_central_journal
20#: report:report.central_journal_report:135
21msgid "Account code"
22msgstr "Codice Conto"
23
24#. module: account_central_journal
25#: report:report.central_journal_report:144
26#: report:report.central_journal_report:170
27msgid "Progressives =>"
28msgstr "Progressivi =>"
29
30#. module: account_central_journal
31#: model:ir.model,name:account_central_journal.model_central_journal_report
32#: model:ir.model,name:account_central_journal.model_wizard_central_journal_report
33#: view:wizard.central.journal.report:0
34msgid "Printing parameters of the Center Journal"
35msgstr "Parametri di stampa del Giornale Centralizzato"
36
37#. module: account_central_journal
38#: field:wizard.central.journal.report,print_state:0
39msgid "State"
40msgstr "Stato"
41
42#. module: account_central_journal
43#: selection:wizard.central.journal.report,print_state:0
44msgid "Draft"
45msgstr "Bozza"
46
47#. module: account_central_journal
48#: report:report.central_journal_report:134
49msgid "Account move"
50msgstr "Movimento"
51
52#. module: account_central_journal
53#: report:report.central_journal_report:138
54msgid "Debit"
55msgstr "Dare"
56
57#. module: account_central_journal
58#: view:wizard.central.journal.report:0
59msgid "Print"
60msgstr "Stampa"
61
62#. module: account_central_journal
63#: field:account.fiscalyear,progressive_credit:0
64msgid "Progressive Credit"
65msgstr "Progressivo Avere"
66
67#. module: account_central_journal
68#: model:ir.module.module,description:account_central_journal.module_meta_information
69msgid ""
70"\n"
71"Managing the printing of the \"Central Journal\" "
72msgstr ""
73"\n"
74"Gestione della stampa del \"Giornale Centralizzato\""
75
76#. module: account_central_journal
77#: constraint:account.fiscalyear:0
78msgid "Error! You cannot define overlapping fiscal years"
79msgstr "Errore! Non è possibile definire una sovrapposizione degli anni fiscali."
80
81#. module: account_central_journal
82#: report:report.central_journal_report:133
83msgid "Ref"
84msgstr "Rif."
85
86#. module: account_central_journal
87#: field:account.fiscalyear,date_last_print:0
88msgid "Last printed date"
89msgstr "Data ultima stampa"
90
91#. module: account_central_journal
92#: selection:wizard.central.journal.report,print_state:0
93msgid "Printed"
94msgstr "Stampato"
95
96#. module: account_central_journal
97#: report:report.central_journal_report:136
98msgid "Account name"
99msgstr "Conto"
100
101#. module: account_central_journal
102#: report:report.central_journal_report:132
103msgid "Date"
104msgstr "Data"
105
106#. module: account_central_journal
107#: code:addons/account_central_journal/wizard/central_journal_report.py:51
108#: code:addons/account_central_journal/wizard/central_journal_report.py:54
109#, python-format
110msgid "Wrong dates !"
111msgstr "Date errate !"
112
113#. module: account_central_journal
114#: view:wizard.central.journal.report:0
115msgid "Dates movements"
116msgstr "Date dei movimenti"
117
118#. module: account_central_journal
119#: field:account.fiscalyear,progressive_debit:0
120msgid "Progressive Debit"
121msgstr "Progressivo Dare"
122
123#. module: account_central_journal
124#: report:report.central_journal_report:124
125#: field:wizard.central.journal.report,date_move_line_to:0
126msgid "to date"
127msgstr "alla data"
128
129#. module: account_central_journal
130#: report:report.central_journal_report:137
131msgid "Name"
132msgstr "Descrizione movimento"
133
134#. module: account_central_journal
135#: model:ir.module.module,shortdesc:account_central_journal.module_meta_information
136msgid "Account Central Journal"
137msgstr "Giornale Centralizzato"
138
139#. module: account_central_journal
140#: field:account.fiscalyear,progressive_line_number:0
141msgid "Progressive line"
142msgstr "Progressivo della riga"
143
144#. module: account_central_journal
145#: code:addons/account_central_journal/wizard/central_journal_report.py:54
146#, python-format
147msgid "The end date can not be greater than today's date."
148msgstr "La data finale non può essere maggiore della data odierna"
149
150#. module: account_central_journal
151#: report:report.central_journal_report:139
152msgid "Credit"
153msgstr "Avere"
154
155#. module: account_central_journal
156#: model:ir.model,name:account_central_journal.model_account_fiscalyear
157#: field:wizard.central.journal.report,fiscalyear:0
158msgid "Fiscal Year"
159msgstr "Anno Fiscale"
160
161#. module: account_central_journal
162#: constraint:account.fiscalyear:0
163msgid "Error! The duration of the Fiscal Year is invalid. "
164msgstr "Errore! La durata dell'anno fiscale non è valida."
165
166#. module: account_central_journal
167#: code:addons/account_central_journal/wizard/central_journal_report.py:51
168#, python-format
169msgid "The end date must be greater than the initial date."
170msgstr "La data finale deve essere maggiore della data iniziale"
171
172#. module: account_central_journal
173#: view:wizard.central.journal.report:0
174msgid "Reference"
175msgstr "Riferimento"
176
177#. module: account_central_journal
178#: model:ir.actions.report.xml,name:account_central_journal.central_journal_report_id
179msgid "central_journal"
180msgstr "Giornale Centralizzato Report Webkit"
181
182#. module: account_central_journal
183#: field:account.fiscalyear,progressive_page_number:0
184msgid "Progressive of the page"
185msgstr "Progressivo della pagina"
186
187#. module: account_central_journal
188#: report:report.central_journal_report:124
189msgid "TEST PRINTING"
190msgstr "STAMPA DI PROVA"
191
192#. module: account_central_journal
193#: view:account.fiscalyear:0
194msgid "Central journal info"
195msgstr "Informazione del Giornale Centralizzato"
196
197#. module: account_central_journal
198#: report:report.central_journal_report:127
199msgid "Page:"
200msgstr "Pagina:"
201
202#. module: account_central_journal
203#: report:report.central_journal_report:124
204#: field:wizard.central.journal.report,date_move_line_from:0
205#: field:wizard.central.journal.report,date_move_line_from_view:0
206msgid "From date"
207msgstr "Dalla data"
208
209#. module: account_central_journal
210#: selection:wizard.central.journal.report,print_state:0
211msgid "Ready for printing"
212msgstr "Pronto per la stampa"
213
214#. module: account_central_journal
215#: view:wizard.central.journal.report:0
216msgid "Cancel"
217msgstr "Annulla"
218
219#. module: account_central_journal
220#: report:report.central_journal_report:131
221msgid "Row"
222msgstr "N.riga"
223
224#. module: account_central_journal
225#: view:wizard.central.journal.report:0
226msgid "Final print"
227msgstr "Stampa definitiva"
228
229#. module: account_central_journal
230#: report:report.central_journal_report:116
231msgid "ACCOUNT JOURNAL"
232msgstr "Giornale di Contabilità"
233
0234
=== added directory 'account_central_journal/report'
=== added file 'account_central_journal/report/__init__.py'
--- account_central_journal/report/__init__.py 1970-01-01 00:00:00 +0000
+++ account_central_journal/report/__init__.py 2014-03-06 15:06:22 +0000
@@ -0,0 +1,22 @@
1# -*- coding: utf-8 -*-
2##############################################################################
3#
4# OpenERP, Open Source Management Solution
5# Copyright (C) 2012 ISA s.r.l. (<http://www.isa.it>).
6#
7# This program is free software: you can redistribute it and/or modify
8# it under the terms of the GNU Affero General Public License as
9# published by the Free Software Foundation, either version 3 of the
10# License, or (at your option) any later version.
11#
12# This program is distributed in the hope that it will be useful,
13# but WITHOUT ANY WARRANTY; without even the implied warranty of
14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15# GNU Affero General Public License for more details.
16#
17# You should have received a copy of the GNU Affero General Public License
18# along with this program. If not, see <http://www.gnu.org/licenses/>.
19#
20##############################################################################
21
22import central_journal_report
023
=== added file 'account_central_journal/report/central_journal_report.mako'
--- account_central_journal/report/central_journal_report.mako 1970-01-01 00:00:00 +0000
+++ account_central_journal/report/central_journal_report.mako 2014-03-06 15:06:22 +0000
@@ -0,0 +1,190 @@
1<html>
2<head>
3 <meta content="text/html; charset=UTF-8" http-equiv="content-type"/>
4 <style type="text/css">
5 ${css}
6
7 .page_block {
8 page-break-after: always;
9 width: 100%;
10 }
11 .page_table {
12 width: 100%;
13 }
14 .p_row {
15 page-break-inside: avoid;
16 vertical-align:text-top;
17 height: 21px;
18 }
19 .p_cell {
20 overflow: hidden;
21 padding: 1px 5px;
22 }
23 .p_text {
24 color: black;
25 font-size: 9px;
26 font-family: "Courier New", Courier, monospace;
27 }
28 .p_cell_debit, .p_cell_credit {
29 text-align: right;
30 }
31
32 .p_row_head {
33 border: 1px solid black;
34 border-width: 1px 0px;
35 }
36 .p_cell_head {
37 font-weight: bold;
38 padding: 3px 5px;
39 }
40
41 .p_row_page {
42 font-weight: bold;
43 }
44 .p_cell_test {
45 padding: 5px 5px;
46 }
47 .p_cell_page {
48 padding: 5px 5px;
49 text-align: right;
50 }
51
52 .p_row_total {
53 font-weight: bold;
54 border: 1px solid gray;
55 }
56 .p_row_total_up {
57 border-width: 0px 0px 1px 0px;
58 }
59 .p_row_total_down {
60 border-width: 1px 0px 0px 0px;
61 }
62 .p_cell_progressive {
63 padding: 3px 5px;
64 text-align: right;
65 }
66
67 /* COLUMNS WIDTH
68 .p_cell_progr_row { width: 15px;}
69 .p_cell_date { width: 45px;}
70 .p_cell_ref { width: 70px;}
71 .p_cell_move_id_name { width: 70px;}
72 .p_cell_account_id_code { width: 50px;}
73 .p_cell_account_id_name { width: 200px;}
74 .p_cell_name { width: 250px;}
75 .p_cell_debit { width: 70px;}
76 .p_cell_credit { width: 70px;}
77 */
78 </style>
79</head>
80
81<body>
82 <%
83 flag_print_final = data["print_final"]
84 fiscalyear_id = data["form"]["fiscalyear"]
85 date_from = data["form"]["date_move_line_from"]
86 date_to = data["form"]["date_move_line_to"]
87 %>
88 <%
89 print_info = get_print_info(fiscalyear_id)
90 result_wizard = set_wizard_params(data["form"])
91 result_rows = get_movements()
92 %>
93 <%
94 page_rows = 25
95
96 num_rows = len(result_rows)
97 num_row = 0
98 new_page = True
99
100 progr_page = print_info['start_page']
101 progr_row = print_info['start_row']
102 %>
103 <%
104 debit_tot = print_info['start_debit']
105 credit_tot = print_info['start_credit']
106 %>
107 <% result_rows and result_rows[0] and result_rows[0].company_id and result_rows[0].company_id.partner_id and result_rows[0].company_id and result_rows[0].company_id.partner_id.lang and setLang(result_rows[0].company_id and result_rows[0].company_id.partner_id.lang) %>
108
109 %for line in result_rows :
110 <% num_row = num_row + 1 %>
111 <% progr_row = progr_row + 1 %>
112 % if new_page == True:
113 <%
114 new_page = False
115 progr_page = progr_page + 1
116 %>
117 <div class="page_block">
118 <table class="header" style="border-bottom: 0px solid black; width: 100%">
119 <tr>
120 <td style="text-align:center;"><span style="font-weight: bold; font-size: 14px;">${_("ACCOUNT JOURNAL")}</span></td>
121 </tr>
122 </table>
123
124 <table class="page_table">
125 <tr class="p_row p_row_page">
126 <td colspan="7" class="p_cell p_cell_test">
127 % if flag_print_final == False:
128 <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>
129 % endif
130 </td>
131 <td colspan="2" class="p_cell p_cell_page"><span class="p_text p_page">${ _("Page:") }&nbsp;&nbsp;${progr_page} / ${print_info['year_name']}</span></td>
132 </tr>
133
134 <tr class="p_row p_row_head">
135 <td class="p_cell p_cell_head"><span class="p_text">${ _("Row") }</span></td>
136 <td class="p_cell p_cell_head"><span class="p_text">${ _("Date") }</span></td>
137 <td class="p_cell p_cell_head"><span class="p_text">${ _("Ref") }</span></td>
138 <td class="p_cell p_cell_head"><span class="p_text">${ _("Account move") }</span></td>
139 <td class="p_cell p_cell_head"><span class="p_text">${ _("Account code") }</span></td>
140 <td class="p_cell p_cell_head"><span class="p_text">${ _("Account name") }</span></td>
141 <td class="p_cell p_cell_head"><span class="p_text">${ _("Name") }</span></td>
142 <td class="p_cell p_cell_head p_cell_debit"><span class="p_text">${ _("Debit") }</span></td>
143 <td class="p_cell p_cell_head p_cell_credit"><span class="p_text">${ _("Credit") }</span></td>
144 </tr>
145
146 <tr class="p_row p_row_total p_row_total_up">
147 <td colspan="6"></td>
148 <td class="p_cell p_cell_progressive"><span class="p_text">${ _("Progressives =>") }</span></td>
149 <td class="p_cell p_cell_debit"><span class="p_text p_debit">${ formatLang(debit_tot, digits=get_digits(dp='Account')) |entity }</span></td>
150 <td class="p_cell p_cell_credit"><span class="p_text p_credit">${ formatLang(credit_tot, digits=get_digits(dp='Account')) |entity }</span></td>
151 </tr>
152 % endif
153 <tr class="p_row">
154 <td class="p_cell p_cell_progr_row"><span class="p_text p_progr_row">${progr_row}</span></td>
155 <td class="p_cell p_cell_date"><span class="p_text p_date">${ formatLang(line.date, date=True) or ''|entity }</span></td>
156 <td class="p_cell p_cell_ref"><span class="p_text p_ref">${ line.ref or ''|entity }</span></td>
157 <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>
158 <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>
159 <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>
160 <td class="p_cell p_cell_name"><span class="p_text p_name">${ line.name or ''|entity }</span></td>
161 <td class="p_cell p_cell_debit"><span class="p_text p_debit">${ formatLang(line.debit, digits=get_digits(dp='Account')) |entity }</span></td>
162 <td class="p_cell p_cell_credit"><span class="p_text p_credit">${ formatLang(line.credit, digits=get_digits(dp='Account')) |entity }</span></td>
163 </tr>
164 <%
165 debit_tot = debit_tot + line.debit
166 credit_tot = credit_tot + line.credit
167 %>
168 % if (num_row % page_rows) == 0 or num_row == num_rows :
169 <%
170 new_page = True
171 %>
172 <tr class="p_row p_row_total p_row_total_down">
173 <td colspan="6"></td>
174 <td class="p_cell p_cell_progressive"><span class="p_text">${ _("Progressives =>") }</span></td>
175 <td class="p_cell p_cell_debit"><span class="p_text p_debit">${ formatLang(debit_tot, digits=get_digits(dp='Account')) |entity }</span></td>
176 <td class="p_cell p_cell_credit"><span class="p_text p_credit">${ formatLang(credit_tot, digits=get_digits(dp='Account')) |entity }</span></td>
177 </tr>
178 </table>
179 </div>
180 % endif
181 %endfor
182
183 <%
184 if flag_print_final == True:
185 print_info = set_print_info(fiscalyear_id, date_to, progr_row, progr_page, debit_tot, credit_tot)
186 %>
187
188</body>
189</html>
190
0191
=== added file 'account_central_journal/report/central_journal_report.py'
--- account_central_journal/report/central_journal_report.py 1970-01-01 00:00:00 +0000
+++ account_central_journal/report/central_journal_report.py 2014-03-06 15:06:22 +0000
@@ -0,0 +1,89 @@
1# -*- coding: utf-8 -*-
2##############################################################################
3#
4# OpenERP, Open Source Management Solution
5# Copyright (C) 2012 ISA s.r.l. (<http://www.isa.it>).
6#
7# This program is free software: you can redistribute it and/or modify
8# it under the terms of the GNU Affero General Public License as
9# published by the Free Software Foundation, either version 3 of the
10# License, or (at your option) any later version.
11#
12# This program is distributed in the hope that it will be useful,
13# but WITHOUT ANY WARRANTY; without even the implied warranty of
14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15# GNU Affero General Public License for more details.
16#
17# You should have received a copy of the GNU Affero General Public License
18# along with this program. If not, see <http://www.gnu.org/licenses/>.
19#
20##############################################################################
21
22import time
23from report import report_sxw
24from osv import osv
25from tools.translate import _
26
27class central_journal_report(report_sxw.rml_parse):
28
29 def _set_wizard_params(self,form_values):
30 if form_values['date_move_line_from'] :
31 date_move_line_from=form_values['date_move_line_from']
32 filter=("date",">=",date_move_line_from)
33 self.filters.append(filter)
34 if form_values['date_move_line_to'] :
35 date_move_line_to=form_values['date_move_line_to']
36 filter=("date","<=",date_move_line_to)
37 self.filters.append(filter)
38 return True
39
40 def _get_print_info(self, fiscalyear_id):
41 fiscalyear_obj = self.pool.get('account.fiscalyear')
42 fiscalyear_ids=fiscalyear_obj.search(self.cr,self.uid,[('id','=',fiscalyear_id),])
43 fiscalyear_data=fiscalyear_obj.browse(self.cr,self.uid,fiscalyear_ids)[0]
44 print_info = {
45 'start_row': fiscalyear_data.progressive_line_number,
46 'start_page': fiscalyear_data.progressive_page_number,
47 'start_debit': fiscalyear_data.progressive_debit,
48 'start_credit': fiscalyear_data.progressive_credit,
49 'year_name': fiscalyear_data.name,
50 }
51 return print_info
52
53 def _set_print_info(self, fiscalyear_id, end_date_print, end_row, end_page, end_debit, end_credit):
54 fiscalyear_obj = self.pool.get('account.fiscalyear')
55 fiscalyear_ids=fiscalyear_obj.search(self.cr,self.uid,[('id','=',fiscalyear_id),])
56 fiscalyear_data=fiscalyear_obj.browse(self.cr,self.uid,fiscalyear_ids)[0]
57 print_info = {
58 'date_last_print': end_date_print,
59 'progressive_line_number': end_row,
60 'progressive_page_number': end_page,
61 'progressive_debit': end_debit,
62 'progressive_credit': end_credit,
63 }
64 res = fiscalyear_obj.write(self.cr, self.uid, fiscalyear_ids, print_info)
65 return res
66
67 def _get_movements(self):
68 move_line_obj = self.pool.get('account.move.line')
69 line_ids=move_line_obj.search(self.cr,self.uid,self.filters,order="date, move_id asc")
70 report_lines=move_line_obj.browse(self.cr,self.uid,line_ids)
71 return report_lines
72
73 def __init__(self, cr, uid, name, context):
74 self.filters=[]
75 super(central_journal_report, self).__init__(cr, uid, name, context)
76 self.localcontext.update({
77 'time': time,
78 'cr':cr,
79 'uid': uid,
80 'get_print_info': self._get_print_info,
81 'set_print_info': self._set_print_info,
82 'set_wizard_params': self._set_wizard_params,
83 'get_movements': self._get_movements,
84 })
85
86report_sxw.report_sxw('report.central_journal_report',
87 'account.move.line',
88 'addons/account_central_journal/report/central_journal_report.mako',
89 parser=central_journal_report)
090
=== added file 'account_central_journal/report/report.xml'
--- account_central_journal/report/report.xml 1970-01-01 00:00:00 +0000
+++ account_central_journal/report/report.xml 2014-03-06 15:06:22 +0000
@@ -0,0 +1,15 @@
1<?xml version="1.0"?>
2<openerp>
3 <data>
4 <record id="central_journal_report_id" model="ir.actions.report.xml">
5 <field name="name">central_journal</field>
6 <field name="type">ir.actions.report.xml</field>
7 <field name="model">account.move.line</field>
8 <field name="report_name">central_journal_report</field>
9 <field name="report_rml">account_central_journal/report/central_journal_report.mako</field>
10 <field name="report_type">webkit</field>
11 <field name="webkit_header" ref="ir_header_central_journal_report"/>
12 </record>
13 </data>
14</openerp>
15
016
=== added file 'account_central_journal/report/webkit_model.xml'
--- account_central_journal/report/webkit_model.xml 1970-01-01 00:00:00 +0000
+++ account_central_journal/report/webkit_model.xml 2014-03-06 15:06:22 +0000
@@ -0,0 +1,107 @@
1<?xml version="1.0" ?>
2<openerp>
3 <data noupdate="1">
4 <record id="ir_header_central_journal_report" model="ir.header_webkit">
5 <field name="footer_html"></field>
6 <field eval="&quot;&quot;&quot;Landscape&quot;&quot;&quot;" name="orientation"/>
7 <field eval="&quot;&quot;&quot;A4&quot;&quot;&quot;" name="format"/>
8 <field name="html"><![CDATA[<html>
9 <head>
10 <meta content="text/html; charset=UTF-8" http-equiv="content-type"/>
11 <script>
12 function subst() {
13 var vars={};
14 var x=document.location.search.substring(1).split('&');
15 for(var i in x) {var z=x[i].split('=',2);vars[z[0]] = unescape(z[1]);}
16 var x=['frompage','topage','page','webpage','section','subsection','subsubsection'];
17 for(var i in x) {
18 var y = document.getElementsByClassName(x[i]);
19 for(var j=0; j<y.length; ++j) y[j].textContent = vars[x[i]];
20 }
21 }
22 </script>
23 <style type="text/css">
24 ${css}
25 </style>
26 </head>
27 <body style="border:0; margin:0;" onload="subst()">
28 <table class="header" style="border-bottom: 0px solid black; width: 100%">
29 <tr>
30 <td style="text-align:left; padding: 5px 0px;">
31 <span style="font-weight: bold;">
32 ${company.partner_id.name |entity}&nbsp; - &nbsp;P.IVA:&nbsp;
33 ${company.partner_id.vat or '' |entity}&nbsp; <br/>
34 ${company.partner_id.street or '' |entity}&nbsp;
35 ${company.partner_id.street2 or '' |entity}&nbsp;
36 ${company.partner_id.zip or '' |entity}&nbsp;
37 ${company.partner_id.city or '' |entity}&nbsp;</span>
38 </td>
39 </tr>
40 </table> ${_debug or ''|n}
41 </body>
42</html>]]>
43</field>
44 <field eval="20.0" name="margin_top"/>
45 <field eval="15.0" name="margin_bottom"/>
46 <field eval="15.0" name="margin_left"/>
47 <field eval="15.0" name="margin_right"/>
48 <field name="css" ><![CDATA[
49 /* http://meyerweb.com/eric/tools/css/reset/
50 v2.0 | 20110126
51 License: none (public domain)
52 */
53 /* START OF RESET CSS */
54 html, body, div, span, applet, object, iframe,
55 h1, h2, h3, h4, h5, h6, p, blockquote, pre,
56 a, abbr, acronym, address, big, cite, code,
57 del, dfn, em, img, ins, kbd, q, s, samp,
58 small, strike, strong, sub, sup, tt, var,
59 b, u, i, center,
60 dl, dt, dd, ol, ul, li,
61 fieldset, form, label, legend,
62 table, caption, tbody, tfoot, thead, tr, th, td,
63 article, aside, canvas, details, embed,
64 figure, figcaption, footer, header, hgroup,
65 menu, nav, output, ruby, section, summary,
66 time, mark, audio, video {
67 margin: 0;
68 padding: 0;
69 border: 0;
70 font-size: 100%;
71 font: inherit;
72 vertical-align: baseline;
73 }
74 /* HTML5 display-role reset for older browsers */
75 article, aside, details, figcaption, figure,
76 footer, header, hgroup, menu, nav, section {
77 display: block;
78 }
79 body {
80 line-height: 1;
81 }
82 ol, ul {
83 list-style: none;
84 }
85 blockquote, q {
86 quotes: none;
87 }
88 blockquote:before, blockquote:after,
89 q:before, q:after {
90 content: '';
91 content: none;
92 }
93 table {
94 border-collapse: collapse;
95 border-spacing: 0;
96 }
97 /* END OF RESET CSS */
98
99 body {
100 font-family: font-family: Verdana, Arial, Helvetica, sans-serif;
101 font-size: 12px;
102 }
103]]> </field>
104 <field eval="&quot;&quot;&quot;Central Journal Report&quot;&quot;&quot;" name="name"/>
105 </record>
106 </data>
107</openerp>
0108
=== added directory 'account_central_journal/wizard'
=== added file 'account_central_journal/wizard/__init__.py'
--- account_central_journal/wizard/__init__.py 1970-01-01 00:00:00 +0000
+++ account_central_journal/wizard/__init__.py 2014-03-06 15:06:22 +0000
@@ -0,0 +1,22 @@
1# -*- coding: utf-8 -*-
2##############################################################################
3#
4# OpenERP, Open Source Management Solution
5# Copyright (C) 2012 ISA s.r.l. (<http://www.isa.it>).
6#
7# This program is free software: you can redistribute it and/or modify
8# it under the terms of the GNU Affero General Public License as
9# published by the Free Software Foundation, either version 3 of the
10# License, or (at your option) any later version.
11#
12# This program is distributed in the hope that it will be useful,
13# but WITHOUT ANY WARRANTY; without even the implied warranty of
14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15# GNU Affero General Public License for more details.
16#
17# You should have received a copy of the GNU Affero General Public License
18# along with this program. If not, see <http://www.gnu.org/licenses/>.
19#
20##############################################################################
21
22import central_journal_report
023
=== added file 'account_central_journal/wizard/central_journal_report.py'
--- account_central_journal/wizard/central_journal_report.py 1970-01-01 00:00:00 +0000
+++ account_central_journal/wizard/central_journal_report.py 2014-03-06 15:06:22 +0000
@@ -0,0 +1,135 @@
1# -*- coding: utf-8 -*-
2##############################################################################
3#
4# OpenERP, Open Source Management Solution
5# Copyright (C) 2012 ISA s.r.l. (<http://www.isa.it>).
6#
7# This program is free software: you can redistribute it and/or modify
8# it under the terms of the GNU Affero General Public License as
9# published by the Free Software Foundation, either version 3 of the
10# License, or (at your option) any later version.
11#
12# This program is distributed in the hope that it will be useful,
13# but WITHOUT ANY WARRANTY; without even the implied warranty of
14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15# GNU Affero General Public License for more details.
16#
17# You should have received a copy of the GNU Affero General Public License
18# along with this program. If not, see <http://www.gnu.org/licenses/>.
19#
20##############################################################################
21
22import time
23from datetime import datetime, date, timedelta
24from osv import osv, fields
25from tools.translate import _
26
27class central_journal_report(osv.osv_memory):
28
29 _name = 'wizard.central.journal.report'
30 _description = 'Printing parameters of the Center Journal'
31
32 def _get_fiscal_years(self, cr, uid, context=None):
33 fiscalyear_obj = self.pool.get('account.fiscalyear')
34 fiscalyear_ids = fiscalyear_obj.search(cr, uid, [], order="id desc")
35 fiscalyears = []
36 for account_fiscalyear in fiscalyear_obj.browse(cr,uid,fiscalyear_ids) :
37 fiscalyears.append((account_fiscalyear.id, account_fiscalyear.name))
38 return fiscalyears
39
40 def _get_account_fiscalyear_data(self, cr, uid, ids, fiscalyear_id):
41 fiscalyear_obj = self.pool.get('account.fiscalyear')
42 fiscalyear_ids=fiscalyear_obj.search(cr,uid,[('id','=',fiscalyear_id),])
43 fiscalyear_data=fiscalyear_obj.browse(cr,uid,fiscalyear_ids)[0]
44 return fiscalyear_data
45
46 def _dates_control(self, str_date_start, str_date_end):
47 today_date = date.today()
48 date_start = datetime.strptime(str_date_start,"%Y-%m-%d").date()
49 date_stop = datetime.strptime(str_date_end,"%Y-%m-%d").date()
50 if date_start > date_stop:
51 raise osv.except_osv(_('Wrong dates !'), _("The end date must be greater than the initial date."))
52 return False
53 if date_stop > today_date:
54 raise osv.except_osv(_('Wrong dates !'), _("The end date can not be greater than today's date."))
55 return False
56 return True
57
58 def _get_report_datas(self, cr, uid, ids, context={}):
59 wizard_form_datas = self.read(cr, uid, ids)[0]
60 datas = {
61 'ids': [],
62 'model': 'account.move.line',
63 'form': wizard_form_datas,
64 }
65 return datas
66
67 _columns = {
68 'date_move_line_from': fields.date('From date', required=True,),
69 'date_move_line_from_view': fields.date('From date'),
70 'date_move_line_to': fields.date('to date', required=True),
71 'fiscalyear': fields.selection(_get_fiscal_years, 'Fiscal Year', required=True),
72 'print_state': fields.selection([('draft','Draft'),('print','Ready for printing'),('printed','Printed')],'State',readonly=True),
73 }
74
75 def onchange_fiscalyear(self, cr, uid, ids, fiscalyear_id=False, context=None):
76 print_state = 'draft'
77 date_move_line_from = date_move_line_from_view = False
78 date_move_line_to = False
79 if fiscalyear_id:
80 print_state = 'print'
81 fiscalyear_data = self._get_account_fiscalyear_data(cr, uid, ids, fiscalyear_id)
82 #set values
83 today_date = date.today()
84 date_start = datetime.strptime(fiscalyear_data.date_start,"%Y-%m-%d").date()
85 date_stop = datetime.strptime(fiscalyear_data.date_stop,"%Y-%m-%d").date()
86 #set date_move_line_from
87 if fiscalyear_data.date_last_print:
88 date_last_print = datetime.strptime(fiscalyear_data.date_last_print,"%Y-%m-%d").date()
89 date_move_line_from = date_move_line_from_view = (date_last_print+timedelta(days=1)).__str__()
90 if date_last_print == date_stop:
91 date_move_line_from = date_move_line_from_view = date_start.__str__()
92 print_state = 'printed'
93 else:
94 date_move_line_from = date_move_line_from_view = date_start.__str__()
95 #set date_move_line_to
96 if today_date > date_stop:
97 date_move_line_to = date_stop.__str__()
98 else:
99 date_move_line_to = (today_date-timedelta(days=1)).__str__()
100
101 return {'value': {
102 'date_move_line_from': date_move_line_from,
103 'date_move_line_from_view': date_move_line_from_view,
104 'date_move_line_to': date_move_line_to,
105 'print_state': print_state,
106 }
107 }
108
109 def print_report(self, cr, uid, ids, context={}):
110 datas = self._get_report_datas(cr, uid, ids, context)
111 if self._dates_control(datas['form']['date_move_line_from'],datas['form']['date_move_line_to']) == False:
112 return False
113 datas['print_final'] = False
114 return {
115 'type': 'ir.actions.report.xml',
116 'report_name': 'central_journal_report',
117 'datas': datas,
118 }
119
120 def print_report_final(self, cr, uid, ids, context={}):
121 datas = self._get_report_datas(cr, uid, ids, context)
122 if self._dates_control(datas['form']['date_move_line_from'],datas['form']['date_move_line_to']) == False:
123 return False
124 datas['print_final'] = True
125 return {
126 'type': 'ir.actions.report.xml',
127 'report_name': 'central_journal_report',
128 'datas': datas,
129 }
130
131 _defaults = {
132 'print_state': 'draft',
133 }
134
135central_journal_report()
0136
=== added file 'account_central_journal/wizard/central_journal_report.xml'
--- account_central_journal/wizard/central_journal_report.xml 1970-01-01 00:00:00 +0000
+++ account_central_journal/wizard/central_journal_report.xml 2014-03-06 15:06:22 +0000
@@ -0,0 +1,59 @@
1<?xml version="1.0" encoding="utf-8"?>
2<openerp>
3 <data>
4
5 <!--
6 Central Journal Report Filter View
7 -->
8
9 <record model="ir.ui.view" id="central_journal_report_form_view">
10 <field name="name">wizard.central.journal.report.form</field>
11 <field name="model">wizard.central.journal.report</field>
12 <field name="type">form</field>
13 <field name="arch" type="xml">
14 <form string="Printing parameters of the Center Journal">
15 <group colspan="4" col="4">
16 <separator colspan="4" string="Reference"/>
17 <field name="fiscalyear" on_change="onchange_fiscalyear(fiscalyear)"/>
18 <separator colspan="4" string="Dates movements"/>
19 <field name="date_move_line_from" invisible="1"/>
20 <field name="date_move_line_from_view" readonly="1"/>
21 <field name="date_move_line_to" attrs="{'readonly':[('print_state','!=','print')]}"/>
22 </group>
23 <newline/>
24 <separator colspan="4"/>
25 <group colspan="4" col="6">
26 <field name="print_state"/>
27 <button special="cancel" string="Cancel" icon='gtk-cancel'/>
28 <button name="print_report" string="Print" type="object" icon="gtk-print" attrs="{'invisible':[('print_state','=','printed')]}"/>
29 <button name="print_report_final" string="Final print" type="object" icon="gtk-print" attrs="{'invisible':[('print_state','=','printed')]}"/>
30 </group>
31 </form>
32 </field>
33 </record>
34
35 <!--action -->
36 <record model="ir.actions.act_window" id="central_journal_report_action">
37 <field name="name">Print Central Journal</field>
38 <field name="type">ir.actions.act_window</field>
39 <field name="res_model">wizard.central.journal.report</field>
40 <field name="view_type">form</field>
41 <field name="view_mode">form</field>
42 <field name="target">new</field>
43 </record>
44
45 <!--this feature works only in this file. Don't move-->
46 <record model="ir.values" id="central_journal_report_webkit">
47 <field name="model_id" ref="account.model_account_move_line" />
48 <field name="object" eval="1" />
49 <field name="name">central_journal</field>
50 <field name="key2">client_print_multi</field>
51 <field name="value" eval="'ir.actions.act_window,' + str(ref('central_journal_report_action'))" />
52 <field name="key">action</field>
53 <field name="model">account.move.line</field>
54 </record>
55
56 <menuitem id="menu_central_journal_report_action" parent="account.menu_finance_legal_statement" action="central_journal_report_action"/>
57
58 </data>
59</openerp>

Subscribers

People subscribed via source and target branches