diff --git a/account_invoice_control/README.rst b/account_invoice_control/README.rst index c3d050d4..a8a982fe 100644 --- a/account_invoice_control/README.rst +++ b/account_invoice_control/README.rst @@ -1,23 +1,27 @@ -.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg - :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html +.. |company| replace:: ADHOC SA + +.. |company_logo| image:: https://raw.githubusercontent.com/ingadhoc/maintainer-tools/master/resources/adhoc-logo.png + :alt: ADHOC SA + :target: https://www.adhoc.com.ar + +.. |icon| image:: https://raw.githubusercontent.com/ingadhoc/maintainer-tools/master/resources/adhoc-icon.png + +.. image:: https://img.shields.io/badge/license-AGPL--3-blue.png + :target: https://www.gnu.org/licenses/agpl :alt: License: AGPL-3 ========================== Invoice origin and control ========================== -This module add a link from invoices to the purchase orders and sale orders that generate it. - -It also creates a new users group "Restrict Edit Invoice", users in that group can not edit lines of invoices generated from Sale Orders - -WARNING: this module depends on sale and purchase (and purchase on stock), so lot of modules will be installed. +* It also creates a new users group "Restrict Edit Invoice", users in that group can not edit lines of invoices generated from Sale Orders Installation ============ To install this module, you need to: -#. Just install it +#. Only need to install the module Configuration ============= @@ -26,23 +30,22 @@ To configure this module, you need to: #. Set "Restrict Edit Invoice" to the users you want to restrict -.. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas - :alt: Try me on Runbot - :target: https://runbot.adhoc.com.ar/ +Usage +===== -.. repo_id is available in https://github.com/OCA/maintainer-tools/blob/master/tools/repos_with_ids.txt -.. branch is "8.0" for example +To use this module, you need to: -Known issues / Roadmap -====================== +#. Go to ... -* Split this module so it does not require purchase +.. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas + :alt: Try me on Runbot + :target: http://runbot.adhoc.com.ar/ Bug Tracker =========== Bugs are tracked on `GitHub Issues -`_. In case of trouble, please +`_. In case of trouble, please check there if your issue has already been reported. If you spotted it first, help us smashing it by providing a detailed and welcomed feedback. @@ -52,19 +55,16 @@ Credits Images ------ -* ADHOC SA: `Icon `_. +* |company| |icon| Contributors ------------ - Maintainer ---------- -.. image:: http://fotos.subefotos.com/83fed853c1e15a8023b86b2b22d6145bo.png - :alt: Odoo Community Association - :target: https://www.adhoc.com.ar +|company_logo| -This module is maintained by the ADHOC SA. +This module is maintained by the |company|. To contribute to this module, please visit https://www.adhoc.com.ar. diff --git a/account_invoice_control/__init__.py b/account_invoice_control/__init__.py old mode 100755 new mode 100644 index bae6c31a..3d8070cd --- a/account_invoice_control/__init__.py +++ b/account_invoice_control/__init__.py @@ -2,4 +2,3 @@ # For copyright and license notices, see __manifest__.py file in module root # directory ############################################################################## -from . import account_invoice diff --git a/account_invoice_control/__manifest__.py b/account_invoice_control/__manifest__.py index 16ed63f0..e28d8c8a 100644 --- a/account_invoice_control/__manifest__.py +++ b/account_invoice_control/__manifest__.py @@ -20,20 +20,16 @@ { 'name': 'Account Invoice Control', 'author': 'ADHOC SA', - 'version': '9.0.1.3.0', + 'version': '11.0.1.0.0', 'license': 'AGPL-3', 'category': 'Accounting & Finance', 'depends': [ - 'sale', - 'purchase', - 'account_invoice_prices_update', + 'sale_ux', ], - 'test': [], 'data': [ - 'security/security.xml', - 'views/account_invoice_view.xml', - 'views/account_invoice_supplier_view.xml', + 'security/account_invoice_control_security.xml', + 'views/account_invoice_views.xml', ], 'website': 'www.adhoc.com.ar', - 'installable': False, + 'installable': True, } diff --git a/account_invoice_control/account_invoice.py b/account_invoice_control/account_invoice.py deleted file mode 100755 index 33949f9b..00000000 --- a/account_invoice_control/account_invoice.py +++ /dev/null @@ -1,33 +0,0 @@ -# -*- encoding: utf-8 -*- -############################################################################## -# For copyright and license notices, see __manifest__.py file in root directory -############################################################################## -from odoo import fields, models, api - - -class AccountInvoice(models.Model): - - _inherit = 'account.invoice' - - sale_order_ids = fields.Many2many( - 'sale.order', - compute='compute_sale_orders' - ) - purchase_order_ids = fields.Many2many( - 'purchase.order', - compute='compute_purchase_orders' - ) - - @api.multi - def compute_purchase_orders(self): - for rec in self: - rec.purchase_order_ids = self.env['purchase.order.line'].search( - [('invoice_lines', 'in', rec.invoice_line_ids.ids)]).mapped( - 'order_id') - - @api.multi - def compute_sale_orders(self): - for rec in self: - rec.sale_order_ids = self.env['sale.order.line'].search( - [('invoice_lines', 'in', rec.invoice_line_ids.ids)]).mapped( - 'order_id') diff --git a/account_invoice_control/security/security.xml b/account_invoice_control/security/account_invoice_control_security.xml similarity index 80% rename from account_invoice_control/security/security.xml rename to account_invoice_control/security/account_invoice_control_security.xml index c21b0627..2b56c5d8 100644 --- a/account_invoice_control/security/security.xml +++ b/account_invoice_control/security/account_invoice_control_security.xml @@ -1,11 +1,8 @@ - - + Restrict Edit Invoice - - - + diff --git a/account_invoice_control/views/account_invoice_supplier_view.xml b/account_invoice_control/views/account_invoice_supplier_view.xml deleted file mode 100644 index b74e370f..00000000 --- a/account_invoice_control/views/account_invoice_supplier_view.xml +++ /dev/null @@ -1,67 +0,0 @@ - - - - - - invoice.supplier.form.inherit - account.invoice - - 20 - - - - - - - - - - - - diff --git a/account_invoice_control/views/account_invoice_view.xml b/account_invoice_control/views/account_invoice_view.xml deleted file mode 100755 index f28d9855..00000000 --- a/account_invoice_control/views/account_invoice_view.xml +++ /dev/null @@ -1,70 +0,0 @@ - - - - - - invoice.form.inherit - account.invoice - - 20 - - - - - - - - - - - invoice.form.inherit - account.invoice - - - 20 - - - {'readonly':[('type','=','out_invoice'),('sale_order_ids','!=',[])]} - - - - {'readonly':[('type','=','out_invoice'),('sale_order_ids','!=',[])]} - - - {'readonly':[('type','=','out_invoice'),('sale_order_ids','!=',[])]} - - - {'readonly':[('type','=','out_invoice'),('sale_order_ids','!=',[])]} - - - {'readonly':[('type','=','out_invoice'),('sale_order_ids','!=',[])]} - - - {'readonly':[('type','=','out_invoice'),('sale_order_ids','!=',[])]} - - - {'readonly':[('type','=','out_invoice'),('sale_order_ids','!=',[])]} - - - {'readonly':[('type','=','out_invoice'),('sale_order_ids','!=',[])]} - - - {'readonly':[('type','=','out_invoice'),('sale_order_ids','!=',[])]} - - - {'readonly':[('type','=','out_invoice'),('sale_order_ids','!=',[])]} - - - {'readonly':[('type','=','out_invoice'),('sale_order_ids','!=',[])]} - - - {'readonly':[('type','=','out_invoice'),('sale_order_ids','!=',[])]} - - - - - - - diff --git a/account_invoice_control/views/account_invoice_views.xml b/account_invoice_control/views/account_invoice_views.xml new file mode 100644 index 00000000..d4f24df9 --- /dev/null +++ b/account_invoice_control/views/account_invoice_views.xml @@ -0,0 +1,50 @@ + + + + + invoice.form.inherit + account.invoice + + + 20 + + + {'readonly':[('type','=','out_invoice'),('sale_order_ids','!=',[])]} + + + {'readonly':[('type','=','out_invoice'),('sale_order_ids','!=',[])]} + + + {'readonly':[('type','=','out_invoice'),('sale_order_ids','!=',[])]} + + + {'readonly':[('type','=','out_invoice'),('sale_order_ids','!=',[])]} + + + {'readonly':[('type','=','out_invoice'),('sale_order_ids','!=',[])]} + + + {'readonly':[('type','=','out_invoice'),('sale_order_ids','!=',[])]} + + + {'readonly':[('type','=','out_invoice'),('sale_order_ids','!=',[])]} + + + {'readonly':[('type','=','out_invoice'),('sale_order_ids','!=',[])]} + + + {'readonly':[('type','=','out_invoice'),('sale_order_ids','!=',[])]} + + + {'readonly':[('type','=','out_invoice'),('sale_order_ids','!=',[])]} + + + {'readonly':[('type','=','out_invoice'),('sale_order_ids','!=',[])]} + + + {'readonly':[('type','=','out_invoice'),('sale_order_ids','!=',[])]} + + + + + diff --git a/oca_dependencies.txt b/oca_dependencies.txt index c8a88e82..4417c378 100644 --- a/oca_dependencies.txt +++ b/oca_dependencies.txt @@ -1,2 +1,3 @@ # web ingadhoc-account-financial-tools https://github.com/ingadhoc/account-financial-tools.git +ingadhoc-sale https://github.com/ingadhoc/sale.git