2017-05-29 12:54:56 +02:00
|
|
|
# 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):
|
|
|
|
|
2020-01-30 18:23:55 +01:00
|
|
|
_inherit = "account.move.line"
|
2017-05-29 12:54:56 +02:00
|
|
|
|
|
|
|
is_tax_editable = fields.Boolean(
|
2020-01-30 18:23:55 +01:00
|
|
|
string="Is tax data editable?", compute="_compute_is_tax_editable"
|
|
|
|
)
|
2017-05-29 12:54:56 +02:00
|
|
|
|
2020-01-30 18:23:55 +01:00
|
|
|
@api.depends("move_id.state")
|
2017-05-29 12:54:56 +02:00
|
|
|
def _compute_is_tax_editable(self):
|
|
|
|
for rec in self:
|
2020-01-30 18:23:55 +01:00
|
|
|
rec.is_tax_editable = rec.move_id.state == "draft"
|