Merge lp:~a-camilli/openobject-italia/7.0_add_abi_cab into lp:~openobject-italia-core-devs/openobject-italia/italian-addons-7.0
- 7.0_add_abi_cab
- Merge into italian-addons-7.0
Status: | Rejected |
---|---|
Rejected by: | Lorenzo Battistini |
Proposed branch: | lp:~a-camilli/openobject-italia/7.0_add_abi_cab |
Merge into: | lp:~openobject-italia-core-devs/openobject-italia/italian-addons-7.0 |
Diff against target: |
509 lines (+443/-0) 11 files modified
l10n_it_abicab/AUTHORS.txt (+2/-0) l10n_it_abicab/__init__.py (+25/-0) l10n_it_abicab/__openerp__.py (+38/-0) l10n_it_abicab/abicab.py (+46/-0) l10n_it_abicab/abicab_view.xml (+61/-0) l10n_it_abicab/bank/__init__.py (+20/-0) l10n_it_abicab/bank/bank.py (+98/-0) l10n_it_abicab/i18n/it.po (+37/-0) l10n_it_abicab/wizard/__init__.py (+22/-0) l10n_it_abicab/wizard/import_italian_bank.py (+57/-0) l10n_it_abicab/wizard/import_italian_bank_view.xml (+37/-0) |
To merge this branch: | bzr merge lp:~a-camilli/openobject-italia/7.0_add_abi_cab |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Lorenzo Battistini | Needs Resubmitting | ||
Review via email: mp+170086@code.launchpad.net |
Commit message
Description of the change
Adeguamento del modulo abi e cab alla versione 7.0.
Aggiunta un'utility per importare le banche nazionali dal file TXT che si può scaricare sia dai siti che dai programmi di homebanking.
L'utility l'ho messa nel menu di contabilità-
Alessandro Camilli (a-camilli) wrote : | # |
> Ciao Alessandro.
>
> Dove è documentata la struttura del file TXT da importare?
Ho ripreso la struttura da un vecchio sorgente che avevo fatto. La struttura l'ho provata sul file che puoi scaricare sia da BNL che da UNICREDIT (e altre banche prese a campione come la CARIFERMO). Per questo do per scontato se si scarica l'elenco delle banche italiane in formato testo da un sito bancario il formato è sempre lo stesso.
>
> Qual è il tipico caso d'uso in cui questa nuova funzionalità verrebbe usata?
Ora quando si vuole inserire una banca nel partner, se non esiste occorre crearla (ragione sociale, localita, abi, cab ecc..). Visto che l'archivio delle banche viene fornito da tutti gli istituti è molto comodo averle già codificate e limitarsi a sceglierla per assegnarla al partner.
Nella pratica capita spesso che l'utente che si trova a codificare una nuova banca deve cercare i dati su internet o nel software della banca, e inserirli in openERP con copia/incolla.
La funzione può essere eseguita in ogni momento(previo download del file aggiornato), ogni volta che si vuole aggiungere nuove banche all'archivio. Il classico caso riguarda le fusioni bancarie dove all'archivio dovrebbero essere aggiunte le filiali con i nuovi ABI e CAB.
>
> Come mai 'wizard.
> due model distinti?
Ho usato il concetto del MVC, ma non so se sia corretto.
Ho creato un modello a parte come "contenitore" di tutte le possibili funzioni di import dei flussi bancari (avevo anche in mente di metterci gli insoluti riba).
La funzione "import_
Pensi sia meglio mettere tutto nel wizard?
>
> Grazie
Grazie a te!
Lorenzo Battistini (elbati) wrote : | # |
Ciao Alessandro,
ti chiederei di splittare in due questa merge proposal:
- una MP per aggiungere il modulo portato alla 7
- una MP per aggiungere la funzionalità di cui stavamo discutendo
Così da una parte possiamo pubblicare il modulo sulla 7 grazie al tuo lavoro, dall'altra andiamo avanti col discorso sulla nuova funzionalità
Alessandro Camilli (a-camilli) wrote : | # |
Ho fatto lo split x abi e cab su lp:~a-camilli/openobject-italia/7.0_abi_cab
Unmerged revisions
- 211. By Alessandro Camilli
-
Gestione abi e cab + utility per import banche da file txt
- 210. By Alessandro Camilli
Preview Diff
1 | === added directory 'l10n_it_abicab' | |||
2 | === added file 'l10n_it_abicab/AUTHORS.txt' | |||
3 | --- l10n_it_abicab/AUTHORS.txt 1970-01-01 00:00:00 +0000 | |||
4 | +++ l10n_it_abicab/AUTHORS.txt 2013-06-18 14:14:40 +0000 | |||
5 | @@ -0,0 +1,2 @@ | |||
6 | 1 | Franco Tampieri <franco.tampieri@agilebg.com> | ||
7 | 2 | Alessandro Camilli <a.camilli@yahoo.it> | ||
8 | 0 | 3 | ||
9 | === added file 'l10n_it_abicab/__init__.py' | |||
10 | --- l10n_it_abicab/__init__.py 1970-01-01 00:00:00 +0000 | |||
11 | +++ l10n_it_abicab/__init__.py 2013-06-18 14:14:40 +0000 | |||
12 | @@ -0,0 +1,25 @@ | |||
13 | 1 | # -*- encoding: utf-8 -*- | ||
14 | 2 | ############################################################################## | ||
15 | 3 | # | ||
16 | 4 | # OpenERP, Open Source Management Solution | ||
17 | 5 | # Copyright (C) 2012 | ||
18 | 6 | # Associazione OpenERP Italia (<http://www.openerp-italia.org>) | ||
19 | 7 | # | ||
20 | 8 | # This program is free software: you can redistribute it and/or modify | ||
21 | 9 | # it under the terms of the GNU Affero General Public License as | ||
22 | 10 | # published by the Free Software Foundation, either version 3 of the | ||
23 | 11 | # License, or (at your option) any later version. | ||
24 | 12 | # | ||
25 | 13 | # This program is distributed in the hope that it will be useful, | ||
26 | 14 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
27 | 15 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
28 | 16 | # GNU Affero General Public License for more details. | ||
29 | 17 | # | ||
30 | 18 | # You should have received a copy of the GNU Affero General Public License | ||
31 | 19 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
32 | 20 | # | ||
33 | 21 | ############################################################################# | ||
34 | 22 | |||
35 | 23 | import abicab | ||
36 | 24 | import bank | ||
37 | 25 | import wizard | ||
38 | 0 | \ No newline at end of file | 26 | \ No newline at end of file |
39 | 1 | 27 | ||
40 | === added file 'l10n_it_abicab/__openerp__.py' | |||
41 | --- l10n_it_abicab/__openerp__.py 1970-01-01 00:00:00 +0000 | |||
42 | +++ l10n_it_abicab/__openerp__.py 2013-06-18 14:14:40 +0000 | |||
43 | @@ -0,0 +1,38 @@ | |||
44 | 1 | # -*- encoding: utf-8 -*- | ||
45 | 2 | ############################################################################## | ||
46 | 3 | # | ||
47 | 4 | # OpenERP, Open Source Management Solution | ||
48 | 5 | # Copyright (C) 2012 | ||
49 | 6 | # Associazione OpenERP Italia (<http://www.openerp-italia.org>) | ||
50 | 7 | # | ||
51 | 8 | # This program is free software: you can redistribute it and/or modify | ||
52 | 9 | # it under the terms of the GNU Affero General Public License as | ||
53 | 10 | # published by the Free Software Foundation, either version 3 of the | ||
54 | 11 | # License, or (at your option) any later version. | ||
55 | 12 | # | ||
56 | 13 | # This program is distributed in the hope that it will be useful, | ||
57 | 14 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
58 | 15 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
59 | 16 | # GNU Affero General Public License for more details. | ||
60 | 17 | # | ||
61 | 18 | # You should have received a copy of the GNU Affero General Public License | ||
62 | 19 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
63 | 20 | # | ||
64 | 21 | ############################################################################# | ||
65 | 22 | |||
66 | 23 | { | ||
67 | 24 | 'name': 'Italian Localisation - Base Bank ABI/CAB codes', | ||
68 | 25 | 'version': '1.0', | ||
69 | 26 | 'category': 'Localisation/Italy', | ||
70 | 27 | 'description': """ | ||
71 | 28 | Insert in the res.bank model the proprieties of the ABI/CAB | ||
72 | 29 | Utility to import italian bank from txt file | ||
73 | 30 | """, | ||
74 | 31 | 'author': 'OpenERP Italian Community', | ||
75 | 32 | 'depends': ['base'], | ||
76 | 33 | 'website': 'http://www.openerp-italia.org/', | ||
77 | 34 | 'update_xml': ['abicab_view.xml', 'wizard/import_italian_bank_view.xml'], | ||
78 | 35 | 'installable': True, | ||
79 | 36 | 'active': False, | ||
80 | 37 | 'certificate': '', | ||
81 | 38 | } | ||
82 | 0 | \ No newline at end of file | 39 | \ No newline at end of file |
83 | 1 | 40 | ||
84 | === added file 'l10n_it_abicab/abicab.py' | |||
85 | --- l10n_it_abicab/abicab.py 1970-01-01 00:00:00 +0000 | |||
86 | +++ l10n_it_abicab/abicab.py 2013-06-18 14:14:40 +0000 | |||
87 | @@ -0,0 +1,46 @@ | |||
88 | 1 | # -*- encoding: utf-8 -*- | ||
89 | 2 | ############################################################################## | ||
90 | 3 | # | ||
91 | 4 | # OpenERP, Open Source Management Solution | ||
92 | 5 | # Copyright (C) 2012 | ||
93 | 6 | # Associazione OpenERP Italia (<http://www.openerp-italia.org>) | ||
94 | 7 | # | ||
95 | 8 | # This program is free software: you can redistribute it and/or modify | ||
96 | 9 | # it under the terms of the GNU Affero General Public License as | ||
97 | 10 | # published by the Free Software Foundation, either version 3 of the | ||
98 | 11 | # License, or (at your option) any later version. | ||
99 | 12 | # | ||
100 | 13 | # This program is distributed in the hope that it will be useful, | ||
101 | 14 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
102 | 15 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
103 | 16 | # GNU Affero General Public License for more details. | ||
104 | 17 | # | ||
105 | 18 | # You should have received a copy of the GNU Affero General Public License | ||
106 | 19 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
107 | 20 | # | ||
108 | 21 | ############################################################################# | ||
109 | 22 | |||
110 | 23 | from osv import fields, osv | ||
111 | 24 | |||
112 | 25 | class res_bank(osv.osv): | ||
113 | 26 | _inherit = "res.bank" | ||
114 | 27 | _columns = { | ||
115 | 28 | 'abi': fields.char('ABI', size=5), | ||
116 | 29 | 'cab': fields.char('CAB', size=5), | ||
117 | 30 | } | ||
118 | 31 | |||
119 | 32 | class res_partner_bank(osv.osv): | ||
120 | 33 | _inherit = "res.partner.bank" | ||
121 | 34 | _columns = { | ||
122 | 35 | 'bank_abi': fields.char('ABI', size=5), | ||
123 | 36 | 'bank_cab': fields.char('CAB', size=5), | ||
124 | 37 | } | ||
125 | 38 | |||
126 | 39 | def onchange_bank_id(self, cr, uid, ids, bank_id, context=None): | ||
127 | 40 | result = super(res_partner_bank, self).onchange_bank_id(cr, uid, ids, bank_id, context=context) | ||
128 | 41 | if bank_id: | ||
129 | 42 | bank = self.pool.get('res.bank').browse(cr, uid, bank_id, context=context) | ||
130 | 43 | result['value']['bank_abi'] = bank.abi | ||
131 | 44 | result['value']['bank_cab'] = bank.cab | ||
132 | 45 | return result | ||
133 | 46 | |||
134 | 0 | 47 | ||
135 | === added file 'l10n_it_abicab/abicab_view.xml' | |||
136 | --- l10n_it_abicab/abicab_view.xml 1970-01-01 00:00:00 +0000 | |||
137 | +++ l10n_it_abicab/abicab_view.xml 2013-06-18 14:14:40 +0000 | |||
138 | @@ -0,0 +1,61 @@ | |||
139 | 1 | <?xml version="1.0" ?> | ||
140 | 2 | <openerp> | ||
141 | 3 | <data> | ||
142 | 4 | |||
143 | 5 | <record id="view_bank_tree_abicab" model="ir.ui.view"> | ||
144 | 6 | <field name="name">res.bank.tree.abicab</field> | ||
145 | 7 | <field name="model">res.bank</field> | ||
146 | 8 | <field name="inherit_id" ref="base.view_res_bank_tree"/> | ||
147 | 9 | <field name="arch" type="xml"> | ||
148 | 10 | <field name="name" position="after"> | ||
149 | 11 | <field name="abi"/> | ||
150 | 12 | <field name="cab"/> | ||
151 | 13 | </field> | ||
152 | 14 | </field> | ||
153 | 15 | </record> | ||
154 | 16 | |||
155 | 17 | <record id="view_bank_form_abicab" model="ir.ui.view"> | ||
156 | 18 | <field name="name">res.bank.form.abicab</field> | ||
157 | 19 | <field name="model">res.bank</field> | ||
158 | 20 | <field name="inherit_id" ref="base.view_res_bank_form"/> | ||
159 | 21 | <field name="arch" type="xml"> | ||
160 | 22 | <field name="name" position="after"> | ||
161 | 23 | <newline/> | ||
162 | 24 | <separator string="Bank Details" colspan="6"/> | ||
163 | 25 | <group colspan="6" col="6"> | ||
164 | 26 | <field name="abi"/> | ||
165 | 27 | <field name="cab"/> | ||
166 | 28 | </group> | ||
167 | 29 | </field> | ||
168 | 30 | </field> | ||
169 | 31 | </record> | ||
170 | 32 | |||
171 | 33 | <record id="view_partner_bank_form_abicab_form" model="ir.ui.view"> | ||
172 | 34 | <field name="name">res.partner.bank.form</field> | ||
173 | 35 | <field name="model">res.partner.bank</field> | ||
174 | 36 | <field name="inherit_id" ref="base.view_partner_bank_form"/> | ||
175 | 37 | <field name="arch" type="xml"> | ||
176 | 38 | |||
177 | 39 | <field name="bank_bic" position="after"> | ||
178 | 40 | <field name="bank_abi"/> | ||
179 | 41 | <field name="bank_cab"/> | ||
180 | 42 | </field> | ||
181 | 43 | |||
182 | 44 | </field> | ||
183 | 45 | </record> | ||
184 | 46 | |||
185 | 47 | <record id="view_partner_bank_form_abicab" model="ir.ui.view"> | ||
186 | 48 | <field name="name">res.partner.bank.form</field> | ||
187 | 49 | <field name="model">res.partner</field> | ||
188 | 50 | <field name="inherit_id" ref="account.view_partner_property_form"/> | ||
189 | 51 | <field name="arch" type="xml"> | ||
190 | 52 | |||
191 | 53 | <field name="bank_name" position="after"> | ||
192 | 54 | <field name="bank_abi"/> | ||
193 | 55 | <field name="bank_cab"/> | ||
194 | 56 | </field> | ||
195 | 57 | </field> | ||
196 | 58 | </record> | ||
197 | 59 | |||
198 | 60 | </data> | ||
199 | 61 | </openerp> | ||
200 | 0 | \ No newline at end of file | 62 | \ No newline at end of file |
201 | 1 | 63 | ||
202 | === added directory 'l10n_it_abicab/bank' | |||
203 | === added file 'l10n_it_abicab/bank/__init__.py' | |||
204 | --- l10n_it_abicab/bank/__init__.py 1970-01-01 00:00:00 +0000 | |||
205 | +++ l10n_it_abicab/bank/__init__.py 2013-06-18 14:14:40 +0000 | |||
206 | @@ -0,0 +1,20 @@ | |||
207 | 1 | # -*- coding: utf-8 -*- | ||
208 | 2 | ############################################################################## | ||
209 | 3 | # | ||
210 | 4 | # Copyright (C) 2013 Alessandro Camilli (a.camilli@yahoo.it) | ||
211 | 5 | # | ||
212 | 6 | # This program is free software: you can redistribute it and/or modify | ||
213 | 7 | # it under the terms of the GNU Affero General Public License as published | ||
214 | 8 | # by the Free Software Foundation, either version 3 of the License, or | ||
215 | 9 | # (at your option) any later version. | ||
216 | 10 | # | ||
217 | 11 | # This program is distributed in the hope that it will be useful, | ||
218 | 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
219 | 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
220 | 14 | # GNU General Public License for more details. | ||
221 | 15 | # | ||
222 | 16 | # You should have received a copy of the GNU Affero General Public License | ||
223 | 17 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
224 | 18 | # | ||
225 | 19 | ############################################################################## | ||
226 | 20 | import bank | ||
227 | 0 | 21 | ||
228 | === added file 'l10n_it_abicab/bank/bank.py' | |||
229 | --- l10n_it_abicab/bank/bank.py 1970-01-01 00:00:00 +0000 | |||
230 | +++ l10n_it_abicab/bank/bank.py 2013-06-18 14:14:40 +0000 | |||
231 | @@ -0,0 +1,98 @@ | |||
232 | 1 | # -*- coding: utf-8 -*- | ||
233 | 2 | ################################################################################# | ||
234 | 3 | # Author: Alessandro Camilli a.camilli@yahoo.it | ||
235 | 4 | # | ||
236 | 5 | # This program is free software: you can redistribute it and/or modify | ||
237 | 6 | # it under the terms of the GNU General Public License as published by | ||
238 | 7 | # the Free Software Foundation, either version 3 of the License, or | ||
239 | 8 | # (at your option) any later version. | ||
240 | 9 | # | ||
241 | 10 | # This program is distributed in the hope that it will be useful, | ||
242 | 11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
243 | 12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
244 | 13 | # GNU General Public License for more details. | ||
245 | 14 | # | ||
246 | 15 | # You should have received a copy of the GNU General Public License | ||
247 | 16 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
248 | 17 | # | ||
249 | 18 | ############################################################################## | ||
250 | 19 | |||
251 | 20 | from osv import fields,osv | ||
252 | 21 | from tools.translate import _ | ||
253 | 22 | import time | ||
254 | 23 | import base64 | ||
255 | 24 | import tools | ||
256 | 25 | from os import path | ||
257 | 26 | |||
258 | 27 | class bank(osv.osv_memory): | ||
259 | 28 | |||
260 | 29 | _name = "l10n_it_abicab.utility.import" | ||
261 | 30 | |||
262 | 31 | _description = 'Use this wizard to import bank from txt' | ||
263 | 32 | |||
264 | 33 | def import_from_abicab(self, cr, uid, ids, data, context=None): | ||
265 | 34 | |||
266 | 35 | addons_path = tools.config.get('addons_path') | ||
267 | 36 | path_for_file = "" | ||
268 | 37 | for os_path in addons_path.split(','): | ||
269 | 38 | path_for_file = os_path + "/l10n_it_abicab/bank/" | ||
270 | 39 | if path.exists(path_for_file): | ||
271 | 40 | break | ||
272 | 41 | |||
273 | 42 | file_txt_to_import = base64.decodestring(data['form']['file_txt_to_import']) | ||
274 | 43 | f = open(path_for_file + "abicab.txt", "w") | ||
275 | 44 | f.write(file_txt_to_import) | ||
276 | 45 | f.close() | ||
277 | 46 | |||
278 | 47 | iFile = open(path_for_file + 'abicab.txt') | ||
279 | 48 | reader = iFile.readlines() | ||
280 | 49 | |||
281 | 50 | for row in reader: | ||
282 | 51 | |||
283 | 52 | prefissoRiga = row[:2] | ||
284 | 53 | # | ||
285 | 54 | # INTESTAZIONE BANCA | ||
286 | 55 | # | ||
287 | 56 | if prefissoRiga == '11': | ||
288 | 57 | banca_descrizione = row[13:93] | ||
289 | 58 | # | ||
290 | 59 | # INDIRIZZO AGENZIA | ||
291 | 60 | # | ||
292 | 61 | if prefissoRiga == '21': | ||
293 | 62 | agenzia_indirizzo = row[20:60] | ||
294 | 63 | agenzia_localita = row[140:180] | ||
295 | 64 | agenzia_cap = row[180:185] | ||
296 | 65 | agenzia_provincia = row[185:187] | ||
297 | 66 | # | ||
298 | 67 | # AGENZIA | ||
299 | 68 | # | ||
300 | 69 | if prefissoRiga == '31': | ||
301 | 70 | agenzia_abi = row[2:7] | ||
302 | 71 | agenzia_cab = row[7:12] | ||
303 | 72 | agenzia_descrizione = row[12:52] | ||
304 | 73 | |||
305 | 74 | # Creazione banca ( dopo ogni agenzia) | ||
306 | 75 | bank_dati = { | ||
307 | 76 | 'name': banca_descrizione.strip().decode('cp1252') + ' - ' + agenzia_descrizione.strip().decode('cp1252'), | ||
308 | 77 | 'abi' : agenzia_abi, | ||
309 | 78 | 'cab': agenzia_cab, | ||
310 | 79 | 'street': agenzia_indirizzo.strip().decode('cp1252'), | ||
311 | 80 | 'zip': agenzia_cap, | ||
312 | 81 | 'city': agenzia_localita.strip().decode('cp1252'), | ||
313 | 82 | } | ||
314 | 83 | |||
315 | 84 | cr.execute('SELECT name,id FROM res_bank where abi =%s and cab=%s', (agenzia_abi, agenzia_cab) ) | ||
316 | 85 | bank_exists = cr.fetchall() | ||
317 | 86 | if len(bank_exists) == 0: | ||
318 | 87 | try: | ||
319 | 88 | bank_id = self.pool.get('res.bank').create(cr, uid, bank_dati) | ||
320 | 89 | cr.commit() | ||
321 | 90 | except Exception: | ||
322 | 91 | cr.rollback() | ||
323 | 92 | raise ("error creating %s: abi %s, cab %s", (banca_descrizione,agenzia_abi,agenzia_cab)) | ||
324 | 93 | |||
325 | 94 | |||
326 | 95 | iFile.close() | ||
327 | 96 | bank() | ||
328 | 97 | |||
329 | 98 | # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: | ||
330 | 0 | \ No newline at end of file | 99 | \ No newline at end of file |
331 | 1 | 100 | ||
332 | === added directory 'l10n_it_abicab/i18n' | |||
333 | === added file 'l10n_it_abicab/i18n/it.mo' | |||
334 | 2 | Binary files l10n_it_abicab/i18n/it.mo 1970-01-01 00:00:00 +0000 and l10n_it_abicab/i18n/it.mo 2013-06-18 14:14:40 +0000 differ | 101 | Binary files l10n_it_abicab/i18n/it.mo 1970-01-01 00:00:00 +0000 and l10n_it_abicab/i18n/it.mo 2013-06-18 14:14:40 +0000 differ |
335 | === added file 'l10n_it_abicab/i18n/it.po' | |||
336 | --- l10n_it_abicab/i18n/it.po 1970-01-01 00:00:00 +0000 | |||
337 | +++ l10n_it_abicab/i18n/it.po 2013-06-18 14:14:40 +0000 | |||
338 | @@ -0,0 +1,37 @@ | |||
339 | 1 | # Translation of OpenERP Server. | ||
340 | 2 | # This file contains the translation of the following modules: | ||
341 | 3 | # * l10n_it_abicab | ||
342 | 4 | # | ||
343 | 5 | msgid "" | ||
344 | 6 | msgstr "" | ||
345 | 7 | "Project-Id-Version: OpenERP Server 6.0.3\n" | ||
346 | 8 | "Report-Msgid-Bugs-To: support@openerp.com\n" | ||
347 | 9 | "POT-Creation-Date: 2011-12-29 13:07+0000\n" | ||
348 | 10 | "PO-Revision-Date: 2011-12-29 14:08+0100\n" | ||
349 | 11 | "Last-Translator: Franco Tampieri <info@titdata.it>\n" | ||
350 | 12 | "Language-Team: \n" | ||
351 | 13 | "MIME-Version: 1.0\n" | ||
352 | 14 | "Content-Type: text/plain; charset=UTF-8\n" | ||
353 | 15 | "Content-Transfer-Encoding: 8bit\n" | ||
354 | 16 | "Plural-Forms: \n" | ||
355 | 17 | |||
356 | 18 | #. module: l10n_it_abicab | ||
357 | 19 | #: field:res.bank,abi:0 | ||
358 | 20 | msgid "ABI" | ||
359 | 21 | msgstr "ABI" | ||
360 | 22 | |||
361 | 23 | #. module: l10n_it_abicab | ||
362 | 24 | #: view:res.bank:0 | ||
363 | 25 | msgid "Bank Details" | ||
364 | 26 | msgstr "Dettagli Banca" | ||
365 | 27 | |||
366 | 28 | #. module: l10n_it_abicab | ||
367 | 29 | #: model:ir.model,name:l10n_it_abicab.model_res_bank | ||
368 | 30 | msgid "Bank" | ||
369 | 31 | msgstr "Banca" | ||
370 | 32 | |||
371 | 33 | #. module: l10n_it_abicab | ||
372 | 34 | #: field:res.bank,cab:0 | ||
373 | 35 | msgid "CAB" | ||
374 | 36 | msgstr "CAB" | ||
375 | 37 | |||
376 | 0 | 38 | ||
377 | === added directory 'l10n_it_abicab/wizard' | |||
378 | === added file 'l10n_it_abicab/wizard/__init__.py' | |||
379 | --- l10n_it_abicab/wizard/__init__.py 1970-01-01 00:00:00 +0000 | |||
380 | +++ l10n_it_abicab/wizard/__init__.py 2013-06-18 14:14:40 +0000 | |||
381 | @@ -0,0 +1,22 @@ | |||
382 | 1 | # -*- encoding: utf-8 -*- | ||
383 | 2 | ############################################################################## | ||
384 | 3 | # | ||
385 | 4 | # OpenERP, Open Source Management Solution | ||
386 | 5 | # Copyright (C) 2012 | ||
387 | 6 | # Associazione OpenERP Italia (<http://www.openerp-italia.org>) | ||
388 | 7 | # | ||
389 | 8 | # This program is free software: you can redistribute it and/or modify | ||
390 | 9 | # it under the terms of the GNU Affero General Public License as | ||
391 | 10 | # published by the Free Software Foundation, either version 3 of the | ||
392 | 11 | # License, or (at your option) any later version. | ||
393 | 12 | # | ||
394 | 13 | # This program is distributed in the hope that it will be useful, | ||
395 | 14 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
396 | 15 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
397 | 16 | # GNU Affero General Public License for more details. | ||
398 | 17 | # | ||
399 | 18 | # You should have received a copy of the GNU Affero General Public License | ||
400 | 19 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
401 | 20 | # | ||
402 | 21 | ############################################################################# | ||
403 | 22 | import import_italian_bank | ||
404 | 0 | \ No newline at end of file | 23 | \ No newline at end of file |
405 | 1 | 24 | ||
406 | === added file 'l10n_it_abicab/wizard/import_italian_bank.py' | |||
407 | --- l10n_it_abicab/wizard/import_italian_bank.py 1970-01-01 00:00:00 +0000 | |||
408 | +++ l10n_it_abicab/wizard/import_italian_bank.py 2013-06-18 14:14:40 +0000 | |||
409 | @@ -0,0 +1,57 @@ | |||
410 | 1 | # -*- encoding: utf-8 -*- | ||
411 | 2 | ############################################################################## | ||
412 | 3 | # | ||
413 | 4 | # OpenERP, Open Source Management Solution | ||
414 | 5 | # Copyright (C) 2012 | ||
415 | 6 | # Associazione OpenERP Italia (<http://www.openerp-italia.org>) | ||
416 | 7 | # | ||
417 | 8 | # This program is free software: you can redistribute it and/or modify | ||
418 | 9 | # it under the terms of the GNU Affero General Public License as | ||
419 | 10 | # published by the Free Software Foundation, either version 3 of the | ||
420 | 11 | # License, or (at your option) any later version. | ||
421 | 12 | # | ||
422 | 13 | # This program is distributed in the hope that it will be useful, | ||
423 | 14 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
424 | 15 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
425 | 16 | # GNU Affero General Public License for more details. | ||
426 | 17 | # | ||
427 | 18 | # You should have received a copy of the GNU Affero General Public License | ||
428 | 19 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
429 | 20 | # | ||
430 | 21 | ############################################################################# | ||
431 | 22 | |||
432 | 23 | from osv import fields,osv | ||
433 | 24 | from tools.translate import _ | ||
434 | 25 | import time | ||
435 | 26 | import psycopg2 | ||
436 | 27 | from StringIO import StringIO | ||
437 | 28 | |||
438 | 29 | |||
439 | 30 | class wizard_import_italian_bank(osv.osv_memory): | ||
440 | 31 | |||
441 | 32 | _name = "wizard.import.italian.bank" | ||
442 | 33 | |||
443 | 34 | _description = 'Use this wizard to import italian bank from ufficial file txt' | ||
444 | 35 | |||
445 | 36 | _columns={ | ||
446 | 37 | 'file_txt_to_import': fields.binary('File TXT to import', required=True, help="Se il file è troppo grande, dividerlo facendo attenzione \ | ||
447 | 38 | affinchè la prima riga del nuovo file inizi con il previsso 11, ovvero con l'intestazione della nuova banca."), | ||
448 | 39 | } | ||
449 | 40 | |||
450 | 41 | |||
451 | 42 | def import_italian_bank(self, cr, uid, ids, data, context=None): | ||
452 | 43 | |||
453 | 44 | for wiz_obj in self.read(cr,uid,ids): | ||
454 | 45 | if 'form' not in data: | ||
455 | 46 | data['form'] = {} | ||
456 | 47 | #data['form']['type'] = wiz_obj['type'] | ||
457 | 48 | data['form']['file_txt_to_import'] = wiz_obj['file_txt_to_import'] | ||
458 | 49 | |||
459 | 50 | self.pool.get('l10n_it_abicab.utility.import').import_from_abicab(cr, uid, ids, data, context=None) | ||
460 | 51 | |||
461 | 52 | return {'type': 'ir.actions.act_window_close'} | ||
462 | 53 | |||
463 | 54 | |||
464 | 55 | wizard_import_italian_bank() | ||
465 | 56 | |||
466 | 57 | # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: | ||
467 | 0 | \ No newline at end of file | 58 | \ No newline at end of file |
468 | 1 | 59 | ||
469 | === added file 'l10n_it_abicab/wizard/import_italian_bank_view.xml' | |||
470 | --- l10n_it_abicab/wizard/import_italian_bank_view.xml 1970-01-01 00:00:00 +0000 | |||
471 | +++ l10n_it_abicab/wizard/import_italian_bank_view.xml 2013-06-18 14:14:40 +0000 | |||
472 | @@ -0,0 +1,37 @@ | |||
473 | 1 | <?xml version="1.0" encoding="utf-8"?> | ||
474 | 2 | <openerp> | ||
475 | 3 | <data> | ||
476 | 4 | <!-- | ||
477 | 5 | Form | ||
478 | 6 | --> | ||
479 | 7 | <record id="l10n_it_abicab_utility_import_italian_bank" model="ir.ui.view"> | ||
480 | 8 | <field eval="1" name="priority"/> | ||
481 | 9 | <field name="name">openforce.utility.import.italian.bank</field> | ||
482 | 10 | <field name="model">wizard.import.italian.bank</field> | ||
483 | 11 | <field name="type">form</field> | ||
484 | 12 | <field name="arch" type="xml"> | ||
485 | 13 | <form string="Params" version="7.0"> | ||
486 | 14 | <group col="4"> | ||
487 | 15 | <field name="file_txt_to_import" /> | ||
488 | 16 | </group> | ||
489 | 17 | <button name="import_italian_bank" string="Import italian banks " type="object" icon="gtk-execute" /> | ||
490 | 18 | </form> | ||
491 | 19 | </field> | ||
492 | 20 | </record> | ||
493 | 21 | |||
494 | 22 | <!-- ACTION --> | ||
495 | 23 | |||
496 | 24 | <record id="l10n_it_abicab_utility_import_italian_bank_action" model="ir.actions.act_window"> | ||
497 | 25 | <field name="name">Import italian bank</field> | ||
498 | 26 | <field name="res_model">wizard.import.italian.bank</field> | ||
499 | 27 | <field name="view_type">form</field> | ||
500 | 28 | <field name="view_mode">form,tree,graph</field> | ||
501 | 29 | <field name="view_id" ref="l10n_it_abicab_utility_import_italian_bank"/> | ||
502 | 30 | <field name="help">Import italian bank from txt abicab</field> | ||
503 | 31 | <field name="target">new</field> | ||
504 | 32 | </record> | ||
505 | 33 | |||
506 | 34 | <menuitem action="l10n_it_abicab_utility_import_italian_bank_action" id="menu_l10n_it_abicab_utility_import_italian_bank" parent="account.menu_configuration_misc"/> | ||
507 | 35 | |||
508 | 36 | </data> | ||
509 | 37 | </openerp> |
Ciao Alessandro.
Dove è documentata la struttura del file TXT da importare?
Qual è il tipico caso d'uso in cui questa nuova funzionalità verrebbe usata?
Come mai 'wizard. import. italian. bank' e 'l10n_it_ abicab. utility. import' sono due model distinti?
Grazie