Merge lp:~icsergio/openobject-italia/adding_account_invoice_entry_date into lp:~openobject-italia-core-devs/openobject-italia/italian-addons-7.0
- adding_account_invoice_entry_date
- Merge into italian-addons-7.0
Proposed by
Sergio Corato
Status: | Merged |
---|---|
Merged at revision: | 211 |
Proposed branch: | lp:~icsergio/openobject-italia/adding_account_invoice_entry_date |
Merge into: | lp:~openobject-italia-core-devs/openobject-italia/italian-addons-7.0 |
Diff against target: |
317 lines (+286/-0) 6 files modified
account_invoice_entry_date/AUTHORS.txt (+2/-0) account_invoice_entry_date/__init__.py (+24/-0) account_invoice_entry_date/__openerp__.py (+35/-0) account_invoice_entry_date/i18n/it.po (+109/-0) account_invoice_entry_date/invoice.py (+77/-0) account_invoice_entry_date/invoice_view.xml (+39/-0) |
To merge this branch: | bzr merge lp:~icsergio/openobject-italia/adding_account_invoice_entry_date |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
OpenERP Italia core devs | Pending | ||
Review via email: mp+157942@code.launchpad.net |
Commit message
Description of the change
To post a comment you must log in.
Revision history for this message
Lorenzo Battistini (elbati) wrote : | # |
- 211. By Sergio Corato
-
[FIX] Copyright
- 212. By Sergio Corato
-
[FIX] code for 7.0
Revision history for this message
Sergio Corato (icsergio) wrote : | # |
> Grazie.
>
> Potresti aggiungere il copyright dell'associazione nei file dove non è
> presente?
Adesso dovrebbe essere tutto a posto, non ho fatto un test però
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === added directory 'account_invoice_entry_date' | |||
2 | === added file 'account_invoice_entry_date/AUTHORS.txt' | |||
3 | --- account_invoice_entry_date/AUTHORS.txt 1970-01-01 00:00:00 +0000 | |||
4 | +++ account_invoice_entry_date/AUTHORS.txt 2013-04-20 22:58:27 +0000 | |||
5 | @@ -0,0 +1,2 @@ | |||
6 | 1 | Paolo Chiara <p.chiara@isa.it> | ||
7 | 2 | Sergio Corato <info@icstools.it> | ||
8 | 0 | 3 | ||
9 | === added file 'account_invoice_entry_date/__init__.py' | |||
10 | --- account_invoice_entry_date/__init__.py 1970-01-01 00:00:00 +0000 | |||
11 | +++ account_invoice_entry_date/__init__.py 2013-04-20 22:58:27 +0000 | |||
12 | @@ -0,0 +1,24 @@ | |||
13 | 1 | # -*- encoding: utf-8 -*- | ||
14 | 2 | ############################################################################## | ||
15 | 3 | # | ||
16 | 4 | # OpenERP, Open Source Management Solution | ||
17 | 5 | # Copyright (C) 2011 ISA s.r.l. (<http://www.isa.it>). | ||
18 | 6 | # Copyright (C) 2013 Associazione OpenERP Italia | ||
19 | 7 | # http://www.openerp-italia.org> | ||
20 | 8 | # | ||
21 | 9 | # This program is free software: you can redistribute it and/or modify | ||
22 | 10 | # it under the terms of the GNU Affero General Public License as | ||
23 | 11 | # published by the Free Software Foundation, either version 3 of the | ||
24 | 12 | # License, or (at your option) any later version. | ||
25 | 13 | # | ||
26 | 14 | # This program is distributed in the hope that it will be useful, | ||
27 | 15 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
28 | 16 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
29 | 17 | # GNU Affero General Public License for more details. | ||
30 | 18 | # | ||
31 | 19 | # You should have received a copy of the GNU Affero General Public License | ||
32 | 20 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
33 | 21 | # | ||
34 | 22 | ############################################################################## | ||
35 | 23 | |||
36 | 24 | import invoice | ||
37 | 0 | 25 | ||
38 | === added file 'account_invoice_entry_date/__openerp__.py' | |||
39 | --- account_invoice_entry_date/__openerp__.py 1970-01-01 00:00:00 +0000 | |||
40 | +++ account_invoice_entry_date/__openerp__.py 2013-04-20 22:58:27 +0000 | |||
41 | @@ -0,0 +1,35 @@ | |||
42 | 1 | # -*- encoding: utf-8 -*- | ||
43 | 2 | ############################################################################## | ||
44 | 3 | # | ||
45 | 4 | # OpenERP, Open Source Management Solution | ||
46 | 5 | # Copyright (C) 2011 Associazione OpenERP Italia | ||
47 | 6 | # http://www.openerp-italia.org> | ||
48 | 7 | # | ||
49 | 8 | # This program is free software: you can redistribute it and/or modify | ||
50 | 9 | # it under the terms of the GNU Affero General Public License as | ||
51 | 10 | # published by the Free Software Foundation, either version 3 of the | ||
52 | 11 | # License, or (at your option) any later version. | ||
53 | 12 | # | ||
54 | 13 | # This program is distributed in the hope that it will be useful, | ||
55 | 14 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
56 | 15 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
57 | 16 | # GNU Affero General Public License for more details. | ||
58 | 17 | # | ||
59 | 18 | # You should have received a copy of the GNU Affero General Public License | ||
60 | 19 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
61 | 20 | # | ||
62 | 21 | ############################################################################## | ||
63 | 22 | { | ||
64 | 23 | 'name': 'Account Invoice entry Date', | ||
65 | 24 | 'version': '0.1', | ||
66 | 25 | 'category': 'Generic Modules/Accounting', | ||
67 | 26 | 'description': """This module allows to specify the date to be used by the move created while confirming (supplier) invoice""", | ||
68 | 27 | 'author': 'OpenERP Italian Community', | ||
69 | 28 | 'website': 'http://www.openerp-italia.org', | ||
70 | 29 | 'license': 'AGPL-3', | ||
71 | 30 | "depends" : ['account',], | ||
72 | 31 | "data" : ['invoice_view.xml'], | ||
73 | 32 | "demo" : [], | ||
74 | 33 | "active": False, | ||
75 | 34 | "installable": True | ||
76 | 35 | } | ||
77 | 0 | 36 | ||
78 | === added directory 'account_invoice_entry_date/i18n' | |||
79 | === added file 'account_invoice_entry_date/i18n/it.po' | |||
80 | --- account_invoice_entry_date/i18n/it.po 1970-01-01 00:00:00 +0000 | |||
81 | +++ account_invoice_entry_date/i18n/it.po 2013-04-20 22:58:27 +0000 | |||
82 | @@ -0,0 +1,109 @@ | |||
83 | 1 | # Translation of OpenERP Server. | ||
84 | 2 | # This file contains the translation of the following modules: | ||
85 | 3 | # * account_invoice_entry_date | ||
86 | 4 | # | ||
87 | 5 | msgid "" | ||
88 | 6 | msgstr "" | ||
89 | 7 | "Project-Id-Version: OpenERP Server 6.0.2\n" | ||
90 | 8 | "Report-Msgid-Bugs-To: support@openerp.com\n" | ||
91 | 9 | "POT-Creation-Date: 2011-09-05 10:31+0000\n" | ||
92 | 10 | "PO-Revision-Date: 2011-09-05 10:31+0000\n" | ||
93 | 11 | "Last-Translator: <>\n" | ||
94 | 12 | "Language-Team: \n" | ||
95 | 13 | "MIME-Version: 1.0\n" | ||
96 | 14 | "Content-Type: text/plain; charset=UTF-8\n" | ||
97 | 15 | "Content-Transfer-Encoding: \n" | ||
98 | 16 | "Plural-Forms: \n" | ||
99 | 17 | |||
100 | 18 | #. module: account_invoice_entry_date | ||
101 | 19 | #: code:addons/account_invoice_entry_date/invoice.py:163 | ||
102 | 20 | #, python-format | ||
103 | 21 | msgid "UserError" | ||
104 | 22 | msgstr "UserError" | ||
105 | 23 | |||
106 | 24 | #. module: account_invoice_entry_date | ||
107 | 25 | #: code:addons/account_invoice_entry_date/invoice.py:40 | ||
108 | 26 | #: code:addons/account_invoice_entry_date/invoice.py:81 | ||
109 | 27 | #, python-format | ||
110 | 28 | msgid "Error !" | ||
111 | 29 | msgstr "Errore !" | ||
112 | 30 | |||
113 | 31 | #. module: account_invoice_entry_date | ||
114 | 32 | #: code:addons/account_invoice_entry_date/invoice.py:70 | ||
115 | 33 | #, python-format | ||
116 | 34 | msgid "Please verify the price of the invoice !\n" | ||
117 | 35 | "The real total does not match the computed total." | ||
118 | 36 | msgstr "Per favore verificare il prezzo della fattura!\n" | ||
119 | 37 | "Il totale reale non corrisponde al totale calcolato." | ||
120 | 38 | |||
121 | 39 | #. module: account_invoice_entry_date | ||
122 | 40 | #: code:addons/account_invoice_entry_date/invoice.py:81 | ||
123 | 41 | #, python-format | ||
124 | 42 | msgid "Cannot create the invoice !\n" | ||
125 | 43 | "The payment term defined gives a computed amount greater than the total invoiced amount." | ||
126 | 44 | msgstr "Impossibile creare la fattura!\n" | ||
127 | 45 | "I termini di pagamento definiti generano un importo calcolato maggiore del totale importo fatturato." | ||
128 | 46 | |||
129 | 47 | #. module: account_invoice_entry_date | ||
130 | 48 | #: model:ir.module.module,description:account_invoice_entry_date.module_meta_information | ||
131 | 49 | #: model:ir.module.module,shortdesc:account_invoice_entry_date.module_meta_information | ||
132 | 50 | msgid "Account Invoice entry Date" | ||
133 | 51 | msgstr "Account Invoice entry Date" | ||
134 | 52 | |||
135 | 53 | #. module: account_invoice_entry_date | ||
136 | 54 | #: help:account.invoice,registration_date:0 | ||
137 | 55 | msgid "Keep empty to use the current date" | ||
138 | 56 | msgstr "Lasciare vuoto per utilizzare la data corrente" | ||
139 | 57 | |||
140 | 58 | #. module: account_invoice_entry_date | ||
141 | 59 | #: code:addons/account_invoice_entry_date/invoice.py:42 | ||
142 | 60 | #, python-format | ||
143 | 61 | msgid "Please create some invoice lines." | ||
144 | 62 | msgstr "Creare voci della fattura." | ||
145 | 63 | |||
146 | 64 | #. module: account_invoice_entry_date | ||
147 | 65 | #: code:addons/account_invoice_entry_date/invoice.py:40 | ||
148 | 66 | #, python-format | ||
149 | 67 | msgid "Please define sequence on invoice journal" | ||
150 | 68 | msgstr "Definire una sequenza per il giornale fatture" | ||
151 | 69 | |||
152 | 70 | #. module: account_invoice_entry_date | ||
153 | 71 | #: code:addons/account_invoice_entry_date/invoice.py:70 | ||
154 | 72 | #, python-format | ||
155 | 73 | msgid "Bad total !" | ||
156 | 74 | msgstr "Totale Errato !" | ||
157 | 75 | |||
158 | 76 | #. module: account_invoice_entry_date | ||
159 | 77 | #: code:addons/account_invoice_entry_date/invoice.py:57 | ||
160 | 78 | #, python-format | ||
161 | 79 | msgid "The invoice date cannot be later than the date of registration!" | ||
162 | 80 | msgstr "La data di fatturazione non può essere successiva alla data di registrazione!" | ||
163 | 81 | |||
164 | 82 | #. module: account_invoice_entry_date | ||
165 | 83 | #: model:ir.model,name:account_invoice_entry_date.model_account_invoice | ||
166 | 84 | msgid "Invoice" | ||
167 | 85 | msgstr "Fattura" | ||
168 | 86 | |||
169 | 87 | #. module: account_invoice_entry_date | ||
170 | 88 | #: code:addons/account_invoice_entry_date/invoice.py:164 | ||
171 | 89 | #, python-format | ||
172 | 90 | msgid "Cannot create invoice move on centralised journal" | ||
173 | 91 | msgstr "Impossibile creare la registrazione della fattura su un giornale centralizzato" | ||
174 | 92 | |||
175 | 93 | #. module: account_invoice_entry_date | ||
176 | 94 | #: code:addons/account_invoice_entry_date/invoice.py:42 | ||
177 | 95 | #, python-format | ||
178 | 96 | msgid "No Invoice Lines !" | ||
179 | 97 | msgstr "Mancano voci nella fattura !" | ||
180 | 98 | |||
181 | 99 | #. module: account_invoice_entry_date | ||
182 | 100 | #: field:account.invoice,registration_date:0 | ||
183 | 101 | msgid "Registration Date" | ||
184 | 102 | msgstr "Data di registrazione" | ||
185 | 103 | |||
186 | 104 | #. module: account_invoice_entry_date | ||
187 | 105 | #: code:addons/account_invoice_entry_date/invoice.py:57 | ||
188 | 106 | #, python-format | ||
189 | 107 | msgid "Error date !" | ||
190 | 108 | msgstr "Data errata !" | ||
191 | 109 | |||
192 | 0 | 110 | ||
193 | === added file 'account_invoice_entry_date/invoice.py' | |||
194 | --- account_invoice_entry_date/invoice.py 1970-01-01 00:00:00 +0000 | |||
195 | +++ account_invoice_entry_date/invoice.py 2013-04-20 22:58:27 +0000 | |||
196 | @@ -0,0 +1,77 @@ | |||
197 | 1 | # -*- coding: utf-8 -*- | ||
198 | 2 | ############################################################################## | ||
199 | 3 | # | ||
200 | 4 | # OpenERP, Open Source Management Solution | ||
201 | 5 | # Copyright (C) 2004-2010 ISA srl (<http://www.isa.it>). | ||
202 | 6 | # Copyright (C) 2013 Associazione OpenERP Italia | ||
203 | 7 | # http://www.openerp-italia.org> | ||
204 | 8 | # | ||
205 | 9 | # This program is free software: you can redistribute it and/or modify | ||
206 | 10 | # it under the terms of the GNU Affero General Public License as | ||
207 | 11 | # published by the Free Software Foundation, either version 3 of the | ||
208 | 12 | # License, or (at your option) any later version. | ||
209 | 13 | # | ||
210 | 14 | # This program is distributed in the hope that it will be useful, | ||
211 | 15 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
212 | 16 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
213 | 17 | # GNU Affero General Public License for more details. | ||
214 | 18 | # | ||
215 | 19 | # You should have received a copy of the GNU Affero General Public License | ||
216 | 20 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
217 | 21 | # | ||
218 | 22 | ############################################################################## | ||
219 | 23 | |||
220 | 24 | import time | ||
221 | 25 | from openerp.osv import fields, orm | ||
222 | 26 | from tools.translate import _ | ||
223 | 27 | from datetime import datetime | ||
224 | 28 | |||
225 | 29 | class account_invoice(orm.Model): | ||
226 | 30 | |||
227 | 31 | _inherit = 'account.invoice' | ||
228 | 32 | _columns = { | ||
229 | 33 | 'registration_date':fields.date('Registration Date', states={'paid':[('readonly',True)], 'open':[('readonly',True)], 'close':[('readonly',True)]}, select=True, help="Keep empty to use the current date"), | ||
230 | 34 | } | ||
231 | 35 | |||
232 | 36 | def action_move_create(self, cr, uid, ids, *args): | ||
233 | 37 | |||
234 | 38 | super(account_invoice,self).action_move_create(cr, uid, ids,*args) | ||
235 | 39 | |||
236 | 40 | for inv in self.browse(cr, uid, ids): | ||
237 | 41 | |||
238 | 42 | date_invoice=inv.date_invoice | ||
239 | 43 | |||
240 | 44 | reg_date = inv.registration_date | ||
241 | 45 | if not inv.registration_date : | ||
242 | 46 | if not inv.date_invoice: | ||
243 | 47 | reg_date = time.strftime('%Y-%m-%d') | ||
244 | 48 | else : reg_date = inv.date_invoice | ||
245 | 49 | |||
246 | 50 | if date_invoice and reg_date : | ||
247 | 51 | if (date_invoice > reg_date) : | ||
248 | 52 | raise orm.except_orm(_('Error date !'), _('The invoice date cannot be later than the date of registration!')) | ||
249 | 53 | |||
250 | 54 | #periodo | ||
251 | 55 | date_start = inv.registration_date or inv.date_invoice or time.strftime('%Y-%m-%d') | ||
252 | 56 | date_stop = inv.registration_date or inv.date_invoice or time.strftime('%Y-%m-%d') | ||
253 | 57 | |||
254 | 58 | period_ids = self.pool.get('account.period').search(cr, uid, [('date_start','<=',date_start),('date_stop','>=',date_stop), ('company_id', '=', inv.company_id.id)]) | ||
255 | 59 | if period_ids: | ||
256 | 60 | period_id = period_ids[0] | ||
257 | 61 | |||
258 | 62 | self.write(cr, uid, [inv.id], {'registration_date':reg_date,'period_id':period_id,}) | ||
259 | 63 | |||
260 | 64 | mov_date = reg_date or inv.date_invoice or time.strftime('%Y-%m-%d') | ||
261 | 65 | |||
262 | 66 | self.pool.get('account.move').write(cr, uid, [inv.move_id.id], {'state':'draft'}) | ||
263 | 67 | |||
264 | 68 | sql="update account_move_line set period_id="+str(period_id)+",date='"+mov_date+"' where move_id = "+str(inv.move_id.id) | ||
265 | 69 | |||
266 | 70 | cr.execute(sql) | ||
267 | 71 | |||
268 | 72 | self.pool.get('account.move').write(cr, uid, [inv.move_id.id], {'period_id':period_id,'date':mov_date}) | ||
269 | 73 | |||
270 | 74 | self.pool.get('account.move').write(cr, uid, [inv.move_id.id], {'state':'posted'}) | ||
271 | 75 | |||
272 | 76 | self._log_event(cr, uid, ids) | ||
273 | 77 | return True | ||
274 | 0 | 78 | ||
275 | === added file 'account_invoice_entry_date/invoice_view.xml' | |||
276 | --- account_invoice_entry_date/invoice_view.xml 1970-01-01 00:00:00 +0000 | |||
277 | +++ account_invoice_entry_date/invoice_view.xml 2013-04-20 22:58:27 +0000 | |||
278 | @@ -0,0 +1,39 @@ | |||
279 | 1 | <?xml version="1.0" encoding="utf-8"?> | ||
280 | 2 | <openerp> | ||
281 | 3 | <data> | ||
282 | 4 | <record id="invoice_form_reg_date" model="ir.ui.view"> | ||
283 | 5 | <field name="name">account.invoice.form.reg_date</field> | ||
284 | 6 | <field name="model">account.invoice</field> | ||
285 | 7 | <field name="inherit_id" ref="account.invoice_form"/> | ||
286 | 8 | <field name="arch" type="xml"> | ||
287 | 9 | <field name="date_invoice" position="after"> | ||
288 | 10 | <field name="registration_date"></field> | ||
289 | 11 | </field> | ||
290 | 12 | </field> | ||
291 | 13 | </record> | ||
292 | 14 | |||
293 | 15 | <record id="invoice_tree_reg_date" model="ir.ui.view"> | ||
294 | 16 | <field name="name">account.invoice.tree.reg_date</field> | ||
295 | 17 | <field name="model">account.invoice</field> | ||
296 | 18 | <field name="inherit_id" ref="account.invoice_tree"/> | ||
297 | 19 | <field name="arch" type="xml"> | ||
298 | 20 | <field name="date_invoice" position="after"> | ||
299 | 21 | <field name="registration_date"></field> | ||
300 | 22 | </field> | ||
301 | 23 | </field> | ||
302 | 24 | </record> | ||
303 | 25 | |||
304 | 26 | <record id="invoice_supplier_form_reg_date" model="ir.ui.view"> | ||
305 | 27 | <field name="name">account.invoice.supplier.form.reg_date</field> | ||
306 | 28 | <field name="model">account.invoice</field> | ||
307 | 29 | <field name="inherit_id" ref="account.invoice_supplier_form"/> | ||
308 | 30 | <field name="arch" type="xml"> | ||
309 | 31 | <field name="date_invoice" position="after"> | ||
310 | 32 | <field name="registration_date"></field> | ||
311 | 33 | </field> | ||
312 | 34 | </field> | ||
313 | 35 | </record> | ||
314 | 36 | |||
315 | 37 | |||
316 | 38 | </data> | ||
317 | 39 | </openerp> |
Grazie.
Potresti aggiungere il copyright dell'associazione nei file dove non è presente?