Merge lp:~agilebg/account-invoicing/7.0-add_account_invoice_template into lp:~account-core-editors/account-invoicing/7.0
- 7.0-add_account_invoice_template
- Merge into 7.0
Status: | Merged |
---|---|
Approved by: | Yannick Vaucher @ Camptocamp |
Approved revision: | 26 |
Merged at revision: | 27 |
Proposed branch: | lp:~agilebg/account-invoicing/7.0-add_account_invoice_template |
Merge into: | lp:~account-core-editors/account-invoicing/7.0 |
Diff against target: |
1047 lines (+989/-0) 11 files modified
account_invoice_template/AUTHORS.txt (+3/-0) account_invoice_template/__init__.py (+22/-0) account_invoice_template/__openerp__.py (+54/-0) account_invoice_template/account_invoice_template.py (+114/-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 (+98/-0) account_invoice_template/security/ir.model.access.csv (+5/-0) account_invoice_template/wizard/__init__.py (+21/-0) account_invoice_template/wizard/select_template.py (+165/-0) account_invoice_template/wizard/select_template.xml (+75/-0) |
To merge this branch: | bzr merge lp:~agilebg/account-invoicing/7.0-add_account_invoice_template |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Yannick Vaucher @ Camptocamp | code review, no tests | Approve | |
Joël Grand-Guillaume @ camptocamp | code review, no tests | Approve | |
Davide Corio (community) | Approve | ||
Alex Comba - Agile BG (community) | code review, no test | Approve | |
Leonardo Pistone | code review, no test | Approve | |
Review via email: mp+194733@code.launchpad.net |
Commit message
Description of the change
Leonardo Pistone (lepistone) wrote : | # |
Davide Corio (enlightx-deactivatedaccount) wrote : | # |
flake8 isn't that happy
otherwise the addon works as expected, i've been using it since a while now in production
- 25. By Lorenzo Battistini
-
[IMP] PEP8
Lorenzo Battistini (elbati) wrote : | # |
On 12/11/2013 05:38 PM, Davide Corio wrote:
> Review: Needs Fixing
>
> flake8 isn't that happy
Improved.
Thanks!
Alex Comba - Agile BG (tafaru) : | # |
Davide Corio (enlightx-deactivatedaccount) wrote : | # |
everything looks fine now and still working correctly.
thanks!
Davide Corio (enlightx-deactivatedaccount) wrote : | # |
just noticed that po files are missing for all the languages but italian
Lorenzo Battistini (elbati) wrote : | # |
On 12/12/2013 09:03 AM, Davide Corio wrote:
> Review: Needs Fixing
>
> just noticed that po files are missing for all the languages but italian
Is this required?
Davide Corio (enlightx-deactivatedaccount) wrote : | # |
i saw other MPs being rejected because of this, then i thought it was.
Davide Corio (enlightx-deactivatedaccount) wrote : | # |
as per this:
https:/
it is not. then i step back.
Pedro Manuel Baeza (pedro.baeza) wrote : | # |
Just as comment, what is needed for the approval is the template file (with extension .pot)
Regards.
Davide Corio (enlightx-deactivatedaccount) wrote : | # |
you're right. i was thinking of other projects where untranslated .po files for all the supported languages must be pre-created. this is not our case here.
Joël Grand-Guillaume @ camptocamp (jgrandguillaume-c2c) wrote : | # |
Hi,
Thanks for the contribs, LGTM
Regards,
Yannick Vaucher @ Camptocamp (yvaucher-c2c) wrote : | # |
Thanks for the contrib
Ok 4 approve and I'll do some nitpickings :p
Please remove AUTHORS.txt and write contributors in __openerp__.py as decided by the community
https:/
Otherwise LGTM
I already give an approval but will wait for this change before merging it.
Cheers,
- 26. By Lorenzo Battistini
-
[IMP] Contributors
Lorenzo Battistini (elbati) wrote : | # |
On 01/31/2014 11:28 AM, Yannick Vaucher @ Camptocamp wrote:
> Review: Approve code review, no tests
>
> Thanks for the contrib
>
> Ok 4 approve and I'll do some nitpickings :p
>
> Please remove AUTHORS.txt and write contributors in __openerp__.py as decided by the community
>
> https:/
Done, thanks!
Yannick Vaucher @ Camptocamp (yvaucher-c2c) wrote : | # |
Ok thanks for the change
You forgot to remove the AUTHORS.txt I'll do it while proceeding to the merge
Lorenzo Battistini (elbati) wrote : | # |
On 01/31/2014 02:46 PM, Yannick Vaucher @ Camptocamp wrote:
> Ok thanks for the change
>
> You forgot to remove the AUTHORS.txt I'll do it while proceeding to the merge
oops
Thanks!
Preview Diff
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 2014-01-31 13:32:11 +0000 |
5 | @@ -0,0 +1,3 @@ |
6 | +Lorenzo Battistini <lorenzo.battistini@agilebg.com> |
7 | +Leonardo Pistone <leonardo.pistone@agilebg.com> |
8 | +Franco Tampieri <franco.tampieri@agilebg.com> |
9 | |
10 | === added file 'account_invoice_template/__init__.py' |
11 | --- account_invoice_template/__init__.py 1970-01-01 00:00:00 +0000 |
12 | +++ account_invoice_template/__init__.py 2014-01-31 13:32:11 +0000 |
13 | @@ -0,0 +1,22 @@ |
14 | +# -*- coding: utf-8 -*- |
15 | +############################################################################## |
16 | +# |
17 | +# Copyright (C) 2011 Agile Business Group sagl (<http://www.agilebg.com>) |
18 | +# Copyright (C) 2011 Domsense srl (<http://www.domsense.com>) |
19 | +# |
20 | +# This program is free software: you can redistribute it and/or modify |
21 | +# it under the terms of the GNU Affero General Public License as published |
22 | +# by the Free Software Foundation, either version 3 of the License, or |
23 | +# (at your option) any later version. |
24 | +# |
25 | +# This program is distributed in the hope that it will be useful, |
26 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
27 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
28 | +# GNU Affero General Public License for more details. |
29 | +# |
30 | +# You should have received a copy of the GNU Affero General Public License |
31 | +# along with this program. If not, see <http://www.gnu.org/licenses/>. |
32 | +# |
33 | +############################################################################## |
34 | +import account_invoice_template |
35 | +import wizard |
36 | |
37 | === added file 'account_invoice_template/__openerp__.py' |
38 | --- account_invoice_template/__openerp__.py 1970-01-01 00:00:00 +0000 |
39 | +++ account_invoice_template/__openerp__.py 2014-01-31 13:32:11 +0000 |
40 | @@ -0,0 +1,54 @@ |
41 | +# -*- coding: utf-8 -*- |
42 | +############################################################################## |
43 | +# |
44 | +# Copyright (C) 2011 Agile Business Group sagl (<http://www.agilebg.com>) |
45 | +# Copyright (C) 2011 Domsense srl (<http://www.domsense.com>) |
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 Affero 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 | +Templates for Invoices |
67 | + |
68 | +User can configure invoice templates, useful for recurring invoices. |
69 | +The amount of each template line can be computed (through python code) |
70 | +or kept as user input. If user input, when using the template, user has to fill |
71 | +the amount of every input lines. |
72 | +The invoice form allows lo load, through a wizard, the template to use and the |
73 | +amounts to fill. |
74 | + |
75 | + |
76 | +Contributors |
77 | +------------ |
78 | + |
79 | +Lorenzo Battistini <lorenzo.battistini@agilebg.com> |
80 | +Leonardo Pistone <leonardo.pistone@camptocamp.com> |
81 | +Franco Tampieri <franco@tampieri.info> |
82 | +""", |
83 | + 'author': 'Agile Business Group', |
84 | + 'website': 'http://www.agilebg.com', |
85 | + 'license': 'AGPL-3', |
86 | + "depends": ['account_move_template'], |
87 | + "data": [ |
88 | + 'invoice_template.xml', |
89 | + 'wizard/select_template.xml', |
90 | + 'security/ir.model.access.csv', |
91 | + ], |
92 | + "active": False, |
93 | + "installable": True |
94 | +} |
95 | |
96 | === added file 'account_invoice_template/account_invoice_template.py' |
97 | --- account_invoice_template/account_invoice_template.py 1970-01-01 00:00:00 +0000 |
98 | +++ account_invoice_template/account_invoice_template.py 2014-01-31 13:32:11 +0000 |
99 | @@ -0,0 +1,114 @@ |
100 | +# -*- coding: utf-8 -*- |
101 | +############################################################################## |
102 | +# |
103 | +# Copyright (C) 2011 Agile Business Group sagl (<http://www.agilebg.com>) |
104 | +# Copyright (C) 2011 Domsense srl (<http://www.domsense.com>) |
105 | +# |
106 | +# This program is free software: you can redistribute it and/or modify |
107 | +# it under the terms of the GNU Affero General Public License as published |
108 | +# by the Free Software Foundation, either version 3 of the License, or |
109 | +# (at your option) any later version. |
110 | +# |
111 | +# This program is distributed in the hope that it will be useful, |
112 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
113 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
114 | +# GNU Affero General Public License for more details. |
115 | +# |
116 | +# You should have received a copy of the GNU Affero General Public License |
117 | +# along with this program. If not, see <http://www.gnu.org/licenses/>. |
118 | +# |
119 | +############################################################################## |
120 | + |
121 | +from openerp.osv import fields, orm |
122 | + |
123 | + |
124 | +class account_invoice_template(orm.Model): |
125 | + |
126 | + _inherit = 'account.document.template' |
127 | + _name = 'account.invoice.template' |
128 | + |
129 | + _columns = { |
130 | + 'partner_id': fields.many2one('res.partner', 'Partner', required=True), |
131 | + 'account_id': fields.many2one( |
132 | + 'account.account', 'Account', required=True), |
133 | + 'template_line_ids': fields.one2many( |
134 | + 'account.invoice.template.line', |
135 | + 'template_id', 'Template Lines'), |
136 | + 'type': fields.selection([ |
137 | + ('out_invoice', 'Customer Invoice'), |
138 | + ('in_invoice', 'Supplier Invoice'), |
139 | + ('out_refund', 'Customer Refund'), |
140 | + ('in_refund', 'Supplier Refund'), |
141 | + ], 'Type', required=True), |
142 | + } |
143 | + |
144 | + |
145 | +class account_invoice_template_line(orm.Model): |
146 | + |
147 | + _name = 'account.invoice.template.line' |
148 | + _inherit = 'account.document.template.line' |
149 | + |
150 | + _columns = { |
151 | + 'account_id': fields.many2one( |
152 | + 'account.account', 'Account', |
153 | + required=True, |
154 | + domain=[('type', '<>', 'view'), ('type', '<>', 'closed')]), |
155 | + 'analytic_account_id': fields.many2one( |
156 | + 'account.analytic.account', |
157 | + 'Analytic Account', ondelete="cascade"), |
158 | + 'invoice_line_tax_id': fields.many2many( |
159 | + 'account.tax', |
160 | + 'account_invoice_template_line_tax', 'invoice_line_id', 'tax_id', |
161 | + 'Taxes', domain=[('parent_id', '=', False)]), |
162 | + 'template_id': fields.many2one( |
163 | + 'account.invoice.template', 'Template', |
164 | + ondelete='cascade'), |
165 | + 'product_id': fields.many2one('product.product', 'Product'), |
166 | + } |
167 | + |
168 | + _sql_constraints = [ |
169 | + ('sequence_template_uniq', 'unique (template_id,sequence)', |
170 | + 'The sequence of the line must be unique per template !') |
171 | + ] |
172 | + |
173 | + def product_id_change(self, cr, uid, ids, product_id, type, context=None): |
174 | + if context is None: |
175 | + context = {} |
176 | + |
177 | + result = {} |
178 | + if not product_id: |
179 | + return {} |
180 | + |
181 | + product = self.pool.get('product.product').browse( |
182 | + cr, uid, product_id, |
183 | + context=context) |
184 | + |
185 | + # name |
186 | + result.update({'name': product.name}) |
187 | + |
188 | + # account |
189 | + account_id = False |
190 | + if type in ('out_invoice', 'out_refund'): |
191 | + account_id = product.product_tmpl_id.property_account_income.id |
192 | + if not account_id: |
193 | + account_id = product.categ_id.property_account_income_categ.id |
194 | + else: |
195 | + account_id = product.product_tmpl_id.property_account_expense.id |
196 | + if not account_id: |
197 | + account_id = product.categ_id.property_account_expense_categ.id |
198 | + |
199 | + if account_id: |
200 | + result['account_id'] = account_id |
201 | + |
202 | + # taxes |
203 | + account_obj = self.pool.get('account.account') |
204 | + taxes = account_id and account_obj.browse( |
205 | + cr, uid, account_id, context=context).tax_ids or False |
206 | + if type in ('out_invoice', 'out_refund') and product.taxes_id: |
207 | + taxes = product.taxes_id |
208 | + elif product.supplier_taxes_id: |
209 | + taxes = product.supplier_taxes_id |
210 | + tax_ids = taxes and [tax.id for tax in taxes] or False |
211 | + result.update({'invoice_line_tax_id': tax_ids}) |
212 | + |
213 | + return {'value': result} |
214 | |
215 | === added directory 'account_invoice_template/i18n' |
216 | === added file 'account_invoice_template/i18n/account_invoice_template.pot' |
217 | --- account_invoice_template/i18n/account_invoice_template.pot 1970-01-01 00:00:00 +0000 |
218 | +++ account_invoice_template/i18n/account_invoice_template.pot 2014-01-31 13:32:11 +0000 |
219 | @@ -0,0 +1,204 @@ |
220 | +# Translation of OpenERP Server. |
221 | +# This file contains the translation of the following modules: |
222 | +# * account_invoice_template |
223 | +# |
224 | +msgid "" |
225 | +msgstr "" |
226 | +"Project-Id-Version: OpenERP Server 6.0.3\n" |
227 | +"Report-Msgid-Bugs-To: support@openerp.com\n" |
228 | +"POT-Creation-Date: 2011-10-31 16:49+0000\n" |
229 | +"PO-Revision-Date: 2011-10-31 16:49+0000\n" |
230 | +"Last-Translator: <>\n" |
231 | +"Language-Team: \n" |
232 | +"MIME-Version: 1.0\n" |
233 | +"Content-Type: text/plain; charset=UTF-8\n" |
234 | +"Content-Transfer-Encoding: \n" |
235 | +"Plural-Forms: \n" |
236 | + |
237 | +#. module: account_invoice_template |
238 | +#: selection:account.invoice.template,type:0 |
239 | +#: selection:wizard.select.invoice.template.line,type:0 |
240 | +msgid "Customer Refund" |
241 | +msgstr "" |
242 | + |
243 | +#. module: account_invoice_template |
244 | +#: model:ir.actions.act_window,name:account_invoice_template.action_wizard_select_template_by_invoice |
245 | +#: model:ir.ui.menu,name:account_invoice_template.menu_action_wizard_select_template |
246 | +msgid "Create Invoice from Template" |
247 | +msgstr "" |
248 | + |
249 | +#. module: account_invoice_template |
250 | +#: selection:account.invoice.template,type:0 |
251 | +#: selection:wizard.select.invoice.template.line,type:0 |
252 | +msgid "Customer Invoice" |
253 | +msgstr "" |
254 | + |
255 | +#. module: account_invoice_template |
256 | +#: model:ir.model,name:account_invoice_template.model_account_invoice_template_line |
257 | +msgid "account.invoice.template.line" |
258 | +msgstr "" |
259 | + |
260 | +#. module: account_invoice_template |
261 | +#: field:account.invoice.template.line,sequence:0 |
262 | +#: field:wizard.select.invoice.template.line,sequence:0 |
263 | +msgid "Number" |
264 | +msgstr "" |
265 | + |
266 | +#. module: account_invoice_template |
267 | +#: selection:account.invoice.template,type:0 |
268 | +#: selection:wizard.select.invoice.template.line,type:0 |
269 | +msgid "Supplier Invoice" |
270 | +msgstr "" |
271 | + |
272 | +#. module: account_invoice_template |
273 | +#: field:account.invoice.template.line,template_id:0 |
274 | +#: field:wizard.select.invoice.template.line,template_id:0 |
275 | +msgid "Template" |
276 | +msgstr "" |
277 | + |
278 | +#. module: account_invoice_template |
279 | +#: field:account.invoice.template,type:0 |
280 | +#: field:account.invoice.template.line,type:0 |
281 | +#: field:wizard.select.invoice.template.line,type:0 |
282 | +msgid "Type" |
283 | +msgstr "" |
284 | + |
285 | +#. module: account_invoice_template |
286 | +#: model:ir.model,name:account_invoice_template.model_account_invoice_template |
287 | +msgid "account.invoice.template" |
288 | +msgstr "" |
289 | + |
290 | +#. module: account_invoice_template |
291 | +#: model:ir.model,name:account_invoice_template.model_wizard_select_invoice_template |
292 | +msgid "wizard.select.invoice.template" |
293 | +msgstr "" |
294 | + |
295 | +#. module: account_invoice_template |
296 | +#: code:addons/account_invoice_template/wizard/select_template.py:66 |
297 | +#, python-format |
298 | +msgid "Error !" |
299 | +msgstr "" |
300 | + |
301 | +#. module: account_invoice_template |
302 | +#: selection:account.invoice.template.line,type:0 |
303 | +msgid "User input" |
304 | +msgstr "" |
305 | + |
306 | +#. module: account_invoice_template |
307 | +#: view:account.invoice.template.line:0 |
308 | +#: view:wizard.select.invoice.template.line:0 |
309 | +msgid "Invoice Template Line" |
310 | +msgstr "" |
311 | + |
312 | +#. module: account_invoice_template |
313 | +#: field:account.invoice.template,account_id:0 |
314 | +#: field:account.invoice.template.line,account_id:0 |
315 | +#: field:wizard.select.invoice.template.line,account_id:0 |
316 | +msgid "Account" |
317 | +msgstr "" |
318 | + |
319 | +#. module: account_invoice_template |
320 | +#: field:account.invoice.template,name:0 |
321 | +#: field:account.invoice.template.line,name:0 |
322 | +#: field:wizard.select.invoice.template.line,name:0 |
323 | +msgid "Name" |
324 | +msgstr "" |
325 | + |
326 | +#. module: account_invoice_template |
327 | +#: field:wizard.select.invoice.template,line_ids:0 |
328 | +msgid "Lines" |
329 | +msgstr "" |
330 | + |
331 | +#. module: account_invoice_template |
332 | +#: field:account.invoice.template.line,invoice_line_tax_id:0 |
333 | +msgid "Taxes" |
334 | +msgstr "" |
335 | + |
336 | +#. module: account_invoice_template |
337 | +#: code:addons/account_invoice_template/wizard/select_template.py:66 |
338 | +#, python-format |
339 | +msgid "At least one amount has to be non-zero!" |
340 | +msgstr "" |
341 | + |
342 | +#. module: account_invoice_template |
343 | +#: field:wizard.select.invoice.template.line,amount:0 |
344 | +msgid "Amount" |
345 | +msgstr "" |
346 | + |
347 | +#. module: account_invoice_template |
348 | +#: view:account.invoice.template:0 |
349 | +#: view:wizard.select.invoice.template:0 |
350 | +#: field:wizard.select.invoice.template,template_id:0 |
351 | +msgid "Invoice Template" |
352 | +msgstr "" |
353 | + |
354 | +#. module: account_invoice_template |
355 | +#: selection:account.invoice.template,type:0 |
356 | +#: selection:wizard.select.invoice.template.line,type:0 |
357 | +msgid "Supplier Refund" |
358 | +msgstr "" |
359 | + |
360 | +#. module: account_invoice_template |
361 | +#: model:ir.actions.act_window,name:account_invoice_template.action_wizard_select_template |
362 | +msgid "Select Invoice Template" |
363 | +msgstr "" |
364 | + |
365 | +#. module: account_invoice_template |
366 | +#: sql_constraint:account.invoice.template.line:0 |
367 | +msgid "The sequence of the line must be unique per template !" |
368 | +msgstr "" |
369 | + |
370 | +#. module: account_invoice_template |
371 | +#: view:wizard.select.invoice.template:0 |
372 | +msgid "Load" |
373 | +msgstr "" |
374 | + |
375 | +#. module: account_invoice_template |
376 | +#: view:account.invoice.template.line:0 |
377 | +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'" |
378 | +msgstr "" |
379 | + |
380 | +#. module: account_invoice_template |
381 | +#: selection:account.invoice.template.line,type:0 |
382 | +msgid "Computed" |
383 | +msgstr "" |
384 | + |
385 | +#. module: account_invoice_template |
386 | +#: view:account.invoice.template:0 |
387 | +msgid "Group By..." |
388 | +msgstr "" |
389 | + |
390 | +#. module: account_invoice_template |
391 | +#: view:account.invoice.template.line:0 |
392 | +#: field:account.invoice.template.line,python_code:0 |
393 | +msgid "Python Code" |
394 | +msgstr "" |
395 | + |
396 | +#. module: account_invoice_template |
397 | +#: model:ir.actions.act_window,name:account_invoice_template.action_invoice_template_form |
398 | +#: model:ir.ui.menu,name:account_invoice_template.menu_action_invoice_template_form |
399 | +msgid "Invoice Templates" |
400 | +msgstr "" |
401 | + |
402 | +#. module: account_invoice_template |
403 | +#: field:account.invoice.template.line,analytic_account_id:0 |
404 | +msgid "Analytic Account" |
405 | +msgstr "" |
406 | + |
407 | +#. module: account_invoice_template |
408 | +#: field:account.invoice.template,template_line_ids:0 |
409 | +#: model:ir.model,name:account_invoice_template.model_wizard_select_invoice_template_line |
410 | +msgid "Template Lines" |
411 | +msgstr "" |
412 | + |
413 | +#. module: account_invoice_template |
414 | +#: view:wizard.select.invoice.template:0 |
415 | +msgid "Cancel" |
416 | +msgstr "" |
417 | + |
418 | +#. module: account_invoice_template |
419 | +#: view:account.invoice.template:0 |
420 | +#: field:account.invoice.template,partner_id:0 |
421 | +msgid "Partner" |
422 | +msgstr "" |
423 | + |
424 | |
425 | === added file 'account_invoice_template/i18n/it.po' |
426 | --- account_invoice_template/i18n/it.po 1970-01-01 00:00:00 +0000 |
427 | +++ account_invoice_template/i18n/it.po 2014-01-31 13:32:11 +0000 |
428 | @@ -0,0 +1,228 @@ |
429 | +# Translation of OpenERP Server. |
430 | +# This file contains the translation of the following modules: |
431 | +# * account_invoice_template |
432 | +# |
433 | +msgid "" |
434 | +msgstr "" |
435 | +"Project-Id-Version: OpenERP Server 6.0.3\n" |
436 | +"Report-Msgid-Bugs-To: support@openerp.com\n" |
437 | +"POT-Creation-Date: 2011-11-02 10:30+0000\n" |
438 | +"PO-Revision-Date: 2011-11-02 11:35+0100\n" |
439 | +"Last-Translator: Lorenzo Battistini <lorenzo.battistini@agilebg.com>\n" |
440 | +"Language-Team: \n" |
441 | +"MIME-Version: 1.0\n" |
442 | +"Content-Type: text/plain; charset=UTF-8\n" |
443 | +"Content-Transfer-Encoding: 8bit\n" |
444 | +"Plural-Forms: \n" |
445 | + |
446 | +#. module: account_invoice_template |
447 | +#: view:account.invoice.template.line:0 |
448 | +#: view:wizard.select.invoice.template.line:0 |
449 | +msgid "Invoice Template Line" |
450 | +msgstr "Riga template fattura" |
451 | + |
452 | +#. module: account_invoice_template |
453 | +#: selection:account.invoice.template,type:0 |
454 | +#: selection:wizard.select.invoice.template.line,type:0 |
455 | +msgid "Customer Refund" |
456 | +msgstr "Nota di credito" |
457 | + |
458 | +#. module: account_invoice_template |
459 | +#: model:ir.actions.act_window,name:account_invoice_template.action_wizard_select_template_by_invoice |
460 | +#: model:ir.ui.menu,name:account_invoice_template.menu_action_wizard_select_template |
461 | +msgid "Create Invoice from Template" |
462 | +msgstr "Crea fattura da template" |
463 | + |
464 | +#. module: account_invoice_template |
465 | +#: selection:account.invoice.template,type:0 |
466 | +#: selection:wizard.select.invoice.template.line,type:0 |
467 | +msgid "Customer Invoice" |
468 | +msgstr "Fattura cliente" |
469 | + |
470 | +#. module: account_invoice_template |
471 | +#: model:ir.model,name:account_invoice_template.model_account_invoice_template_line |
472 | +msgid "account.invoice.template.line" |
473 | +msgstr "account.invoice.template.line" |
474 | + |
475 | +#. module: account_invoice_template |
476 | +#: field:account.invoice.template.line,sequence:0 |
477 | +#: field:wizard.select.invoice.template.line,sequence:0 |
478 | +msgid "Number" |
479 | +msgstr "Numero" |
480 | + |
481 | +#. module: account_invoice_template |
482 | +#: view:account.invoice.template:0 |
483 | +msgid "Group By..." |
484 | +msgstr "Raggruppa per..." |
485 | + |
486 | +#. module: account_invoice_template |
487 | +#: field:account.invoice.template.line,template_id:0 |
488 | +#: field:wizard.select.invoice.template.line,template_id:0 |
489 | +msgid "Template" |
490 | +msgstr "Template" |
491 | + |
492 | +#. module: account_invoice_template |
493 | +#: field:account.invoice.template,type:0 |
494 | +#: field:account.invoice.template.line,type:0 |
495 | +#: field:wizard.select.invoice.template.line,type:0 |
496 | +msgid "Type" |
497 | +msgstr "Tipo" |
498 | + |
499 | +#. module: account_invoice_template |
500 | +#: model:ir.model,name:account_invoice_template.model_account_invoice_template |
501 | +msgid "account.invoice.template" |
502 | +msgstr "account.invoice.template" |
503 | + |
504 | +#. module: account_invoice_template |
505 | +#: model:ir.model,name:account_invoice_template.model_wizard_select_invoice_template |
506 | +msgid "wizard.select.invoice.template" |
507 | +msgstr "wizard.select.invoice.template" |
508 | + |
509 | +#. module: account_invoice_template |
510 | +#: code:addons/account_invoice_template/wizard/select_template.py:67 |
511 | +#, python-format |
512 | +msgid "Error !" |
513 | +msgstr "Errore !" |
514 | + |
515 | +#. module: account_invoice_template |
516 | +#: selection:account.invoice.template.line,type:0 |
517 | +msgid "User input" |
518 | +msgstr "Input utente" |
519 | + |
520 | +#. module: account_invoice_template |
521 | +#: model:ir.module.module,description:account_invoice_template.module_meta_information |
522 | +msgid "" |
523 | +"\n" |
524 | +"======================\n" |
525 | +"Templates for Invoices\n" |
526 | +"======================\n" |
527 | +"User can configure invoice templates, useful for recurring invoices.\n" |
528 | +"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" |
529 | +"The invoice form allows lo load, through a wizard, the template to use and the amounts to fill.\n" |
530 | +msgstr "" |
531 | +"\n" |
532 | +"======================\n" |
533 | +"Templates for Invoices\n" |
534 | +"======================\n" |
535 | +"User can configure invoice templates, useful for recurring invoices.\n" |
536 | +"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" |
537 | +"The invoice form allows lo load, through a wizard, the template to use and the amounts to fill.\n" |
538 | + |
539 | +#. module: account_invoice_template |
540 | +#: field:account.invoice.template,account_id:0 |
541 | +#: field:account.invoice.template.line,account_id:0 |
542 | +#: field:wizard.select.invoice.template.line,account_id:0 |
543 | +msgid "Account" |
544 | +msgstr "Conto" |
545 | + |
546 | +#. module: account_invoice_template |
547 | +#: field:account.invoice.template,name:0 |
548 | +#: field:account.invoice.template.line,name:0 |
549 | +#: field:wizard.select.invoice.template.line,name:0 |
550 | +msgid "Name" |
551 | +msgstr "Nome" |
552 | + |
553 | +#. module: account_invoice_template |
554 | +#: field:wizard.select.invoice.template,line_ids:0 |
555 | +msgid "Lines" |
556 | +msgstr "Righe" |
557 | + |
558 | +#. module: account_invoice_template |
559 | +#: field:account.invoice.template.line,invoice_line_tax_id:0 |
560 | +msgid "Taxes" |
561 | +msgstr "Imposte" |
562 | + |
563 | +#. module: account_invoice_template |
564 | +#: code:addons/account_invoice_template/wizard/select_template.py:67 |
565 | +#, python-format |
566 | +msgid "At least one amount has to be non-zero!" |
567 | +msgstr "Almeno un importo deve essere diverso da zero!" |
568 | + |
569 | +#. module: account_invoice_template |
570 | +#: field:wizard.select.invoice.template.line,amount:0 |
571 | +msgid "Amount" |
572 | +msgstr "Importo" |
573 | + |
574 | +#. module: account_invoice_template |
575 | +#: view:account.invoice.template:0 |
576 | +#: view:wizard.select.invoice.template:0 |
577 | +#: field:wizard.select.invoice.template,template_id:0 |
578 | +msgid "Invoice Template" |
579 | +msgstr "Template fattura" |
580 | + |
581 | +#. module: account_invoice_template |
582 | +#: selection:account.invoice.template,type:0 |
583 | +#: selection:wizard.select.invoice.template.line,type:0 |
584 | +msgid "Supplier Refund" |
585 | +msgstr "Reso a fornitore" |
586 | + |
587 | +#. module: account_invoice_template |
588 | +#: model:ir.actions.act_window,name:account_invoice_template.action_wizard_select_template |
589 | +msgid "Select Invoice Template" |
590 | +msgstr "Scegli template fattura" |
591 | + |
592 | +#. module: account_invoice_template |
593 | +#: sql_constraint:account.invoice.template.line:0 |
594 | +msgid "The sequence of the line must be unique per template !" |
595 | +msgstr "Il numero della riga deve essere unico per template!" |
596 | + |
597 | +#. module: account_invoice_template |
598 | +#: model:ir.module.module,shortdesc:account_invoice_template.module_meta_information |
599 | +msgid "Account Invoice Template" |
600 | +msgstr "Account Invoice Template" |
601 | + |
602 | +#. module: account_invoice_template |
603 | +#: view:wizard.select.invoice.template:0 |
604 | +msgid "Load" |
605 | +msgstr "Carica" |
606 | + |
607 | +#. module: account_invoice_template |
608 | +#: view:account.invoice.template.line:0 |
609 | +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'" |
610 | +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'" |
611 | + |
612 | +#. module: account_invoice_template |
613 | +#: selection:account.invoice.template.line,type:0 |
614 | +msgid "Computed" |
615 | +msgstr "Calcolato" |
616 | + |
617 | +#. module: account_invoice_template |
618 | +#: selection:account.invoice.template,type:0 |
619 | +#: selection:wizard.select.invoice.template.line,type:0 |
620 | +msgid "Supplier Invoice" |
621 | +msgstr "Fattura fornitore" |
622 | + |
623 | +#. module: account_invoice_template |
624 | +#: view:account.invoice.template.line:0 |
625 | +#: field:account.invoice.template.line,python_code:0 |
626 | +msgid "Python Code" |
627 | +msgstr "Codice python" |
628 | + |
629 | +#. module: account_invoice_template |
630 | +#: model:ir.actions.act_window,name:account_invoice_template.action_invoice_template_form |
631 | +#: model:ir.ui.menu,name:account_invoice_template.menu_action_invoice_template_form |
632 | +msgid "Invoice Templates" |
633 | +msgstr "Template fatture" |
634 | + |
635 | +#. module: account_invoice_template |
636 | +#: field:account.invoice.template.line,analytic_account_id:0 |
637 | +msgid "Analytic Account" |
638 | +msgstr "Conto analitico" |
639 | + |
640 | +#. module: account_invoice_template |
641 | +#: field:account.invoice.template,template_line_ids:0 |
642 | +#: model:ir.model,name:account_invoice_template.model_wizard_select_invoice_template_line |
643 | +msgid "Template Lines" |
644 | +msgstr "Righe template" |
645 | + |
646 | +#. module: account_invoice_template |
647 | +#: view:wizard.select.invoice.template:0 |
648 | +msgid "Cancel" |
649 | +msgstr "Annulla" |
650 | + |
651 | +#. module: account_invoice_template |
652 | +#: view:account.invoice.template:0 |
653 | +#: field:account.invoice.template,partner_id:0 |
654 | +msgid "Partner" |
655 | +msgstr "Partner" |
656 | + |
657 | |
658 | === added file 'account_invoice_template/invoice_template.xml' |
659 | --- account_invoice_template/invoice_template.xml 1970-01-01 00:00:00 +0000 |
660 | +++ account_invoice_template/invoice_template.xml 2014-01-31 13:32:11 +0000 |
661 | @@ -0,0 +1,98 @@ |
662 | +<?xml version="1.0" encoding="utf-8"?> |
663 | +<openerp> |
664 | + <data> |
665 | + |
666 | + <record id="view_invoice_template_line_tree" model="ir.ui.view"> |
667 | + <field name="name">account.invoice.template.line.tree</field> |
668 | + <field name="model">account.invoice.template.line</field> |
669 | + <field name="arch" type="xml"> |
670 | + <tree string="Invoice Template Line"> |
671 | + <field name="product_id"/> |
672 | + <field name="sequence"/> |
673 | + <field name="name"/> |
674 | + <field name="account_id" /> |
675 | + <field name="analytic_account_id" groups="analytic.group_analytic_accounting"/> |
676 | + <field name="type"/> |
677 | + <field name="python_code"/> |
678 | + </tree> |
679 | + </field> |
680 | + </record> |
681 | + |
682 | + |
683 | + <record id="view_invoice_template_line_form" model="ir.ui.view"> |
684 | + <field name="name">account.invoice.template.line.form</field> |
685 | + <field name="model">account.invoice.template.line</field> |
686 | + <field name="arch" type="xml"> |
687 | + <form string="Invoice Template Line"> |
688 | + <field name="product_id" on_change="product_id_change(product_id, parent.type)"/> |
689 | + <field name="name" select="1"/> |
690 | + <field name="sequence"/> |
691 | + <field name="account_id" /> |
692 | + <field name="analytic_account_id" groups="analytic.group_analytic_accounting"/> |
693 | + <field name="type"/> |
694 | + <separator string="Python Code" colspan="4"/> |
695 | + <field name="python_code" colspan="4" attrs="{'readonly': [('type', '!=', 'computed')]}" nolabel="1"/> |
696 | + <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"/> |
697 | + <field name="invoice_line_tax_id" colspan="4" nolabel="1"/> |
698 | + </form> |
699 | + </field> |
700 | + </record> |
701 | + |
702 | + <record id="view_invoice_template_form" model="ir.ui.view"> |
703 | + <field name="name">account.invoice.template.form</field> |
704 | + <field name="model">account.invoice.template</field> |
705 | + <field name="arch" type="xml"> |
706 | + <form string="Invoice Template"> |
707 | + <field name="name"/> |
708 | + <field name="partner_id"/> |
709 | + <field name="account_id" /> |
710 | + <field name="type" /> |
711 | + <field colspan="4" nolabel="1" name="template_line_ids"/> |
712 | + </form> |
713 | + </field> |
714 | + </record> |
715 | + |
716 | + <record id="view_invoice_template_tree" model="ir.ui.view"> |
717 | + <field name="name">account.invoice.template.tree</field> |
718 | + <field name="model">account.invoice.template</field> |
719 | + <field name="arch" type="xml"> |
720 | + <tree string="Invoice Template"> |
721 | + <field name="name"/> |
722 | + <field name="partner_id"/> |
723 | + <field name="account_id" /> |
724 | + <field name="type" /> |
725 | + </tree> |
726 | + </field> |
727 | + </record> |
728 | + |
729 | + <record id="view_invoice_template_search" model="ir.ui.view"> |
730 | + <field name="name">account.invoice.template.search</field> |
731 | + <field name="model">account.invoice.template</field> |
732 | + <field name="arch" type="xml"> |
733 | + <search string="Invoice Template"> |
734 | + <group> |
735 | + <field name="name"/> |
736 | + <field name="partner_id" /> |
737 | + <field name="account_id" /> |
738 | + <field name="type" /> |
739 | + </group> |
740 | + <newline/> |
741 | + <group expand="0" string="Group By..."> |
742 | + <filter string="Partner" icon="terp-folder-orange" domain="[]" context="{'group_by':'partner_id'}"/> |
743 | + </group> |
744 | + </search> |
745 | + </field> |
746 | + </record> |
747 | + |
748 | + <record id="action_invoice_template_form" model="ir.actions.act_window"> |
749 | + <field name="name">Invoice Templates</field> |
750 | + <field name="res_model">account.invoice.template</field> |
751 | + <field name="view_type">form</field> |
752 | + <field name="view_mode">tree,form</field> |
753 | + <field name="search_view_id" ref="view_invoice_template_search"/> |
754 | + </record> |
755 | + <menuitem |
756 | + action="action_invoice_template_form" id="menu_action_invoice_template_form" sequence="5" |
757 | + parent="account.menu_configuration_misc" groups="account.group_account_manager"/> |
758 | + </data> |
759 | +</openerp> |
760 | |
761 | === added directory 'account_invoice_template/security' |
762 | === added file 'account_invoice_template/security/ir.model.access.csv' |
763 | --- account_invoice_template/security/ir.model.access.csv 1970-01-01 00:00:00 +0000 |
764 | +++ account_invoice_template/security/ir.model.access.csv 2014-01-31 13:32:11 +0000 |
765 | @@ -0,0 +1,5 @@ |
766 | +"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink" |
767 | +"access_account_invoice_template_user","account_invoice_template_user","model_account_invoice_template","account.group_account_user","1","1","1","1" |
768 | +"access_account_invoice_template_manager","account_invoice_template_manager","model_account_invoice_template","account.group_account_manager","1","1","1","1" |
769 | +"access_account_invoice_template_line_user","account_invoice_template_line_user","model_account_invoice_template_line","account.group_account_user","1","1","1","1" |
770 | +"access_account_invoice_template_line_manager","account_invoice_template_line_manager","model_account_invoice_template_line","account.group_account_manager","1","1","1","1" |
771 | |
772 | === added directory 'account_invoice_template/wizard' |
773 | === added file 'account_invoice_template/wizard/__init__.py' |
774 | --- account_invoice_template/wizard/__init__.py 1970-01-01 00:00:00 +0000 |
775 | +++ account_invoice_template/wizard/__init__.py 2014-01-31 13:32:11 +0000 |
776 | @@ -0,0 +1,21 @@ |
777 | +# -*- coding: utf-8 -*- |
778 | +############################################################################## |
779 | +# |
780 | +# Copyright (C) 2011 Agile Business Group sagl (<http://www.agilebg.com>) |
781 | +# Copyright (C) 2011 Domsense srl (<http://www.domsense.com>) |
782 | +# |
783 | +# This program is free software: you can redistribute it and/or modify |
784 | +# it under the terms of the GNU Affero General Public License as published |
785 | +# by the Free Software Foundation, either version 3 of the License, or |
786 | +# (at your option) any later version. |
787 | +# |
788 | +# This program is distributed in the hope that it will be useful, |
789 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
790 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
791 | +# GNU Affero General Public License for more details. |
792 | +# |
793 | +# You should have received a copy of the GNU Affero General Public License |
794 | +# along with this program. If not, see <http://www.gnu.org/licenses/>. |
795 | +# |
796 | +############################################################################## |
797 | +import select_template |
798 | |
799 | === added file 'account_invoice_template/wizard/select_template.py' |
800 | --- account_invoice_template/wizard/select_template.py 1970-01-01 00:00:00 +0000 |
801 | +++ account_invoice_template/wizard/select_template.py 2014-01-31 13:32:11 +0000 |
802 | @@ -0,0 +1,165 @@ |
803 | +# -*- coding: utf-8 -*- |
804 | +############################################################################## |
805 | +# |
806 | +# Copyright (C) 2011 Agile Business Group sagl (<http://www.agilebg.com>) |
807 | +# Copyright (C) 2011 Domsense srl (<http://www.domsense.com>) |
808 | +# |
809 | +# This program is free software: you can redistribute it and/or modify |
810 | +# it under the terms of the GNU Affero General Public License as published |
811 | +# by the Free Software Foundation, either version 3 of the License, or |
812 | +# (at your option) any later version. |
813 | +# |
814 | +# This program is distributed in the hope that it will be useful, |
815 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
816 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
817 | +# GNU Affero General Public License for more details. |
818 | +# |
819 | +# You should have received a copy of the GNU Affero General Public License |
820 | +# along with this program. If not, see <http://www.gnu.org/licenses/>. |
821 | +# |
822 | +############################################################################## |
823 | + |
824 | +from openerp.osv import fields, orm |
825 | +from openerp.tools.translate import _ |
826 | + |
827 | + |
828 | +class wizard_select_template(orm.TransientModel): |
829 | + |
830 | + _name = "wizard.select.invoice.template" |
831 | + _columns = { |
832 | + 'template_id': fields.many2one( |
833 | + 'account.invoice.template', |
834 | + 'Invoice Template', required=True), |
835 | + 'line_ids': fields.one2many( |
836 | + 'wizard.select.invoice.template.line', |
837 | + 'template_id', 'Lines'), |
838 | + 'state': fields.selection([ |
839 | + ('template_selected', 'Template selected'), |
840 | + ], 'State'), |
841 | + } |
842 | + |
843 | + def load_lines(self, cr, uid, ids, context=None): |
844 | + wizard = self.browse(cr, uid, ids, context=context)[0] |
845 | + template_pool = self.pool.get('account.invoice.template') |
846 | + wizard_line_pool = self.pool.get('wizard.select.invoice.template.line') |
847 | + model_data_obj = self.pool.get('ir.model.data') |
848 | + |
849 | + template = template_pool.browse( |
850 | + cr, uid, wizard.template_id.id, |
851 | + context=context) |
852 | + for line in template.template_line_ids: |
853 | + if line.type == 'input': |
854 | + wizard_line_pool.create(cr, uid, { |
855 | + 'template_id': wizard.id, |
856 | + 'sequence': line.sequence, |
857 | + 'name': line.name, |
858 | + 'amount': ( |
859 | + line.product_id and line.product_id.list_price or 0.0), |
860 | + 'account_id': line.account_id.id, |
861 | + 'product_id': line.product_id.id, |
862 | + }, context=context) |
863 | + if not wizard.line_ids: |
864 | + return self.load_template(cr, uid, ids, context=context) |
865 | + wizard.write({'state': 'template_selected'}, context=context) |
866 | + |
867 | + view_rec = model_data_obj.get_object_reference( |
868 | + cr, uid, |
869 | + 'account_invoice_template', 'wizard_select_template') |
870 | + view_id = view_rec and view_rec[1] or False |
871 | + |
872 | + return { |
873 | + 'view_type': 'form', |
874 | + 'view_id': [view_id], |
875 | + 'view_mode': 'form', |
876 | + 'res_model': 'wizard.select.invoice.template', |
877 | + 'res_id': wizard.id, |
878 | + 'type': 'ir.actions.act_window', |
879 | + 'target': 'new', |
880 | + 'context': context, |
881 | + } |
882 | + |
883 | + def load_template(self, cr, uid, ids, context=None): |
884 | + if context is None: |
885 | + context = {} |
886 | + template_obj = self.pool.get('account.invoice.template') |
887 | + account_invoice_obj = self.pool.get('account.invoice') |
888 | + account_invoice_line_obj = self.pool.get('account.invoice.line') |
889 | + mod_obj = self.pool.get('ir.model.data') |
890 | + |
891 | + wizard = self.browse(cr, uid, ids, context=context)[0] |
892 | + if not template_obj.check_zero_lines(cr, uid, wizard): |
893 | + raise orm.except_orm( |
894 | + _('Error !'), |
895 | + _('At least one amount has to be non-zero!')) |
896 | + input_lines = {} |
897 | + for template_line in wizard.line_ids: |
898 | + input_lines[template_line.sequence] = template_line.amount |
899 | + |
900 | + computed_lines = template_obj.compute_lines( |
901 | + cr, uid, |
902 | + wizard.template_id.id, input_lines) |
903 | + |
904 | + inv_values = account_invoice_obj.onchange_partner_id( |
905 | + cr, uid, ids, wizard.template_id.type, |
906 | + wizard.template_id.partner_id.id)['value'] |
907 | + inv_values['partner_id'] = wizard.template_id.partner_id.id |
908 | + inv_values['account_id'] = wizard.template_id.account_id.id |
909 | + inv_values['type'] = wizard.template_id.type |
910 | + context['type'] = wizard.template_id.type |
911 | + inv_id = account_invoice_obj.create( |
912 | + cr, uid, inv_values, context=context) |
913 | + for line in wizard.template_id.template_line_ids: |
914 | + analytic_account_id = False |
915 | + if line.analytic_account_id: |
916 | + analytic_account_id = line.analytic_account_id.id |
917 | + invoice_line_tax_id = [] |
918 | + if line.invoice_line_tax_id: |
919 | + tax_ids = [] |
920 | + for tax in line.invoice_line_tax_id: |
921 | + tax_ids.append(tax.id) |
922 | + invoice_line_tax_id.append((6, 0, tax_ids)) |
923 | + val = { |
924 | + 'name': line.name, |
925 | + 'invoice_id': inv_id, |
926 | + 'account_analytic_id': analytic_account_id, |
927 | + 'account_id': line.account_id.id, |
928 | + 'invoice_line_tax_id': invoice_line_tax_id, |
929 | + 'price_unit': computed_lines[line.sequence], |
930 | + 'product_id': line.product_id.id, |
931 | + } |
932 | + account_invoice_line_obj.create(cr, uid, val, context=context) |
933 | + |
934 | + if wizard.template_id.type in ('out_invoice', 'out_refund'): |
935 | + xml_id = 'invoice_form' |
936 | + else: |
937 | + xml_id = 'invoice_supplier_form' |
938 | + resource_id = mod_obj.get_object_reference( |
939 | + cr, uid, 'account', xml_id)[1] |
940 | + |
941 | + return { |
942 | + 'domain': "[('id','in', [" + str(inv_id) + "])]", |
943 | + 'name': 'Invoice', |
944 | + 'view_type': 'form', |
945 | + 'view_mode': 'form', |
946 | + 'res_model': 'account.invoice', |
947 | + 'views': [(resource_id, 'form')], |
948 | + 'type': 'ir.actions.act_window', |
949 | + 'target': 'current', |
950 | + 'res_id': inv_id or False, |
951 | + } |
952 | + |
953 | + |
954 | +class wizard_select_template_line(orm.TransientModel): |
955 | + _description = 'Template Lines' |
956 | + _name = "wizard.select.invoice.template.line" |
957 | + _columns = { |
958 | + 'template_id': fields.many2one( |
959 | + 'wizard.select.invoice.template', 'Template'), |
960 | + 'sequence': fields.integer('Number', required=True), |
961 | + 'name': fields.char('Name', size=64, required=True, readonly=True), |
962 | + 'account_id': fields.many2one( |
963 | + 'account.account', 'Account', |
964 | + required=True, readonly=True), |
965 | + 'amount': fields.float('Amount', required=True), |
966 | + 'product_id': fields.many2one('product.product', 'Product'), |
967 | + } |
968 | |
969 | === added file 'account_invoice_template/wizard/select_template.xml' |
970 | --- account_invoice_template/wizard/select_template.xml 1970-01-01 00:00:00 +0000 |
971 | +++ account_invoice_template/wizard/select_template.xml 2014-01-31 13:32:11 +0000 |
972 | @@ -0,0 +1,75 @@ |
973 | +<?xml version="1.0" encoding="utf-8"?> |
974 | +<openerp> |
975 | + <data> |
976 | + |
977 | + <record id="wizard_select_template" model="ir.ui.view"> |
978 | + <field name="name">Select Invoice Template</field> |
979 | + <field name="model">wizard.select.invoice.template</field> |
980 | + <field name="arch" type="xml"> |
981 | + <form string="Invoice Template" > |
982 | + <group col="2" width="600" height="500"> |
983 | + <group> |
984 | + <field name="template_id" colspan="2" attrs="{'invisible':[('state','=','template_selected')]}"/> |
985 | + <field name="line_ids" colspan="2" nolabel="1" attrs="{'invisible':[('state','!=','template_selected')]}"/> |
986 | + <field name="state" invisible="1"/> |
987 | + </group> |
988 | + <newline/> |
989 | + <group col="3"> |
990 | + <button icon="gtk-cancel" special="cancel" string="Cancel" colspan="1"/> |
991 | + <button icon="gtk-ok" name="load_template" string="Load" type="object" colspan="1" attrs="{'invisible':[('state','!=','template_selected')]}" /> |
992 | + <button name="load_lines" string="Next" icon="terp-gtk-go-back-rtl" type="object" colspan="1" attrs="{'invisible':[('state','=','template_selected')]}" /> |
993 | + </group> |
994 | + </group> |
995 | + </form> |
996 | + </field> |
997 | + </record> |
998 | + |
999 | + <record id="wizard_select_template_line" model="ir.ui.view"> |
1000 | + <field name="name">Select Invoice Template Line</field> |
1001 | + <field name="model">wizard.select.invoice.template.line</field> |
1002 | + <field name="arch" type="xml"> |
1003 | + <form string="Invoice Template Line"> |
1004 | + <group col="2"> |
1005 | + <field name="sequence" invisible="1"/> |
1006 | + <field name="name" /> |
1007 | + <field name="account_id" /> |
1008 | + <field name="amount" /> |
1009 | + </group> |
1010 | + </form> |
1011 | + </field> |
1012 | + </record> |
1013 | + |
1014 | + <record id="wizard_select_template_line_tree" model="ir.ui.view"> |
1015 | + <field name="name">Select Invoice Template Line</field> |
1016 | + <field name="model">wizard.select.invoice.template.line</field> |
1017 | + <field name="arch" type="xml"> |
1018 | + <tree string="Invoice Template Line" editable="bottom"> |
1019 | + <field name="sequence" invisible="1"/> |
1020 | + <field name="name" /> |
1021 | + <field name="account_id" /> |
1022 | + <field name="amount" /> |
1023 | + </tree> |
1024 | + </field> |
1025 | + </record> |
1026 | + |
1027 | + <record id="action_wizard_select_template" model="ir.actions.act_window"> |
1028 | + <field name="name">Select Invoice Template</field> |
1029 | + <field name="res_model">wizard.select.invoice.template</field> |
1030 | + <field name="view_type">form</field> |
1031 | + <field name="view_mode">form</field> |
1032 | + <field name="view_id" ref="wizard_select_template"/> |
1033 | + <field name="target">new</field> |
1034 | + </record> |
1035 | + |
1036 | + <act_window name="Create Invoice from Template" |
1037 | + res_model="wizard.select.invoice.template" |
1038 | + src_model="account.invoice" |
1039 | + view_mode="form" |
1040 | + target="new" |
1041 | + key2="client_action_multi" |
1042 | + id="action_wizard_select_template_by_invoice" |
1043 | + view_id="wizard_select_template"/> |
1044 | + |
1045 | + <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"/> |
1046 | + </data> |
1047 | +</openerp> |
As Lorenzo mentioned on the Openobject- italia- core-devs list, this MP has become important in Italy because the module l10n_it_ bill_of_ entry depends on that.
LGTM, thanks!