mirror of
https://github.com/OCA/account-financial-tools.git
synced 2025-02-02 12:47:26 +02:00
Change compared to 8.0: * period_id has been replace by operations an the date field * tax_code_id has been replaced by analysis_tax, a computed fields based an the tax analysis_name, based on description and name
22 lines
577 B
Python
22 lines
577 B
Python
# -*- coding: utf-8 -*-
|
|
# Copyright 2018 ACSONE SA/NV
|
|
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
|
|
|
from odoo import api, fields, models
|
|
|
|
|
|
class AccountTax(models.Model):
|
|
|
|
_inherit = 'account.tax'
|
|
|
|
analysis_name = fields.Char(compute="_compute_analysis_name")
|
|
|
|
@api.multi
|
|
@api.depends("name", "description")
|
|
def _compute_analysis_name(self):
|
|
for tax in self:
|
|
if tax.description:
|
|
tax.analysis_name = "%s - %s" % (tax.description, tax.name)
|
|
else:
|
|
tax.analysis_name = tax.name
|