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
=== added directory 'account_invoice_sequential_dates'
=== added file 'account_invoice_sequential_dates/AUTHORS.txt'
--- account_invoice_sequential_dates/AUTHORS.txt 1970-01-01 00:00:00 +0000
+++ account_invoice_sequential_dates/AUTHORS.txt 2013-02-21 23:39:19 +0000
@@ -0,0 +1,9 @@
1Davide Corio <davide.corio@domsense.com>
2Luca Subiaco <subluca@gmail.com>
3Simone Orsi <simone.orsi@domsense.com>
4Mario Riva <mario.riva@domsense.com>
5Mauro Soligo <mauro.soligo@katodo.com>
6Giovanni Barzan <giovanni.barzan@gmail.com>
7Lorenzo Battistini <lorenzo.battistini@albatos.com>
8Roberto Onnis <onnis.roberto@gmail.com>
9
010
=== added file 'account_invoice_sequential_dates/__init__.py'
--- account_invoice_sequential_dates/__init__.py 1970-01-01 00:00:00 +0000
+++ account_invoice_sequential_dates/__init__.py 2013-02-21 23:39:19 +0000
@@ -0,0 +1,24 @@
1# -*- coding: utf-8 -*-
2##############################################################################
3#
4# Copyright (C) 2010 Associazione OpenERP Italia
5# (<http://www.openerp-italia.org>).
6#
7# This program is free software: you can redistribute it and/or modify
8# it under the terms of the GNU Affero General Public License as published by
9# the Free Software Foundation, either version 3 of the License, or
10# (at your option) any later version.
11#
12# This program is distributed in the hope that it will be useful,
13# but WITHOUT ANY WARRANTY; without even the implied warranty of
14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15# GNU General Public License for more details.
16#
17# You should have received a copy of the GNU Affero General Public License
18# along with this program. If not, see <http://www.gnu.org/licenses/>.
19#
20##############################################################################
21
22import invoice
23# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
24
025
=== added file 'account_invoice_sequential_dates/__openerp__.py'
--- account_invoice_sequential_dates/__openerp__.py 1970-01-01 00:00:00 +0000
+++ account_invoice_sequential_dates/__openerp__.py 2013-02-21 23:39:19 +0000
@@ -0,0 +1,42 @@
1# -*- coding: utf-8 -*-
2##############################################################################
3#
4# Copyright (C) 2010-2012 Associazione OpenERP Italia
5# (<http://www.openerp-italia.org>).
6#
7# This program is free software: you can redistribute it and/or modify
8# it under the terms of the GNU Affero General Public License as published
9# by the Free Software Foundation, either version 3 of the License, or
10# (at your option) any later version.
11#
12# This program is distributed in the hope that it will be useful,
13# but WITHOUT ANY WARRANTY; without even the implied warranty of
14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15# GNU General Public License for more details.
16#
17# You should have received a copy of the GNU Affero General Public License
18# along with this program. If not, see <http://www.gnu.org/licenses/>.
19#
20##############################################################################
21{
22 'name': 'Check invoice date consistency',
23 'version': '0.1',
24 'category': 'Tools',
25 'description': """This module customizes OpenERP in order to make invoices with consistent dates.
26
27Functionalities:
28
29- Check invoice date consistency
30
31""",
32 'author': 'OpenERP Italian Community',
33 'website': 'http://www.openerp-italia.org',
34 'license': 'AGPL-3',
35 "depends" : ['account',],
36 "data" : [],
37 "demo_xml" : [],
38 "active": False,
39 "installable": True
40}
41# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
42
043
=== added directory 'account_invoice_sequential_dates/i18n'
=== added file 'account_invoice_sequential_dates/invoice.py'
--- account_invoice_sequential_dates/invoice.py 1970-01-01 00:00:00 +0000
+++ account_invoice_sequential_dates/invoice.py 2013-02-21 23:39:19 +0000
@@ -0,0 +1,47 @@
1# -*- coding: utf-8 -*-
2##############################################################################
3#
4# Copyright (C) 2010 Associazione OpenERP Italia
5# (<http://www.openerp-italia.org>).
6#
7# This program is free software: you can redistribute it and/or modify
8# it under the terms of the GNU Affero General Public License as published by
9# the Free Software Foundation, either version 3 of the License, or
10# (at your option) any later version.
11#
12# This program is distributed in the hope that it will be useful,
13# but WITHOUT ANY WARRANTY; without even the implied warranty of
14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15# GNU General Public License for more details.
16#
17# You should have received a copy of the GNU Affero General Public License
18# along with this program. If not, see <http://www.gnu.org/licenses/>.
19#
20##############################################################################
21
22import netsvc
23import pooler, tools
24
25from openerp.osv import fields, orm
26from tools.translate import _
27
28class account_invoice(orm.Model):
29 _inherit = 'account.invoice'
30
31 def action_number(self, cr, uid, ids, context=None):
32 super(account_invoice, self).action_number(cr, uid, ids, context=context)
33 for obj_inv in self.browse(cr, uid, ids, context=context):
34 inv_type = obj_inv.type
35 if inv_type == 'in_invoice' or inv_type == 'in_refund':
36 return True
37 number = obj_inv.number
38 date_invoice = obj_inv.date_invoice
39 journal = obj_inv.journal_id.id
40 res = self.search(cr, uid, [('type','=',inv_type),('date_invoice','>',date_invoice),
41 ('number', '<', number), ('journal_id','=',journal)], context=context)
42 if res:
43 raise orm.except_orm(_('Date Inconsistency'),
44 _('Cannot create invoice! Post the invoice with a greater date'))
45 return True
46
47# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

Subscribers

People subscribed via source and target branches