diff --git a/delivery_no_invoice_shipping/__init__.py b/delivery_no_invoice_shipping/__init__.py new file mode 100644 index 0000000..cefb61f --- /dev/null +++ b/delivery_no_invoice_shipping/__init__.py @@ -0,0 +1,23 @@ +# -*- encoding: utf-8 -*- +############################################################################## +# +# Delivery no Invoice Shipping module for Odoo +# Copyright (C) 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 . import stock diff --git a/delivery_no_invoice_shipping/__openerp__.py b/delivery_no_invoice_shipping/__openerp__.py new file mode 100644 index 0000000..eacbc33 --- /dev/null +++ b/delivery_no_invoice_shipping/__openerp__.py @@ -0,0 +1,43 @@ +# -*- encoding: utf-8 -*- +############################################################################## +# +# Delivery No Invoice Shipping module for Odoo +# Copyright (C) 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': 'Delivery No Invoice Shipping', + 'version': '0.1', + 'category': 'Sales Management', + 'license': 'AGPL-3', + 'summary': 'When invoicing from delivery, do not add shipping costs', + 'description': """ +Delivery No Invoice Shipping +============================ + +By default, when the delivery module is installed and you create an invoice from a delivery picking, Odoo will add an invoice line for the shipping costs if there is not already such a line in the order. This module avoids that: no additionnal invoice line will be added when invoicing from delivery. + +This module has been written by Alexis de Lattre from Akretion . + """, + 'author': 'Akretion', + 'website': 'http://www.akretion.com', + 'depends': ['delivery'], + 'data': [], + 'installable': True, +} diff --git a/delivery_no_invoice_shipping/stock.py b/delivery_no_invoice_shipping/stock.py new file mode 100644 index 0000000..af22be1 --- /dev/null +++ b/delivery_no_invoice_shipping/stock.py @@ -0,0 +1,32 @@ +# -*- encoding: utf-8 -*- +############################################################################## +# +# Delivery no Invoice Shipping module for Odoo +# Copyright (C) 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 + + +class StockPicking(models.Model): + _inherit = 'stock.picking' + + def _prepare_shipping_invoice_line( + self, cr, uid, picking, invoice, context=None): + '''Don't add an invoice line for shipping costs''' + return None