diff --git a/sale_force_invoice_status/__init__.py b/sale_force_invoice_status/__init__.py deleted file mode 100644 index 78a9604..0000000 --- a/sale_force_invoice_status/__init__.py +++ /dev/null @@ -1,3 +0,0 @@ -# -*- coding: utf-8 -*- - -from . import sale diff --git a/sale_force_invoice_status/__manifest__.py b/sale_force_invoice_status/__manifest__.py deleted file mode 100644 index 1d99a42..0000000 --- a/sale_force_invoice_status/__manifest__.py +++ /dev/null @@ -1,28 +0,0 @@ -# -*- coding: utf-8 -*- -# © 2018 Akretion (http://www.akretion.com) -# @author Alexis de Lattre -# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). - -{ - 'name': 'Sale Force Invoice Status', - 'version': '10.0.1.0.0', - 'category': 'Sales', - 'license': 'AGPL-3', - 'summary': 'Allows to force a sale order to invoiced status', - 'description': """ -Sale Force Invoice Status -========================= - -Add a button on sale orders that allow to force the *Invoice Status* of the order to *Invoiced* (button restricted to members of the *Sale Manager* group). - -This module has been written by Alexis de Lattre from Akretion -. - """, - 'author': 'Akretion', - 'website': 'http://www.akretion.com', - 'depends': ['sale'], - 'data': [ - 'sale_view.xml', - ], - 'installable': True, -} diff --git a/sale_force_invoice_status/sale.py b/sale_force_invoice_status/sale.py deleted file mode 100644 index fda5547..0000000 --- a/sale_force_invoice_status/sale.py +++ /dev/null @@ -1,41 +0,0 @@ -# -*- coding: utf-8 -*- -# Copyright (C) 2018 Akretion (http://www.akretion.com) -# @author Alexis de Lattre - -from odoo import models, fields, api, _ -from odoo.exceptions import UserError - - -class SaleOrder(models.Model): - _inherit = 'sale.order' - - def force_invoice_status_to_invoiced(self): - for order in self: - if order.state not in ('sale', 'done'): - raise UserError(_( - "You are trying to force the sale order %s to invoiced " - "but it is not in 'Sales Order' or 'Locked' state.") - % order.name) - if order.invoice_status != 'to invoice': - raise UserError(_( - "You are trying to force the sale order %s to invoiced " - "but its invoice status is not 'To Invoice'.") - % order.name) - order.order_line.write({'forced_to_invoiced': True}) - order.message_post(_( - "Order forced to Invoiced via the special button")) - - -class SaleOrderLine(models.Model): - _inherit = 'sale.order.line' - - forced_to_invoiced = fields.Boolean() - - @api.depends( - 'state', 'product_uom_qty', 'qty_delivered', 'qty_to_invoice', - 'qty_invoiced', 'forced_to_invoiced') - def _compute_invoice_status(self): - super(SaleOrderLine, self)._compute_invoice_status() - for line in self: - if line.state in ('sale', 'done') and line.forced_to_invoiced: - line.invoice_status = 'invoiced' diff --git a/sale_force_invoice_status/sale_view.xml b/sale_force_invoice_status/sale_view.xml deleted file mode 100644 index 16d01ac..0000000 --- a/sale_force_invoice_status/sale_view.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - sale_force_invoice_status.sale.order.form - sale.order - - - - - - - -