Merge lp:~domsense/domsense-agilebg-addons/adding_account_invoice_template into lp:domsense-agilebg-addons/6.0

Proposed by Lorenzo Battistini
Status: Merged
Merged at revision: 59
Proposed branch: lp:~domsense/domsense-agilebg-addons/adding_account_invoice_template
Merge into: lp:domsense-agilebg-addons/6.0
Diff against target: 959 lines (+901/-0)
11 files modified
account_invoice_template/AUTHORS.txt (+1/-0)
account_invoice_template/__init__.py (+23/-0)
account_invoice_template/__openerp__.py (+47/-0)
account_invoice_template/account_invoice_template.py (+61/-0)
account_invoice_template/i18n/account_invoice_template.pot (+204/-0)
account_invoice_template/i18n/it.po (+228/-0)
account_invoice_template/invoice_template.xml (+101/-0)
account_invoice_template/security/ir.model.access.csv (+5/-0)
account_invoice_template/wizard/__init__.py (+22/-0)
account_invoice_template/wizard/select_template.py (+138/-0)
account_invoice_template/wizard/select_template.xml (+71/-0)
To merge this branch: bzr merge lp:~domsense/domsense-agilebg-addons/adding_account_invoice_template
Reviewer Review Type Date Requested Status
Agile Business Group Pending
Review via email: mp+80823@code.launchpad.net
To post a comment you must log in.
56. By Lorenzo Battistini

