diff --git a/account_move_line_tax_editable/__init__.py b/account_move_line_tax_editable/__init__.py index e69de29b..0650744f 100644 --- a/account_move_line_tax_editable/__init__.py +++ 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 index 5b1603e7..217050c8 100644 --- a/account_move_line_tax_editable/__manifest__.py +++ b/account_move_line_tax_editable/__manifest__.py @@ -5,7 +5,7 @@ { 'name': 'Account Move Line Tax Editable', 'summary': """ - Allows to edit taxes on account move lines""", + 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)', diff --git a/account_move_line_tax_editable/i18n/de.po b/account_move_line_tax_editable/i18n/de.po new file mode 100644 index 00000000..af81589c --- /dev/null +++ b/account_move_line_tax_editable/i18n/de.po @@ -0,0 +1,29 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * account_move_line_tax_editable +# +# Translators: +# Rudolf Schnapka , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-12-22 23:21+0000\n" +"PO-Revision-Date: 2017-12-22 23:21+0000\n" +"Last-Translator: Rudolf Schnapka , 2017\n" +"Language-Team: German (https://www.transifex.com/oca/teams/23907/de/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: de\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#. module: account_move_line_tax_editable +#: model:ir.model.fields,field_description:account_move_line_tax_editable.field_account_move_line_is_tax_editable +msgid "Is tax data editable?" +msgstr "" + +#. module: account_move_line_tax_editable +#: model:ir.model,name:account_move_line_tax_editable.model_account_move_line +msgid "Journal Item" +msgstr "Journalposten" diff --git a/account_move_line_tax_editable/i18n/es_EC.po b/account_move_line_tax_editable/i18n/es_EC.po new file mode 100644 index 00000000..2e96053f --- /dev/null +++ b/account_move_line_tax_editable/i18n/es_EC.po @@ -0,0 +1,29 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * account_move_line_tax_editable +# +# Translators: +# Cristian Salamea , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-05-30 00:47+0000\n" +"PO-Revision-Date: 2017-05-30 00:47+0000\n" +"Last-Translator: Cristian Salamea , 2017\n" +"Language-Team: Spanish (Ecuador) (https://www.transifex.com/oca/teams/23907/es_EC/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: es_EC\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#. module: account_move_line_tax_editable +#: model:ir.model.fields,field_description:account_move_line_tax_editable.field_account_move_line_is_tax_editable +msgid "Is tax data editable?" +msgstr "" + +#. module: account_move_line_tax_editable +#: model:ir.model,name:account_move_line_tax_editable.model_account_move_line +msgid "Journal Item" +msgstr "Detalle Contable" diff --git a/account_move_line_tax_editable/i18n/hr.po b/account_move_line_tax_editable/i18n/hr.po new file mode 100644 index 00000000..5711123a --- /dev/null +++ b/account_move_line_tax_editable/i18n/hr.po @@ -0,0 +1,29 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * account_move_line_tax_editable +# +# Translators: +# Bole , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-05-30 00:47+0000\n" +"PO-Revision-Date: 2017-05-30 00:47+0000\n" +"Last-Translator: Bole , 2017\n" +"Language-Team: Croatian (https://www.transifex.com/oca/teams/23907/hr/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: hr\n" +"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n" + +#. module: account_move_line_tax_editable +#: model:ir.model.fields,field_description:account_move_line_tax_editable.field_account_move_line_is_tax_editable +msgid "Is tax data editable?" +msgstr "" + +#. module: account_move_line_tax_editable +#: model:ir.model,name:account_move_line_tax_editable.model_account_move_line +msgid "Journal Item" +msgstr "Stavka dnevnika" diff --git a/account_move_line_tax_editable/i18n/tr_TR.po b/account_move_line_tax_editable/i18n/tr_TR.po new file mode 100644 index 00000000..b08d5118 --- /dev/null +++ b/account_move_line_tax_editable/i18n/tr_TR.po @@ -0,0 +1,29 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * account_move_line_tax_editable +# +# Translators: +# Ediz Duman , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-05-30 00:47+0000\n" +"PO-Revision-Date: 2017-05-30 00:47+0000\n" +"Last-Translator: Ediz Duman , 2017\n" +"Language-Team: Turkish (Turkey) (https://www.transifex.com/oca/teams/23907/tr_TR/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: tr_TR\n" +"Plural-Forms: nplurals=1; plural=0;\n" + +#. module: account_move_line_tax_editable +#: model:ir.model.fields,field_description:account_move_line_tax_editable.field_account_move_line_is_tax_editable +msgid "Is tax data editable?" +msgstr "" + +#. module: account_move_line_tax_editable +#: model:ir.model,name:account_move_line_tax_editable.model_account_move_line +msgid "Journal Item" +msgstr "Yevmiye Öğe" 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 00000000..8795b3be --- /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 00000000..551ce637 --- /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/views/account_move.xml b/account_move_line_tax_editable/views/account_move.xml index 104ab95e..a430cb2d 100644 --- a/account_move_line_tax_editable/views/account_move.xml +++ b/account_move_line_tax_editable/views/account_move.xml @@ -11,8 +11,10 @@ - - + + + diff --git a/account_move_line_tax_editable/views/account_move_line.xml b/account_move_line_tax_editable/views/account_move_line.xml index 110de0f6..30e55648 100644 --- a/account_move_line_tax_editable/views/account_move_line.xml +++ b/account_move_line_tax_editable/views/account_move_line.xml @@ -10,11 +10,16 @@ account.move.line + + + 0 + {'readonly': [('is_tax_editable', '=', False)]} 0 + {'readonly': [('is_tax_editable', '=', False)]}