Merge lp:~icsergio/openobject-italia/account_invoice_sequential_dates into lp:~openobject-italia-core-devs/openobject-italia/italian-addons-7.0

Proposed by Sergio Corato
Status: Merged
Merged at revision: 205
Proposed branch: lp:~icsergio/openobject-italia/account_invoice_sequential_dates
Merge into: lp:~openobject-italia-core-devs/openobject-italia/italian-addons-7.0
Diff against target: 143 lines (+122/-0)
4 files modified
account_invoice_sequential_dates/AUTHORS.txt (+9/-0)
account_invoice_sequential_dates/__init__.py (+24/-0)
account_invoice_sequential_dates/__openerp__.py (+42/-0)
account_invoice_sequential_dates/invoice.py (+47/-0)
To merge this branch: bzr merge lp:~icsergio/openobject-italia/account_invoice_sequential_dates
Reviewer Review Type Date Requested Status
Lorenzo Battistini Approve
Review via email: mp+149951@code.launchpad.net
To post a comment you must log in.
206. By Sergio Corato

[FIX] Description

Revision history for this message
Lorenzo Battistini (elbati) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== added directory 'account_invoice_sequential_dates'
2=== added file 'account_invoice_sequential_dates/AUTHORS.txt'
3--- account_invoice_sequential_dates/AUTHORS.txt 1970-01-01 00:00:00 +0000
4+++ account_invoice_sequential_dates/AUTHORS.txt 2013-02-21 23:39:19 +0000
5@@ -0,0 +1,9 @@
6+Davide Corio <davide.corio@domsense.com>
7+Luca Subiaco <subluca@gmail.com>
8+Simone Orsi <simone.orsi@domsense.com>
9+Mario Riva <mario.riva@domsense.com>
10+Mauro Soligo <mauro.soligo@katodo.com>
11+Giovanni Barzan <giovanni.barzan@gmail.com>
12+Lorenzo Battistini <lorenzo.battistini@albatos.com>
13+Roberto Onnis <onnis.roberto@gmail.com>
14+
15
16=== added file 'account_invoice_sequential_dates/__init__.py'
17--- account_invoice_sequential_dates/__init__.py 1970-01-01 00:00:00 +0000
18+++ account_invoice_sequential_dates/__init__.py 2013-02-21 23:39:19 +0000
19@@ -0,0 +1,24 @@
20+# -*- coding: utf-8 -*-
21+##############################################################################
22+#
23+# Copyright (C) 2010 Associazione OpenERP Italia
24+# (<http://www.openerp-italia.org>).
25+#
26+# This program is free software: you can redistribute it and/or modify
27+# it under the terms of the GNU Affero General Public License as published by
28+# the Free Software Foundation, either version 3 of the License, or
29+# (at your option) any later version.
30+#
31+# This program is distributed in the hope that it will be useful,
32+# but WITHOUT ANY WARRANTY; without even the implied warranty of
33+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
34+# GNU General Public License for more details.
35+#
36+# You should have received a copy of the GNU Affero General Public License
37+# along with this program. If not, see <http://www.gnu.org/licenses/>.
38+#
39+##############################################################################
40+
41+import invoice
42+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
43+
44
45=== added file 'account_invoice_sequential_dates/__openerp__.py'
46--- account_invoice_sequential_dates/__openerp__.py 1970-01-01 00:00:00 +0000
47+++ account_invoice_sequential_dates/__openerp__.py 2013-02-21 23:39:19 +0000
48@@ -0,0 +1,42 @@
49+# -*- coding: utf-8 -*-
50+##############################################################################
51+#
52+# Copyright (C) 2010-2012 Associazione OpenERP Italia
53+# (<http://www.openerp-italia.org>).
54+#
55+# This program is free software: you can redistribute it and/or modify
56+# it under the terms of the GNU Affero General Public License as published
57+# by the Free Software Foundation, either version 3 of the License, or
58+# (at your option) any later version.
59+#
60+# This program is distributed in the hope that it will be useful,
61+# but WITHOUT ANY WARRANTY; without even the implied warranty of
62+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
63+# GNU General Public License for more details.
64+#
65+# You should have received a copy of the GNU Affero General Public License
66+# along with this program. If not, see <http://www.gnu.org/licenses/>.
67+#
68+##############################################################################
69+{
70+ 'name': 'Check invoice date consistency',
71+ 'version': '0.1',
72+ 'category': 'Tools',
73+ 'description': """This module customizes OpenERP in order to make invoices with consistent dates.
74+
75+Functionalities:
76+
77+- Check invoice date consistency
78+
79+""",
80+ 'author': 'OpenERP Italian Community',
81+ 'website': 'http://www.openerp-italia.org',
82+ 'license': 'AGPL-3',
83+ "depends" : ['account',],
84+ "data" : [],
85+ "demo_xml" : [],
86+ "active": False,
87+ "installable": True
88+}
89+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
90+
91
92=== added directory 'account_invoice_sequential_dates/i18n'
93=== added file 'account_invoice_sequential_dates/invoice.py'
94--- account_invoice_sequential_dates/invoice.py 1970-01-01 00:00:00 +0000
95+++ account_invoice_sequential_dates/invoice.py 2013-02-21 23:39:19 +0000
96@@ -0,0 +1,47 @@
97+# -*- coding: utf-8 -*-
98+##############################################################################
99+#
100+# Copyright (C) 2010 Associazione OpenERP Italia
101+# (<http://www.openerp-italia.org>).
102+#
103+# This program is free software: you can redistribute it and/or modify
104+# it under the terms of the GNU Affero General Public License as published by
105+# the Free Software Foundation, either version 3 of the License, or
106+# (at your option) any later version.
107+#
108+# This program is distributed in the hope that it will be useful,
109+# but WITHOUT ANY WARRANTY; without even the implied warranty of
110+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
111+# GNU General Public License for more details.
112+#
113+# You should have received a copy of the GNU Affero General Public License
114+# along with this program. If not, see <http://www.gnu.org/licenses/>.
115+#
116+##############################################################################
117+
118+import netsvc
119+import pooler, tools
120+
121+from openerp.osv import fields, orm
122+from tools.translate import _
123+
124+class account_invoice(orm.Model):
125+ _inherit = 'account.invoice'
126+
127+ def action_number(self, cr, uid, ids, context=None):
128+ super(account_invoice, self).action_number(cr, uid, ids, context=context)
129+ for obj_inv in self.browse(cr, uid, ids, context=context):
130+ inv_type = obj_inv.type
131+ if inv_type == 'in_invoice' or inv_type == 'in_refund':
132+ return True
133+ number = obj_inv.number
134+ date_invoice = obj_inv.date_invoice
135+ journal = obj_inv.journal_id.id
136+ res = self.search(cr, uid, [('type','=',inv_type),('date_invoice','>',date_invoice),
137+ ('number', '<', number), ('journal_id','=',journal)], context=context)
138+ if res:
139+ raise orm.except_orm(_('Date Inconsistency'),
140+ _('Cannot create invoice! Post the invoice with a greater date'))
141+ return True
142+
143+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

Subscribers

People subscribed via source and target branches