[FIX] translations and wizard

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== added directory 'account_invoice_template'
2=== added file 'account_invoice_template/AUTHORS.txt'
3--- account_invoice_template/AUTHORS.txt 1970-01-01 00:00:00 +0000
4+++ account_invoice_template/AUTHORS.txt 2011-11-02 10:44:07 +0000
5@@ -0,0 +1,1 @@
6+Lorenzo Battistini <lorenzo.battistini@agilebg.com>
7
8=== added file 'account_invoice_template/__init__.py'
9--- account_invoice_template/__init__.py 1970-01-01 00:00:00 +0000
10+++ account_invoice_template/__init__.py 2011-11-02 10:44:07 +0000
11@@ -0,0 +1,23 @@
12+# -*- coding: utf-8 -*-
13+##############################################################################
14+#
15+# Copyright (C) 2011 Agile Business Group sagl (<http://www.agilebg.com>)
16+# Copyright (C) 2011 Domsense srl (<http://www.domsense.com>)
17+# All Rights Reserved
18+#
19+# This program is free software: you can redistribute it and/or modify
20+# it under the terms of the GNU Affero General Public License as published
21+# by the Free Software Foundation, either version 3 of the License, or
22+# (at your option) any later version.
23+#
24+# This program is distributed in the hope that it will be useful,
25+# but WITHOUT ANY WARRANTY; without even the implied warranty of
26+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
27+# GNU General Public License for more details.
28+#
29+# You should have received a copy of the GNU Affero General Public License
30+# along with this program. If not, see <http://www.gnu.org/licenses/>.
31+#
32+##############################################################################
33+import account_invoice_template
34+import wizard
35
36=== added file 'account_invoice_template/__openerp__.py'
37--- account_invoice_template/__openerp__.py 1970-01-01 00:00:00 +0000
38+++ account_invoice_template/__openerp__.py 2011-11-02 10:44:07 +0000
39@@ -0,0 +1,47 @@
40+# -*- coding: utf-8 -*-
41+##############################################################################
42+#
43+# Copyright (C) 2011 Agile Business Group sagl (<http://www.agilebg.com>)
44+# Copyright (C) 2011 Domsense srl (<http://www.domsense.com>)
45+# All Rights Reserved
46+#
47+# This program is free software: you can redistribute it and/or modify
48+# it under the terms of the GNU Affero General Public License as published
49+# by the Free Software Foundation, either version 3 of the License, or
50+# (at your option) any later version.
51+#
52+# This program is distributed in the hope that it will be useful,
53+# but WITHOUT ANY WARRANTY; without even the implied warranty of
54+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
55+# GNU General Public License for more details.
56+#
57+# You should have received a copy of the GNU Affero General Public License
58+# along with this program. If not, see <http://www.gnu.org/licenses/>.
59+#
60+##############################################################################
61+{
62+ 'name': "Account Invoice Template",
63+ 'version': '0.1',
64+ 'category': 'Generic Modules/Accounting',
65+ 'description': """
66+======================
67+Templates for Invoices
68+======================
69+User can configure invoice templates, useful for recurring invoices.
70+The amount of each template line can be computed (through python code) or kept as user input. If user input, when using the template, user has to fill the amount of every input lines.
71+The invoice form allows lo load, through a wizard, the template to use and the amounts to fill.
72+""",
73+ 'author': 'Agile Business Group & Domsense',
74+ 'website': 'http://www.agilebg.com',
75+ 'license': 'AGPL-3',
76+ "depends" : ['account_move_template'],
77+ "init_xml" : [],
78+ "update_xml" : [
79+ 'invoice_template.xml',
80+ 'wizard/select_template.xml',
81+ 'security/ir.model.access.csv',
82+ ],
83+ "demo_xml" : [],
84+ "active": False,
85+ "installable": True
86+}
87
88=== added file 'account_invoice_template/account_invoice_template.py'
89--- account_invoice_template/account_invoice_template.py 1970-01-01 00:00:00 +0000
90+++ account_invoice_template/account_invoice_template.py 2011-11-02 10:44:07 +0000
91@@ -0,0 +1,61 @@
92+# -*- coding: utf-8 -*-
93+##############################################################################
94+#
95+# Copyright (C) 2011 Agile Business Group sagl (<http://www.agilebg.com>)
96+# Copyright (C) 2011 Domsense srl (<http://www.domsense.com>)
97+# All Rights Reserved
98+#
99+# This program is free software: you can redistribute it and/or modify
100+# it under the terms of the GNU Affero General Public License as published
101+# by the Free Software Foundation, either version 3 of the License, or
102+# (at your option) any later version.
103+#
104+# This program is distributed in the hope that it will be useful,
105+# but WITHOUT ANY WARRANTY; without even the implied warranty of
106+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
107+# GNU General Public License for more details.
108+#
109+# You should have received a copy of the GNU Affero General Public License
110+# along with this program. If not, see <http://www.gnu.org/licenses/>.
111+#
112+##############################################################################
113+
114+from osv import fields, osv
115+from tools.translate import _
116+
117+class account_invoice_template(osv.osv):
118+
119+ _inherit = 'account.document.template'
120+ _name = 'account.invoice.template'
121+
122+ _columns = {
123+ 'partner_id': fields.many2one('res.partner', 'Partner', required=True),
124+ 'account_id': fields.many2one('account.account', 'Account', required=True),
125+ 'template_line_ids': fields.one2many('account.invoice.template.line', 'template_id', 'Template Lines'),
126+ 'type': fields.selection([
127+ ('out_invoice','Customer Invoice'),
128+ ('in_invoice','Supplier Invoice'),
129+ ('out_refund','Customer Refund'),
130+ ('in_refund','Supplier Refund'),
131+ ],'Type', required=True ),
132+ }
133+
134+account_invoice_template()
135+
136+class account_invoice_template_line(osv.osv):
137+
138+ _name = 'account.invoice.template.line'
139+ _inherit = 'account.document.template.line'
140+
141+ _columns = {
142+ 'account_id': fields.many2one('account.account', 'Account', required=True, domain=[('type','<>','view'), ('type', '<>', 'closed')]),
143+ 'analytic_account_id': fields.many2one('account.analytic.account', 'Analytic Account', ondelete="cascade"),
144+ 'invoice_line_tax_id': fields.many2many('account.tax', 'account_invoice_line_tax', 'invoice_line_id', 'tax_id', 'Taxes', domain=[('parent_id','=',False)]),
145+ 'template_id': fields.many2one('account.invoice.template', 'Template'),
146+ }
147+
148+ _sql_constraints = [
149+ ('sequence_template_uniq', 'unique (template_id,sequence)', 'The sequence of the line must be unique per template !')
150+ ]
151+
152+account_invoice_template_line()
153
154=== added directory 'account_invoice_template/i18n'
155=== added file 'account_invoice_template/i18n/account_invoice_template.pot'
156--- account_invoice_template/i18n/account_invoice_template.pot 1970-01-01 00:00:00 +0000
157+++ account_invoice_template/i18n/account_invoice_template.pot 2011-11-02 10:44:07 +0000
158@@ -0,0 +1,204 @@
159+# Translation of OpenERP Server.
160+# This file contains the translation of the following modules:
161+# * account_invoice_template
162+#
163+msgid ""
164+msgstr ""
165+"Project-Id-Version: OpenERP Server 6.0.3\n"
166+"Report-Msgid-Bugs-To: support@openerp.com\n"
167+"POT-Creation-Date: 2011-10-31 16:49+0000\n"
168+"PO-Revision-Date: 2011-10-31 16:49+0000\n"
169+"Last-Translator: <>\n"
170+"Language-Team: \n"
171+"MIME-Version: 1.0\n"
172+"Content-Type: text/plain; charset=UTF-8\n"
173+"Content-Transfer-Encoding: \n"
174+"Plural-Forms: \n"
175+
176+#. module: account_invoice_template
177+#: selection:account.invoice.template,type:0
178+#: selection:wizard.select.invoice.template.line,type:0
179+msgid "Customer Refund"
180+msgstr ""
181+
182+#. module: account_invoice_template
183+#: model:ir.actions.act_window,name:account_invoice_template.action_wizard_select_template_by_invoice
184+#: model:ir.ui.menu,name:account_invoice_template.menu_action_wizard_select_template
185+msgid "Create Invoice from Template"
186+msgstr ""
187+
188+#. module: account_invoice_template
189+#: selection:account.invoice.template,type:0
190+#: selection:wizard.select.invoice.template.line,type:0
191+msgid "Customer Invoice"
192+msgstr ""
193+
194+#. module: account_invoice_template
195+#: model:ir.model,name:account_invoice_template.model_account_invoice_template_line
196+msgid "account.invoice.template.line"
197+msgstr ""
198+
199+#. module: account_invoice_template
200+#: field:account.invoice.template.line,sequence:0
201+#: field:wizard.select.invoice.template.line,sequence:0
202+msgid "Number"
203+msgstr ""
204+
205+#. module: account_invoice_template
206+#: selection:account.invoice.template,type:0
207+#: selection:wizard.select.invoice.template.line,type:0
208+msgid "Supplier Invoice"
209+msgstr ""
210+
211+#. module: account_invoice_template
212+#: field:account.invoice.template.line,template_id:0
213+#: field:wizard.select.invoice.template.line,template_id:0
214+msgid "Template"
215+msgstr ""
216+
217+#. module: account_invoice_template
218+#: field:account.invoice.template,type:0
219+#: field:account.invoice.template.line,type:0
220+#: field:wizard.select.invoice.template.line,type:0
221+msgid "Type"
222+msgstr ""
223+
224+#. module: account_invoice_template
225+#: model:ir.model,name:account_invoice_template.model_account_invoice_template
226+msgid "account.invoice.template"
227+msgstr ""
228+
229+#. module: account_invoice_template
230+#: model:ir.model,name:account_invoice_template.model_wizard_select_invoice_template
231+msgid "wizard.select.invoice.template"
232+msgstr ""
233+
234+#. module: account_invoice_template
235+#: code:addons/account_invoice_template/wizard/select_template.py:66
236+#, python-format
237+msgid "Error !"
238+msgstr ""
239+
240+#. module: account_invoice_template
241+#: selection:account.invoice.template.line,type:0
242+msgid "User input"
243+msgstr ""
244+
245+#. module: account_invoice_template
246+#: view:account.invoice.template.line:0
247+#: view:wizard.select.invoice.template.line:0
248+msgid "Invoice Template Line"
249+msgstr ""
250+
251+#. module: account_invoice_template
252+#: field:account.invoice.template,account_id:0
253+#: field:account.invoice.template.line,account_id:0
254+#: field:wizard.select.invoice.template.line,account_id:0
255+msgid "Account"
256+msgstr ""
257+
258+#. module: account_invoice_template
259+#: field:account.invoice.template,name:0
260+#: field:account.invoice.template.line,name:0
261+#: field:wizard.select.invoice.template.line,name:0
262+msgid "Name"
263+msgstr ""
264+
265+#. module: account_invoice_template
266+#: field:wizard.select.invoice.template,line_ids:0
267+msgid "Lines"
268+msgstr ""
269+
270+#. module: account_invoice_template
271+#: field:account.invoice.template.line,invoice_line_tax_id:0
272+msgid "Taxes"
273+msgstr ""
274+
275+#. module: account_invoice_template
276+#: code:addons/account_invoice_template/wizard/select_template.py:66
277+#, python-format
278+msgid "At least one amount has to be non-zero!"
279+msgstr ""
280+
281+#. module: account_invoice_template
282+#: field:wizard.select.invoice.template.line,amount:0
283+msgid "Amount"
284+msgstr ""
285+
286+#. module: account_invoice_template
287+#: view:account.invoice.template:0
288+#: view:wizard.select.invoice.template:0
289+#: field:wizard.select.invoice.template,template_id:0
290+msgid "Invoice Template"
291+msgstr ""
292+
293+#. module: account_invoice_template
294+#: selection:account.invoice.template,type:0
295+#: selection:wizard.select.invoice.template.line,type:0
296+msgid "Supplier Refund"
297+msgstr ""
298+
299+#. module: account_invoice_template
300+#: model:ir.actions.act_window,name:account_invoice_template.action_wizard_select_template
301+msgid "Select Invoice Template"
302+msgstr ""
303+
304+#. module: account_invoice_template
305+#: sql_constraint:account.invoice.template.line:0
306+msgid "The sequence of the line must be unique per template !"
307+msgstr ""
308+
309+#. module: account_invoice_template
310+#: view:wizard.select.invoice.template:0
311+msgid "Load"
312+msgstr ""
313+
314+#. module: account_invoice_template
315+#: view:account.invoice.template.line:0
316+msgid "You can refer to other lines using their sequence number (e.g. 'L(1)' for first line). Examples of code: 'L(1) * 0.2'; 'L(2) - L(1)'; 'L(1) + L(2) + L(3)'; '1250'"
317+msgstr ""
318+
319+#. module: account_invoice_template
320+#: selection:account.invoice.template.line,type:0
321+msgid "Computed"
322+msgstr ""
323+
324+#. module: account_invoice_template
325+#: view:account.invoice.template:0
326+msgid "Group By..."
327+msgstr ""
328+
329+#. module: account_invoice_template
330+#: view:account.invoice.template.line:0
331+#: field:account.invoice.template.line,python_code:0
332+msgid "Python Code"
333+msgstr ""
334+
335+#. module: account_invoice_template
336+#: model:ir.actions.act_window,name:account_invoice_template.action_invoice_template_form
337+#: model:ir.ui.menu,name:account_invoice_template.menu_action_invoice_template_form
338+msgid "Invoice Templates"
339+msgstr ""
340+
341+#. module: account_invoice_template
342+#: field:account.invoice.template.line,analytic_account_id:0
343+msgid "Analytic Account"
344+msgstr ""
345+
346+#. module: account_invoice_template
347+#: field:account.invoice.template,template_line_ids:0
348+#: model:ir.model,name:account_invoice_template.model_wizard_select_invoice_template_line
349+msgid "Template Lines"
350+msgstr ""
351+
352+#. module: account_invoice_template
353+#: view:wizard.select.invoice.template:0
354+msgid "Cancel"
355+msgstr ""
356+
357+#. module: account_invoice_template
358+#: view:account.invoice.template:0
359+#: field:account.invoice.template,partner_id:0
360+msgid "Partner"
361+msgstr ""
362+
363
364=== added file 'account_invoice_template/i18n/it.po'
365--- account_invoice_template/i18n/it.po 1970-01-01 00:00:00 +0000
366+++ account_invoice_template/i18n/it.po 2011-11-02 10:44:07 +0000
367@@ -0,0 +1,228 @@
368+# Translation of OpenERP Server.
369+# This file contains the translation of the following modules:
370+# * account_invoice_template
371+#
372+msgid ""
373+msgstr ""
374+"Project-Id-Version: OpenERP Server 6.0.3\n"
375+"Report-Msgid-Bugs-To: support@openerp.com\n"
376+"POT-Creation-Date: 2011-11-02 10:30+0000\n"
377+"PO-Revision-Date: 2011-11-02 11:35+0100\n"
378+"Last-Translator: Lorenzo Battistini <lorenzo.battistini@agilebg.com>\n"
379+"Language-Team: \n"
380+"MIME-Version: 1.0\n"
381+"Content-Type: text/plain; charset=UTF-8\n"
382+"Content-Transfer-Encoding: 8bit\n"
383+"Plural-Forms: \n"
384+
385+#. module: account_invoice_template
386+#: view:account.invoice.template.line:0
387+#: view:wizard.select.invoice.template.line:0
388+msgid "Invoice Template Line"
389+msgstr "Riga template fattura"
390+
391+#. module: account_invoice_template
392+#: selection:account.invoice.template,type:0
393+#: selection:wizard.select.invoice.template.line,type:0
394+msgid "Customer Refund"
395+msgstr "Nota di credito"
396+
397+#. module: account_invoice_template
398+#: model:ir.actions.act_window,name:account_invoice_template.action_wizard_select_template_by_invoice
399+#: model:ir.ui.menu,name:account_invoice_template.menu_action_wizard_select_template
400+msgid "Create Invoice from Template"
401+msgstr "Crea fattura da template"
402+
403+#. module: account_invoice_template
404+#: selection:account.invoice.template,type:0
405+#: selection:wizard.select.invoice.template.line,type:0
406+msgid "Customer Invoice"
407+msgstr "Fattura cliente"
408+
409+#. module: account_invoice_template
410+#: model:ir.model,name:account_invoice_template.model_account_invoice_template_line
411+msgid "account.invoice.template.line"
412+msgstr "account.invoice.template.line"
413+
414+#. module: account_invoice_template
415+#: field:account.invoice.template.line,sequence:0
416+#: field:wizard.select.invoice.template.line,sequence:0
417+msgid "Number"
418+msgstr "Numero"
419+
420+#. module: account_invoice_template
421+#: view:account.invoice.template:0
422+msgid "Group By..."
423+msgstr "Raggruppa per..."
424+
425+#. module: account_invoice_template
426+#: field:account.invoice.template.line,template_id:0
427+#: field:wizard.select.invoice.template.line,template_id:0
428+msgid "Template"
429+msgstr "Template"
430+
431+#. module: account_invoice_template
432+#: field:account.invoice.template,type:0
433+#: field:account.invoice.template.line,type:0
434+#: field:wizard.select.invoice.template.line,type:0
435+msgid "Type"
436+msgstr "Tipo"
437+
438+#. module: account_invoice_template
439+#: model:ir.model,name:account_invoice_template.model_account_invoice_template
440+msgid "account.invoice.template"
441+msgstr "account.invoice.template"
442+
443+#. module: account_invoice_template
444+#: model:ir.model,name:account_invoice_template.model_wizard_select_invoice_template
445+msgid "wizard.select.invoice.template"
446+msgstr "wizard.select.invoice.template"
447+
448+#. module: account_invoice_template
449+#: code:addons/account_invoice_template/wizard/select_template.py:67
450+#, python-format
451+msgid "Error !"
452+msgstr "Errore !"
453+
454+#. module: account_invoice_template
455+#: selection:account.invoice.template.line,type:0
456+msgid "User input"
457+msgstr "Input utente"
458+
459+#. module: account_invoice_template
460+#: model:ir.module.module,description:account_invoice_template.module_meta_information
461+msgid ""
462+"\n"
463+"======================\n"
464+"Templates for Invoices\n"
465+"======================\n"
466+"User can configure invoice templates, useful for recurring invoices.\n"
467+"The amount of each template line can be computed (through python code) or kept as user input. If user input, when using the template, user has to fill the amount of every input lines.\n"
468+"The invoice form allows lo load, through a wizard, the template to use and the amounts to fill.\n"
469+msgstr ""
470+"\n"
471+"======================\n"
472+"Templates for Invoices\n"
473+"======================\n"
474+"User can configure invoice templates, useful for recurring invoices.\n"
475+"The amount of each template line can be computed (through python code) or kept as user input. If user input, when using the template, user has to fill the amount of every input lines.\n"
476+"The invoice form allows lo load, through a wizard, the template to use and the amounts to fill.\n"
477+
478+#. module: account_invoice_template
479+#: field:account.invoice.template,account_id:0
480+#: field:account.invoice.template.line,account_id:0
481+#: field:wizard.select.invoice.template.line,account_id:0
482+msgid "Account"
483+msgstr "Conto"
484+
485+#. module: account_invoice_template
486+#: field:account.invoice.template,name:0
487+#: field:account.invoice.template.line,name:0
488+#: field:wizard.select.invoice.template.line,name:0
489+msgid "Name"
490+msgstr "Nome"
491+
492+#. module: account_invoice_template
493+#: field:wizard.select.invoice.template,line_ids:0
494+msgid "Lines"
495+msgstr "Righe"
496+
497+#. module: account_invoice_template
498+#: field:account.invoice.template.line,invoice_line_tax_id:0
499+msgid "Taxes"
500+msgstr "Imposte"
501+
502+#. module: account_invoice_template
503+#: code:addons/account_invoice_template/wizard/select_template.py:67
504+#, python-format
505+msgid "At least one amount has to be non-zero!"
506+msgstr "Almeno un importo deve essere diverso da zero!"
507+
508+#. module: account_invoice_template
509+#: field:wizard.select.invoice.template.line,amount:0
510+msgid "Amount"
511+msgstr "Importo"
512+
513+#. module: account_invoice_template
514+#: view:account.invoice.template:0
515+#: view:wizard.select.invoice.template:0
516+#: field:wizard.select.invoice.template,template_id:0
517+msgid "Invoice Template"
518+msgstr "Template fattura"
519+
520+#. module: account_invoice_template
521+#: selection:account.invoice.template,type:0
522+#: selection:wizard.select.invoice.template.line,type:0
523+msgid "Supplier Refund"
524+msgstr "Reso a fornitore"
525+
526+#. module: account_invoice_template
527+#: model:ir.actions.act_window,name:account_invoice_template.action_wizard_select_template
528+msgid "Select Invoice Template"
529+msgstr "Scegli template fattura"
530+
531+#. module: account_invoice_template
532+#: sql_constraint:account.invoice.template.line:0
533+msgid "The sequence of the line must be unique per template !"
534+msgstr "Il numero della riga deve essere unico per template!"
535+
536+#. module: account_invoice_template
537+#: model:ir.module.module,shortdesc:account_invoice_template.module_meta_information
538+msgid "Account Invoice Template"
539+msgstr "Account Invoice Template"
540+
541+#. module: account_invoice_template
542+#: view:wizard.select.invoice.template:0
543+msgid "Load"
544+msgstr "Carica"
545+
546+#. module: account_invoice_template
547+#: view:account.invoice.template.line:0
548+msgid "You can refer to other lines using their sequence number (e.g. 'L(1)' for first line). Examples of code: 'L(1) * 0.2'; 'L(2) - L(1)'; 'L(1) + L(2) + L(3)'; '1250'"
549+msgstr "E' possibile fare riferimento alle altre righe usando il loro numero (ad es. 'L(1)' rappresenta la prima riga). Esempi di codice: 'L(1) * 0.2'; 'L(2) - L(1)'; 'L(1) + L(2) + L(3)'; '1250'"
550+
551+#. module: account_invoice_template
552+#: selection:account.invoice.template.line,type:0
553+msgid "Computed"
554+msgstr "Calcolato"
555+
556+#. module: account_invoice_template
557+#: selection:account.invoice.template,type:0
558+#: selection:wizard.select.invoice.template.line,type:0
559+msgid "Supplier Invoice"
560+msgstr "Fattura fornitore"
561+
562+#. module: account_invoice_template
563+#: view:account.invoice.template.line:0
564+#: field:account.invoice.template.line,python_code:0
565+msgid "Python Code"
566+msgstr "Codice python"
567+
568+#. module: account_invoice_template
569+#: model:ir.actions.act_window,name:account_invoice_template.action_invoice_template_form
570+#: model:ir.ui.menu,name:account_invoice_template.menu_action_invoice_template_form
571+msgid "Invoice Templates"
572+msgstr "Template fatture"
573+
574+#. module: account_invoice_template
575+#: field:account.invoice.template.line,analytic_account_id:0
576+msgid "Analytic Account"
577+msgstr "Conto analitico"
578+
579+#. module: account_invoice_template
580+#: field:account.invoice.template,template_line_ids:0
581+#: model:ir.model,name:account_invoice_template.model_wizard_select_invoice_template_line
582+msgid "Template Lines"
583+msgstr "Righe template"
584+
585+#. module: account_invoice_template
586+#: view:wizard.select.invoice.template:0
587+msgid "Cancel"
588+msgstr "Annulla"
589+
590+#. module: account_invoice_template
591+#: view:account.invoice.template:0
592+#: field:account.invoice.template,partner_id:0
593+msgid "Partner"
594+msgstr "Partner"
595+
596
597=== added file 'account_invoice_template/invoice_template.xml'
598--- account_invoice_template/invoice_template.xml 1970-01-01 00:00:00 +0000
599+++ account_invoice_template/invoice_template.xml 2011-11-02 10:44:07 +0000
600@@ -0,0 +1,101 @@
601+<?xml version="1.0" encoding="utf-8"?>
602+<openerp>
603+ <data>
604+
605+ <record id="view_invoice_template_line_tree" model="ir.ui.view">
606+ <field name="name">account.invoice.template.line.tree</field>
607+ <field name="model">account.invoice.template.line</field>
608+ <field name="type">tree</field>
609+ <field name="arch" type="xml">
610+ <tree string="Invoice Template Line">
611+ <field name="sequence"/>
612+ <field name="name"/>
613+ <field name="account_id" />
614+ <field name="analytic_account_id" groups="analytic.group_analytic_accounting"/>
615+ <field name="type"/>
616+ <field name="python_code" />
617+ </tree>
618+ </field>
619+ </record>
620+
621+
622+ <record id="view_invoice_template_line_form" model="ir.ui.view">
623+ <field name="name">account.invoice.template.line.form</field>
624+ <field name="model">account.invoice.template.line</field>
625+ <field name="type">form</field>
626+ <field name="arch" type="xml">
627+ <form string="Invoice Template Line">
628+ <field colspan="4" name="name" select="1"/>
629+ <field name="sequence"/>
630+ <field name="account_id" />
631+ <field name="analytic_account_id" groups="analytic.group_analytic_accounting"/>
632+ <field name="type"/>
633+ <separator string="Python Code" colspan="4"/>
634+ <field name="python_code" colspan="4" attrs="{'readonly': [('type', '!=', 'computed')]}" nolabel="1"/>
635+ <label string="You can refer to other lines using their sequence number (e.g. 'L(1)' for first line). Examples of code: 'L(1) * 0.2'; 'L(2) - L(1)'; 'L(1) + L(2) + L(3)'; '1250'" colspan="4"/>
636+ <field name="invoice_line_tax_id" colspan="4" nolabel="1"/>
637+ </form>
638+ </field>
639+ </record>
640+
641+ <record id="view_invoice_template_form" model="ir.ui.view">
642+ <field name="name">account.invoice.template.form</field>
643+ <field name="model">account.invoice.template</field>
644+ <field name="type">form</field>
645+ <field name="arch" type="xml">
646+ <form string="Invoice Template">
647+ <field name="name"/>
648+ <field name="partner_id"/>
649+ <field name="account_id" />
650+ <field name="type" />
651+ <field colspan="4" nolabel="1" name="template_line_ids"/>
652+ </form>
653+ </field>
654+ </record>
655+
656+ <record id="view_invoice_template_tree" model="ir.ui.view">
657+ <field name="name">account.invoice.template.tree</field>
658+ <field name="model">account.invoice.template</field>
659+ <field name="type">tree</field>
660+ <field name="arch" type="xml">
661+ <tree string="Invoice Template">
662+ <field name="name"/>
663+ <field name="partner_id"/>
664+ <field name="account_id" />
665+ <field name="type" />
666+ </tree>
667+ </field>
668+ </record>
669+
670+ <record id="view_invoice_template_search" model="ir.ui.view">
671+ <field name="name">account.invoice.template.search</field>
672+ <field name="model">account.invoice.template</field>
673+ <field name="type">search</field>
674+ <field name="arch" type="xml">
675+ <search string="Invoice Template">
676+ <group>
677+ <field name="name"/>
678+ <field name="partner_id" />
679+ <field name="account_id" />
680+ <field name="type" />
681+ </group>
682+ <newline/>
683+ <group expand="0" string="Group By...">
684+ <filter string="Partner" icon="terp-folder-orange" domain="[]" context="{'group_by':'partner_id'}"/>
685+ </group>
686+ </search>
687+ </field>
688+ </record>
689+
690+ <record id="action_invoice_template_form" model="ir.actions.act_window">
691+ <field name="name">Invoice Templates</field>
692+ <field name="res_model">account.invoice.template</field>
693+ <field name="view_type">form</field>
694+ <field name="view_mode">tree,form</field>
695+ <field name="search_view_id" ref="view_invoice_template_search"/>
696+ </record>
697+ <menuitem
698+ action="action_invoice_template_form" id="menu_action_invoice_template_form" sequence="5"
699+ parent="account.menu_configuration_misc" groups="base.group_extended"/>
700+ </data>
701+</openerp>
702
703=== added directory 'account_invoice_template/security'
704=== added file 'account_invoice_template/security/ir.model.access.csv'
705--- account_invoice_template/security/ir.model.access.csv 1970-01-01 00:00:00 +0000
706+++ account_invoice_template/security/ir.model.access.csv 2011-11-02 10:44:07 +0000
707@@ -0,0 +1,5 @@
708+"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink"
709+"access_account_invoice_template_user","account_invoice_template_user","model_account_invoice_template","account.group_account_user","1","1","1","1"
710+"access_account_invoice_template_manager","account_invoice_template_manager","model_account_invoice_template","account.group_account_manager","1","1","1","1"
711+"access_account_invoice_template_line_user","account_invoice_template_line_user","model_account_invoice_template_line","account.group_account_user","1","1","1","1"
712+"access_account_invoice_template_line_manager","account_invoice_template_line_manager","model_account_invoice_template_line","account.group_account_manager","1","1","1","1"
713
714=== added directory 'account_invoice_template/wizard'
715=== added file 'account_invoice_template/wizard/__init__.py'
716--- account_invoice_template/wizard/__init__.py 1970-01-01 00:00:00 +0000
717+++ account_invoice_template/wizard/__init__.py 2011-11-02 10:44:07 +0000
718@@ -0,0 +1,22 @@
719+# -*- coding: utf-8 -*-
720+##############################################################################
721+#
722+# Copyright (C) 2011 Agile Business Group sagl (<http://www.agilebg.com>)
723+# Copyright (C) 2011 Domsense srl (<http://www.domsense.com>)
724+# All Rights Reserved
725+#
726+# This program is free software: you can redistribute it and/or modify
727+# it under the terms of the GNU Affero General Public License as published
728+# by the Free Software Foundation, either version 3 of the License, or
729+# (at your option) any later version.
730+#
731+# This program is distributed in the hope that it will be useful,
732+# but WITHOUT ANY WARRANTY; without even the implied warranty of
733+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
734+# GNU General Public License for more details.
735+#
736+# You should have received a copy of the GNU Affero General Public License
737+# along with this program. If not, see <http://www.gnu.org/licenses/>.
738+#
739+##############################################################################
740+import select_template
741
742=== added file 'account_invoice_template/wizard/select_template.py'
743--- account_invoice_template/wizard/select_template.py 1970-01-01 00:00:00 +0000
744+++ account_invoice_template/wizard/select_template.py 2011-11-02 10:44:07 +0000
745@@ -0,0 +1,138 @@
746+# -*- coding: utf-8 -*-
747+##############################################################################
748+#
749+# Copyright (C) 2011 Agile Business Group sagl (<http://www.agilebg.com>)
750+# Copyright (C) 2011 Domsense srl (<http://www.domsense.com>)
751+# All Rights Reserved
752+#
753+# This program is free software: you can redistribute it and/or modify
754+# it under the terms of the GNU Affero General Public License as published
755+# by the Free Software Foundation, either version 3 of the License, or
756+# (at your option) any later version.
757+#
758+# This program is distributed in the hope that it will be useful,
759+# but WITHOUT ANY WARRANTY; without even the implied warranty of
760+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
761+# GNU General Public License for more details.
762+#
763+# You should have received a copy of the GNU Affero General Public License
764+# along with this program. If not, see <http://www.gnu.org/licenses/>.
765+#
766+##############################################################################
767+
768+from osv import fields,osv
769+import time
770+from tools.translate import _
771+
772+class wizard_select_template(osv.osv_memory):
773+
774+ _name = "wizard.select.invoice.template"
775+ _columns = {
776+ 'template_id': fields.many2one('account.invoice.template', 'Invoice Template', required=True),
777+ 'line_ids': fields.one2many('wizard.select.invoice.template.line', 'template_id', 'Lines'),
778+ }
779+
780+ def on_change_template_id(self, cr, uid, ids, template_id):
781+ res = {}
782+ if template_id:
783+ res['value'] = {'line_ids': []}
784+ template_pool = self.pool.get('account.invoice.template')
785+ template = template_pool.browse(cr, uid, template_id)
786+ for line in template.template_line_ids:
787+ if line.type == 'input':
788+ res['value']['line_ids'].append({
789+ 'sequence': line.sequence,
790+ 'name': line.name,
791+ 'account_id': line.account_id.id,
792+ })
793+ return res
794+
795+ def check_zero_lines(self, cr, uid, wizard):
796+ for template_line in wizard.line_ids:
797+ if template_line.amount:
798+ return True
799+ return False
800+
801+ def load_template(self, cr, uid, ids, context=None):
802+ template_obj = self.pool.get('account.invoice.template')
803+ template_line_obj = self.pool.get('account.invoice.template.line')
804+ account_period_obj = self.pool.get('account.period')
805+ account_invoice_obj = self.pool.get('account.invoice')
806+ account_invoice_line_obj = self.pool.get('account.invoice.line')
807+ mod_obj = self.pool.get('ir.model.data')
808+ entry = {}
809+
810+ wizard = self.browse(cr, uid, ids, context=context)[0]
811+ if not self.check_zero_lines(cr, uid, wizard):
812+ raise osv.except_osv(_('Error !'), _('At least one amount has to be non-zero!'))
813+ input_lines = {}
814+ for template_line in wizard.line_ids:
815+ input_lines[template_line.sequence] = template_line.amount
816+
817+ computed_lines = template_obj.compute_lines(cr, uid, wizard.template_id.id, input_lines)
818+
819+ inv_values = account_invoice_obj.onchange_partner_id(
820+ cr, uid, ids, wizard.template_id.type, wizard.template_id.partner_id.id)['value']
821+ inv_values['partner_id'] = wizard.template_id.partner_id.id
822+ inv_values['account_id'] = wizard.template_id.account_id.id
823+ inv_values['type'] = wizard.template_id.type
824+
825+ inv_id = account_invoice_obj.create(cr, uid, inv_values)
826+ for line in wizard.template_id.template_line_ids:
827+ analytic_account_id = False
828+ if line.analytic_account_id:
829+ analytic_account_id = line.analytic_account_id.id
830+ invoice_line_tax_id = []
831+ if line.invoice_line_tax_id:
832+ tax_ids=[]
833+ for tax in line.invoice_line_tax_id:
834+ tax_ids.append(tax.id)
835+ invoice_line_tax_id.append((6,0, tax_ids))
836+ val = {
837+ 'name': line.name,
838+ 'invoice_id': inv_id,
839+ 'analytic_account_id': analytic_account_id,
840+ 'account_id': line.account_id.id,
841+ 'invoice_line_tax_id': invoice_line_tax_id,
842+ 'price_unit': computed_lines[line.sequence],
843+ }
844+ id_line = account_invoice_line_obj.create(cr, uid, val)
845+
846+ if type in ('out_invoice', 'out_refund'):
847+ xml_id = 'invoice_form'
848+ else:
849+ xml_id = 'invoice_supplier_form'
850+ resource_id = mod_obj.get_object_reference(cr, uid, 'account', xml_id)[1]
851+
852+ return {
853+ 'domain': "[('id','in', ["+str(inv_id)+"])]",
854+ 'name': 'Invoice',
855+ 'view_type': 'form',
856+ 'view_mode': 'form',
857+ 'res_model': 'account.invoice',
858+ 'views': [(resource_id,'form')],
859+ 'type': 'ir.actions.act_window',
860+ 'target': 'current',
861+ 'res_id': inv_id or False,
862+ }
863+
864+wizard_select_template()
865+
866+class wizard_select_template_line(osv.osv_memory):
867+ _description = 'Template Lines'
868+ _name = "wizard.select.invoice.template.line"
869+ _columns = {
870+ 'template_id': fields.many2one('wizard.select.invoice.template', 'Template'),
871+ 'sequence': fields.integer('Number', required=True),
872+ 'name': fields.char('Name', size=64, required=True, readonly=True),
873+ 'account_id': fields.many2one('account.account', 'Account', required=True, readonly=True),
874+ 'amount': fields.float('Amount', required=True),
875+ 'type': fields.selection([
876+ ('out_invoice','Customer Invoice'),
877+ ('in_invoice','Supplier Invoice'),
878+ ('out_refund','Customer Refund'),
879+ ('in_refund','Supplier Refund'),
880+ ],'Type', required=True , readonly=True),
881+ }
882+
883+wizard_select_template_line()
884
885=== added file 'account_invoice_template/wizard/select_template.xml'
886--- account_invoice_template/wizard/select_template.xml 1970-01-01 00:00:00 +0000
887+++ account_invoice_template/wizard/select_template.xml 2011-11-02 10:44:07 +0000
888@@ -0,0 +1,71 @@
889+<?xml version="1.0" encoding="utf-8"?>
890+<openerp>
891+ <data>
892+
893+ <record id="wizard_select_template" model="ir.ui.view">
894+ <field name="name">Select Invoice Template</field>
895+ <field name="model">wizard.select.invoice.template</field>
896+ <field name="type">form</field>
897+ <field name="arch" type="xml">
898+ <form string="Invoice Template" >
899+ <group col="2">
900+ <field name="template_id" on_change="on_change_template_id(template_id)"/>
901+ <field name="line_ids" colspan="2" nolabel="1" width="600" height="500"/>
902+ <button icon="gtk-cancel" special="cancel" string="Cancel"/>
903+ <button icon="gtk-ok" name="load_template" string="Load" type="object"/>
904+ </group>
905+ </form>
906+ </field>
907+ </record>
908+
909+ <record id="wizard_select_template_line" model="ir.ui.view">
910+ <field name="name">Select Invoice Template Line</field>
911+ <field name="model">wizard.select.invoice.template.line</field>
912+ <field name="type">form</field>
913+ <field name="arch" type="xml">
914+ <form string="Invoice Template Line">
915+ <group col="2">
916+ <field name="sequence" invisible="1"/>
917+ <field name="name" />
918+ <field name="account_id" />
919+ <field name="amount" />
920+ </group>
921+ </form>
922+ </field>
923+ </record>
924+
925+ <record id="wizard_select_template_line_tree" model="ir.ui.view">
926+ <field name="name">Select Invoice Template Line</field>
927+ <field name="model">wizard.select.invoice.template.line</field>
928+ <field name="type">tree</field>
929+ <field name="arch" type="xml">
930+ <tree string="Invoice Template Line" editable="bottom">
931+ <field name="sequence" invisible="1"/>
932+ <field name="name" />
933+ <field name="account_id" />
934+ <field name="amount" />
935+ </tree>
936+ </field>
937+ </record>
938+
939+ <record id="action_wizard_select_template" model="ir.actions.act_window">
940+ <field name="name">Select Invoice Template</field>
941+ <field name="res_model">wizard.select.invoice.template</field>
942+ <field name="view_type">form</field>
943+ <field name="view_mode">form</field>
944+ <field name="view_id" ref="wizard_select_template"/>
945+ <field name="target">new</field>
946+ </record>
947+
948+ <act_window name="Create Invoice from Template"
949+ res_model="wizard.select.invoice.template"
950+ src_model="account.invoice"
951+ view_mode="form"
952+ target="new"
953+ key2="client_action_multi"
954+ id="action_wizard_select_template_by_invoice"
955+ view_id="wizard_select_template"/>
956+
957+ <menuitem name="Create Invoice from Template" action="action_wizard_select_template" id="menu_action_wizard_select_template" sequence="10" parent="account.menu_finance_recurrent_entries"/>
958+ </data>
959+</openerp>

Subscribers

People subscribed via source and target branches

to status/vote changes: