Sergio Corato has proposed merging lp:~icsergio/openobject-italia/account_invoice_sequential_dates into lp:openobject-italia/7.0.
Requested reviews: OpenERP Italia core devs (openobject-italia-core-devs) For more details, see: https://code.launchpad.net/~icsergio/openobject-italia/account_invoice_sequential_dates/+merge/149951 -- https://code.launchpad.net/~icsergio/openobject-italia/account_invoice_sequential_dates/+merge/149951 Your team OpenERP Italia core devs is requested to review the proposed merge of lp:~icsergio/openobject-italia/account_invoice_sequential_dates into lp:openobject-italia/7.0.
=== 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:04:22 +0000 @@ -0,0 +1,9 @@ +Davide Corio <[email protected]> +Luca Subiaco <[email protected]> +Simone Orsi <[email protected]> +Mario Riva <[email protected]> +Mauro Soligo <[email protected]> +Giovanni Barzan <[email protected]> +Lorenzo Battistini <[email protected]> +Roberto Onnis <[email protected]> + === 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:04:22 +0000 @@ -0,0 +1,24 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Copyright (C) 2010 Associazione OpenERP Italia +# (<http://www.openerp-italia.org>). +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. +# +############################################################################## + +import invoice +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: + === 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:04:22 +0000 @@ -0,0 +1,42 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Copyright (C) 2010-2012 Associazione OpenERP Italia +# (<http://www.openerp-italia.org>). +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as published +# by the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. +# +############################################################################## +{ + 'name': 'Italian Localisation - Account', + 'version': '0.1', + 'category': 'Localisation/Italy', + 'description': """This module customizes OpenERP in order to fit italian laws and mores - Account version + +Functionalities: + +- Check invoice date consistency + +""", + 'author': 'OpenERP Italian Community', + 'website': 'http://www.openerp-italia.org', + 'license': 'AGPL-3', + "depends" : ['account',], + "data" : [], + "demo_xml" : [], + "active": False, + "installable": True +} +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: + === 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:04:22 +0000 @@ -0,0 +1,47 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Copyright (C) 2010 Associazione OpenERP Italia +# (<http://www.openerp-italia.org>). +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. +# +############################################################################## + +import netsvc +import pooler, tools + +from openerp.osv import fields, osv +from tools.translate import _ + +class account_invoice(osv.osv): + _inherit = 'account.invoice' + + def action_number(self, cr, uid, ids, context=None): + super(account_invoice, self).action_number(cr, uid, ids, context=context) + for obj_inv in self.browse(cr, uid, ids, context=context): + inv_type = obj_inv.type + if inv_type == 'in_invoice' or inv_type == 'in_refund': + return True + number = obj_inv.number + date_invoice = obj_inv.date_invoice + journal = obj_inv.journal_id.id + res = self.search(cr, uid, [('type','=',inv_type),('date_invoice','>',date_invoice), + ('number', '<', number), ('journal_id','=',journal)], context=context) + if res: + raise osv.except_osv(_('Date Inconsistency'), + _('Cannot create invoice! Post the invoice with a greater date')) + return True + +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
_______________________________________________ Mailing list: https://launchpad.net/~openobject-italia-core-devs Post to : [email protected] Unsubscribe : https://launchpad.net/~openobject-italia-core-devs More help : https://help.launchpad.net/ListHelp

