diff --git a/stock_invoice_try_again/__init__.py b/stock_invoice_try_again/__init__.py deleted file mode 100644 index b857415..0000000 --- a/stock_invoice_try_again/__init__.py +++ /dev/null @@ -1,3 +0,0 @@ -# -*- coding: utf-8 -*- - -from . import stock diff --git a/stock_invoice_try_again/__manifest__.py b/stock_invoice_try_again/__manifest__.py deleted file mode 100644 index 9a5c786..0000000 --- a/stock_invoice_try_again/__manifest__.py +++ /dev/null @@ -1,43 +0,0 @@ -# -*- coding: utf-8 -*- -############################################################################## -# -# Stock Invoice Try Again module for Odoo -# Copyright (C) 2013-2015 Akretion (http://www.akretion.com) -# @author Alexis de Lattre -# -# 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 Affero 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 . -# -############################################################################## - - -{ - 'name': 'Stock Invoice Try Again', - 'version': '0.1', - 'category': 'Accounting & Finance', - 'license': 'AGPL-3', - 'summary': 'Add a button to set a picking back to "To Be Invoiced"', - 'description': """ -Stock Invoice Try Again -======================= - -When the sale order has 'Create Invoice' set to 'On Delivery Order', there is a button 'Create Invoice' on the Delivery Order once the goods are shipped. When the user clicks on this button, OpenERP creates a draft invoice. If the user deletes this draft invoice by mistake, he cannot re-create the invoice. This module is the solution : if the invoice has been deleted, the user can set the picking back to 'To Be Invoiced' and create the invoice again. - -Please contact Alexis de Lattre from Akretion for any help or question about this module. - """, - 'author': 'Akretion', - 'website': 'http://www.akretion.com', - 'depends': ['stock_picking_invoice_link', 'stock_account'], - 'data': ['stock_view.xml'], - 'installable': False, -} diff --git a/stock_invoice_try_again/stock.py b/stock_invoice_try_again/stock.py deleted file mode 100644 index d791e38..0000000 --- a/stock_invoice_try_again/stock.py +++ /dev/null @@ -1,45 +0,0 @@ -# -*- coding: utf-8 -*- -############################################################################## -# -# Stock Invoice Try Again module for Odoo -# Copyright (C) 2013-2015 Akretion (http://www.akretion.com) -# @author Alexis de Lattre -# -# 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 Affero 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 . -# -############################################################################## - -from openerp import models, api, _ -from openerp.exceptions import Warning as UserError - - -class StockPicking(models.Model): - _inherit = 'stock.picking' - - @api.multi - def revert_to_tobeinvoiced(self): - self.ensure_one() - if self.invoice_state == 'invoiced': - if self.invoice_id: - raise UserError(_( - "This picking is linked to the invoice with " - "description '%s'. You should first delete this " - "invoice and try again.") - % self.invoice_id.name) - self.invoice_state = '2binvoiced' - else: - raise UserError(_( - "You can only do this when the Delivery Order " - "has 'Invoice State' = 'Invoiced'.")) - return True diff --git a/stock_invoice_try_again/stock_view.xml b/stock_invoice_try_again/stock_view.xml deleted file mode 100644 index c44440d..0000000 --- a/stock_invoice_try_again/stock_view.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - - stock_invoice_try_again.view_picking_form - stock.picking - - - - - - - - -