Merge lp:~icsergio/openobject-italia/adding_account_invoice_entry_date into lp:~openobject-italia-core-devs/openobject-italia/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
Reviewer Review Type Date Requested Status
OpenERP Italia core devs Pending
Review via email: mp+157942@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Lorenzo Battistini (elbati) wrote :

Grazie.

Potresti aggiungere il copyright dell'associazione nei file dove non è presente?

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
=== added directory 'account_invoice_entry_date'
=== added file 'account_invoice_entry_date/AUTHORS.txt'
--- account_invoice_entry_date/AUTHORS.txt 1970-01-01 00:00:00 +0000
+++ account_invoice_entry_date/AUTHORS.txt 2013-04-20 22:58:27 +0000
@@ -0,0 +1,2 @@
1Paolo Chiara <p.chiara@isa.it>
2Sergio Corato <info@icstools.it>
03
=== added file 'account_invoice_entry_date/__init__.py'
--- account_invoice_entry_date/__init__.py 1970-01-01 00:00:00 +0000
+++ account_invoice_entry_date/__init__.py 2013-04-20 22:58:27 +0000
@@ -0,0 +1,24 @@
1# -*- encoding: utf-8 -*-
2##############################################################################
3#
4# OpenERP, Open Source Management Solution
5# Copyright (C) 2011 ISA s.r.l. (<http://www.isa.it>).
6# Copyright (C) 2013 Associazione OpenERP Italia
7# http://www.openerp-italia.org>
8#
9# This program is free software: you can redistribute it and/or modify
10# it under the terms of the GNU Affero General Public License as
11# published by the Free Software Foundation, either version 3 of the
12# License, or (at your option) any later version.
13#
14# This program is distributed in the hope that it will be useful,
15# but WITHOUT ANY WARRANTY; without even the implied warranty of
16# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17# GNU Affero General Public License for more details.
18#
19# You should have received a copy of the GNU Affero General Public License
20# along with this program. If not, see <http://www.gnu.org/licenses/>.
21#
22##############################################################################
23
24import invoice
025
=== added file 'account_invoice_entry_date/__openerp__.py'
--- account_invoice_entry_date/__openerp__.py 1970-01-01 00:00:00 +0000
+++ account_invoice_entry_date/__openerp__.py 2013-04-20 22:58:27 +0000
@@ -0,0 +1,35 @@
1# -*- encoding: utf-8 -*-
2##############################################################################
3#
4# OpenERP, Open Source Management Solution
5# Copyright (C) 2011 Associazione OpenERP Italia
6# http://www.openerp-italia.org>
7#
8# This program is free software: you can redistribute it and/or modify
9# it under the terms of the GNU Affero General Public License as
10# published by the Free Software Foundation, either version 3 of the
11# License, or (at your option) any later version.
12#
13# This program is distributed in the hope that it will be useful,
14# but WITHOUT ANY WARRANTY; without even the implied warranty of
15# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16# GNU Affero General Public License for more details.
17#
18# You should have received a copy of the GNU Affero General Public License
19# along with this program. If not, see <http://www.gnu.org/licenses/>.
20#
21##############################################################################
22{
23 'name': 'Account Invoice entry Date',
24 'version': '0.1',
25 'category': 'Generic Modules/Accounting',
26 'description': """This module allows to specify the date to be used by the move created while confirming (supplier) invoice""",
27 'author': 'OpenERP Italian Community',
28 'website': 'http://www.openerp-italia.org',
29 'license': 'AGPL-3',
30 "depends" : ['account',],
31 "data" : ['invoice_view.xml'],
32 "demo" : [],
33 "active": False,
34 "installable": True
35}
036
=== added directory 'account_invoice_entry_date/i18n'
=== added file 'account_invoice_entry_date/i18n/it.po'
--- account_invoice_entry_date/i18n/it.po 1970-01-01 00:00:00 +0000
+++ account_invoice_entry_date/i18n/it.po 2013-04-20 22:58:27 +0000
@@ -0,0 +1,109 @@
1# Translation of OpenERP Server.
2# This file contains the translation of the following modules:
3# * account_invoice_entry_date
4#
5msgid ""
6msgstr ""
7"Project-Id-Version: OpenERP Server 6.0.2\n"
8"Report-Msgid-Bugs-To: support@openerp.com\n"
9"POT-Creation-Date: 2011-09-05 10:31+0000\n"
10"PO-Revision-Date: 2011-09-05 10:31+0000\n"
11"Last-Translator: <>\n"
12"Language-Team: \n"
13"MIME-Version: 1.0\n"
14"Content-Type: text/plain; charset=UTF-8\n"
15"Content-Transfer-Encoding: \n"
16"Plural-Forms: \n"
17
18#. module: account_invoice_entry_date
19#: code:addons/account_invoice_entry_date/invoice.py:163
20#, python-format
21msgid "UserError"
22msgstr "UserError"
23
24#. module: account_invoice_entry_date
25#: code:addons/account_invoice_entry_date/invoice.py:40
26#: code:addons/account_invoice_entry_date/invoice.py:81
27#, python-format
28msgid "Error !"
29msgstr "Errore !"
30
31#. module: account_invoice_entry_date
32#: code:addons/account_invoice_entry_date/invoice.py:70
33#, python-format
34msgid "Please verify the price of the invoice !\n"
35"The real total does not match the computed total."
36msgstr "Per favore verificare il prezzo della fattura!\n"
37"Il totale reale non corrisponde al totale calcolato."
38
39#. module: account_invoice_entry_date
40#: code:addons/account_invoice_entry_date/invoice.py:81
41#, python-format
42msgid "Cannot create the invoice !\n"
43"The payment term defined gives a computed amount greater than the total invoiced amount."
44msgstr "Impossibile creare la fattura!\n"
45"I termini di pagamento definiti generano un importo calcolato maggiore del totale importo fatturato."
46
47#. module: account_invoice_entry_date
48#: model:ir.module.module,description:account_invoice_entry_date.module_meta_information
49#: model:ir.module.module,shortdesc:account_invoice_entry_date.module_meta_information
50msgid "Account Invoice entry Date"
51msgstr "Account Invoice entry Date"
52
53#. module: account_invoice_entry_date
54#: help:account.invoice,registration_date:0
55msgid "Keep empty to use the current date"
56msgstr "Lasciare vuoto per utilizzare la data corrente"
57
58#. module: account_invoice_entry_date
59#: code:addons/account_invoice_entry_date/invoice.py:42
60#, python-format
61msgid "Please create some invoice lines."
62msgstr "Creare voci della fattura."
63
64#. module: account_invoice_entry_date
65#: code:addons/account_invoice_entry_date/invoice.py:40
66#, python-format
67msgid "Please define sequence on invoice journal"
68msgstr "Definire una sequenza per il giornale fatture"
69
70#. module: account_invoice_entry_date
71#: code:addons/account_invoice_entry_date/invoice.py:70
72#, python-format
73msgid "Bad total !"
74msgstr "Totale Errato !"
75
76#. module: account_invoice_entry_date
77#: code:addons/account_invoice_entry_date/invoice.py:57
78#, python-format
79msgid "The invoice date cannot be later than the date of registration!"
80msgstr "La data di fatturazione non può essere successiva alla data di registrazione!"
81
82#. module: account_invoice_entry_date
83#: model:ir.model,name:account_invoice_entry_date.model_account_invoice
84msgid "Invoice"
85msgstr "Fattura"
86
87#. module: account_invoice_entry_date
88#: code:addons/account_invoice_entry_date/invoice.py:164
89#, python-format
90msgid "Cannot create invoice move on centralised journal"
91msgstr "Impossibile creare la registrazione della fattura su un giornale centralizzato"
92
93#. module: account_invoice_entry_date
94#: code:addons/account_invoice_entry_date/invoice.py:42
95#, python-format
96msgid "No Invoice Lines !"
97msgstr "Mancano voci nella fattura !"
98
99#. module: account_invoice_entry_date
100#: field:account.invoice,registration_date:0
101msgid "Registration Date"
102msgstr "Data di registrazione"
103
104#. module: account_invoice_entry_date
105#: code:addons/account_invoice_entry_date/invoice.py:57
106#, python-format
107msgid "Error date !"
108msgstr "Data errata !"
109
0110
=== added file 'account_invoice_entry_date/invoice.py'
--- account_invoice_entry_date/invoice.py 1970-01-01 00:00:00 +0000
+++ account_invoice_entry_date/invoice.py 2013-04-20 22:58:27 +0000
@@ -0,0 +1,77 @@
1# -*- coding: utf-8 -*-
2##############################################################################
3#
4# OpenERP, Open Source Management Solution
5# Copyright (C) 2004-2010 ISA srl (<http://www.isa.it>).
6# Copyright (C) 2013 Associazione OpenERP Italia
7# http://www.openerp-italia.org>
8#
9# This program is free software: you can redistribute it and/or modify
10# it under the terms of the GNU Affero General Public License as
11# published by the Free Software Foundation, either version 3 of the
12# License, or (at your option) any later version.
13#
14# This program is distributed in the hope that it will be useful,
15# but WITHOUT ANY WARRANTY; without even the implied warranty of
16# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17# GNU Affero General Public License for more details.
18#
19# You should have received a copy of the GNU Affero General Public License
20# along with this program. If not, see <http://www.gnu.org/licenses/>.
21#
22##############################################################################
23
24import time
25from openerp.osv import fields, orm
26from tools.translate import _
27from datetime import datetime
28
29class account_invoice(orm.Model):
30
31 _inherit = 'account.invoice'
32 _columns = {
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"),
34 }
35
36 def action_move_create(self, cr, uid, ids, *args):
37
38 super(account_invoice,self).action_move_create(cr, uid, ids,*args)
39
40 for inv in self.browse(cr, uid, ids):
41
42 date_invoice=inv.date_invoice
43
44 reg_date = inv.registration_date
45 if not inv.registration_date :
46 if not inv.date_invoice:
47 reg_date = time.strftime('%Y-%m-%d')
48 else : reg_date = inv.date_invoice
49
50 if date_invoice and reg_date :
51 if (date_invoice > reg_date) :
52 raise orm.except_orm(_('Error date !'), _('The invoice date cannot be later than the date of registration!'))
53
54 #periodo
55 date_start = inv.registration_date or inv.date_invoice or time.strftime('%Y-%m-%d')
56 date_stop = inv.registration_date or inv.date_invoice or time.strftime('%Y-%m-%d')
57
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)])
59 if period_ids:
60 period_id = period_ids[0]
61
62 self.write(cr, uid, [inv.id], {'registration_date':reg_date,'period_id':period_id,})
63
64 mov_date = reg_date or inv.date_invoice or time.strftime('%Y-%m-%d')
65
66 self.pool.get('account.move').write(cr, uid, [inv.move_id.id], {'state':'draft'})
67
68 sql="update account_move_line set period_id="+str(period_id)+",date='"+mov_date+"' where move_id = "+str(inv.move_id.id)
69
70 cr.execute(sql)
71
72 self.pool.get('account.move').write(cr, uid, [inv.move_id.id], {'period_id':period_id,'date':mov_date})
73
74 self.pool.get('account.move').write(cr, uid, [inv.move_id.id], {'state':'posted'})
75
76 self._log_event(cr, uid, ids)
77 return True
078
=== added file 'account_invoice_entry_date/invoice_view.xml'
--- account_invoice_entry_date/invoice_view.xml 1970-01-01 00:00:00 +0000
+++ account_invoice_entry_date/invoice_view.xml 2013-04-20 22:58:27 +0000
@@ -0,0 +1,39 @@
1<?xml version="1.0" encoding="utf-8"?>
2<openerp>
3 <data>
4 <record id="invoice_form_reg_date" model="ir.ui.view">
5 <field name="name">account.invoice.form.reg_date</field>
6 <field name="model">account.invoice</field>
7 <field name="inherit_id" ref="account.invoice_form"/>
8 <field name="arch" type="xml">
9 <field name="date_invoice" position="after">
10 <field name="registration_date"></field>
11 </field>
12 </field>
13 </record>
14
15 <record id="invoice_tree_reg_date" model="ir.ui.view">
16 <field name="name">account.invoice.tree.reg_date</field>
17 <field name="model">account.invoice</field>
18 <field name="inherit_id" ref="account.invoice_tree"/>
19 <field name="arch" type="xml">
20 <field name="date_invoice" position="after">
21 <field name="registration_date"></field>
22 </field>
23 </field>
24 </record>
25
26 <record id="invoice_supplier_form_reg_date" model="ir.ui.view">
27 <field name="name">account.invoice.supplier.form.reg_date</field>
28 <field name="model">account.invoice</field>
29 <field name="inherit_id" ref="account.invoice_supplier_form"/>
30 <field name="arch" type="xml">
31 <field name="date_invoice" position="after">
32 <field name="registration_date"></field>
33 </field>
34 </field>
35 </record>
36
37
38 </data>
39</openerp>

Subscribers

People subscribed via source and target branches