diff --git a/account_move_line_tax_editable/README.rst b/account_move_line_tax_editable/README.rst new file mode 100644 index 000000000..70a74b9ed --- /dev/null +++ b/account_move_line_tax_editable/README.rst @@ -0,0 +1,41 @@ +.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg + :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html + :alt: License: AGPL-3 + +============================== +Account Move Line Tax Editable +============================== + +Allows to edit taxes on account move lines + +Bug Tracker +=========== + +Bugs are tracked on `GitHub Issues +`_. 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. + +Credits +======= + +Contributors +------------ + +* Thomas Binsfeld +* Benjamin Willig + +Maintainer +---------- + +.. image:: https://odoo-community.org/logo.png + :alt: Odoo Community Association + :target: https://odoo-community.org + +This module is maintained by the OCA. + +OCA, or the Odoo Community Association, is a nonprofit organization whose +mission is to support the collaborative development of Odoo features and +promote its widespread use. + +To contribute to this module, please visit https://odoo-community.org. diff --git a/account_move_line_tax_editable/__init__.py b/account_move_line_tax_editable/__init__.py new file mode 100644 index 000000000..0650744f6 --- /dev/null +++ b/account_move_line_tax_editable/__init__.py @@ -0,0 +1 @@ +from . import models diff --git a/account_move_line_tax_editable/__manifest__.py b/account_move_line_tax_editable/__manifest__.py new file mode 100644 index 000000000..217050c8a --- /dev/null +++ b/account_move_line_tax_editable/__manifest__.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +# Copyright 2017 ACSONE SA/NV +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +{ + 'name': 'Account Move Line Tax Editable', + 'summary': """ + Allows to edit taxes on non-posted account move lines""", + 'version': '10.0.1.0.0', + 'license': 'AGPL-3', + 'author': 'ACSONE SA/NV,Odoo Community Association (OCA)', + 'website': 'https://www.acsone.eu', + 'depends': [ + 'account', + ], + 'data': [ + 'views/account_move.xml', + 'views/account_move_line.xml', + ], + 'demo': [ + ], +} diff --git a/account_move_line_tax_editable/models/__init__.py b/account_move_line_tax_editable/models/__init__.py new file mode 100644 index 000000000..8795b3bea --- /dev/null +++ b/account_move_line_tax_editable/models/__init__.py @@ -0,0 +1 @@ +from . import account_move_line diff --git a/account_move_line_tax_editable/models/account_move_line.py b/account_move_line_tax_editable/models/account_move_line.py new file mode 100644 index 000000000..551ce637a --- /dev/null +++ b/account_move_line_tax_editable/models/account_move_line.py @@ -0,0 +1,24 @@ +# -*- coding: utf-8 -*- +# Copyright 2017 ACSONE SA/NV +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from odoo import api, fields, models + + +class AccountMoveLine(models.Model): + + _inherit = 'account.move.line' + + is_tax_editable = fields.Boolean( + string="Is tax data editable?", compute='_compute_is_tax_editable') + + @api.multi + @api.depends('move_id.state') + def _compute_is_tax_editable(self): + for rec in self: + rec.is_tax_editable = rec._get_is_tax_editable() + + @api.multi + def _get_is_tax_editable(self): + self.ensure_one() + return self.move_id.state == 'draft' diff --git a/account_move_line_tax_editable/static/description/icon.png b/account_move_line_tax_editable/static/description/icon.png new file mode 100644 index 000000000..3a0328b51 Binary files /dev/null and b/account_move_line_tax_editable/static/description/icon.png differ diff --git a/account_move_line_tax_editable/views/account_move.xml b/account_move_line_tax_editable/views/account_move.xml new file mode 100644 index 000000000..a430cb2d0 --- /dev/null +++ b/account_move_line_tax_editable/views/account_move.xml @@ -0,0 +1,23 @@ + + + + + + + + account.move.form (in account_move_line_tax_editable) + account.move + + + + + + + + + + + + diff --git a/account_move_line_tax_editable/views/account_move_line.xml b/account_move_line_tax_editable/views/account_move_line.xml new file mode 100644 index 000000000..30e556488 --- /dev/null +++ b/account_move_line_tax_editable/views/account_move_line.xml @@ -0,0 +1,28 @@ + + + + + + + + account.move.line.form (in account_move_line_tax_editable) + account.move.line + + + + + + + 0 + {'readonly': [('is_tax_editable', '=', False)]} + + + 0 + {'readonly': [('is_tax_editable', '=', False)]} + + + + + + diff --git a/setup/account_move_line_tax_editable/odoo/__init__.py b/setup/account_move_line_tax_editable/odoo/__init__.py new file mode 100644 index 000000000..de40ea7ca --- /dev/null +++ b/setup/account_move_line_tax_editable/odoo/__init__.py @@ -0,0 +1 @@ +__import__('pkg_resources').declare_namespace(__name__) diff --git a/setup/account_move_line_tax_editable/odoo/addons/__init__.py b/setup/account_move_line_tax_editable/odoo/addons/__init__.py new file mode 100644 index 000000000..de40ea7ca --- /dev/null +++ b/setup/account_move_line_tax_editable/odoo/addons/__init__.py @@ -0,0 +1 @@ +__import__('pkg_resources').declare_namespace(__name__) diff --git a/setup/account_move_line_tax_editable/odoo/addons/account_move_line_tax_editable b/setup/account_move_line_tax_editable/odoo/addons/account_move_line_tax_editable new file mode 120000 index 000000000..528a49c6b --- /dev/null +++ b/setup/account_move_line_tax_editable/odoo/addons/account_move_line_tax_editable @@ -0,0 +1 @@ +../../../../account_move_line_tax_editable \ No newline at end of file diff --git a/setup/account_move_line_tax_editable/setup.py b/setup/account_move_line_tax_editable/setup.py new file mode 100644 index 000000000..28c57bb64 --- /dev/null +++ b/setup/account_move_line_tax_editable/setup.py @@ -0,0 +1,6 @@ +import setuptools + +setuptools.setup( + setup_requires=['setuptools-odoo'], + odoo_addon=True, +)