2
0
account-financial-tools/account_move_line_tax_editable/models/account_move_line.py
Fekete Mihai 9b5a36a013 Migrate account_move_line_tax_ediatble to 11.0
Update __manifest__.py
2023-05-24 09:26:37 +02:00

24 lines
621 B
Python

# 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'