[14.0][IMP] intrastat_base: Split models files

This commit is contained in:
Denis Roussel
2021-10-23 20:23:45 +02:00
committed by Alexis de Lattre
parent 2c34086a30
commit cb08d5059a
3 changed files with 31 additions and 15 deletions

View File

@@ -0,0 +1,17 @@
# Copyright 2020 Akretion France (http://www.akretion.com/)
# @author: <alexis.delattre@akretion.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo import models
class AccountChartTemplate(models.Model):
_inherit = "account.chart.template"
def _get_fp_vals(self, company, position):
"""
Get fiscal position chart template instrastat value
to create fiscal position
"""
vals = super()._get_fp_vals(company, position)
vals["intrastat"] = position.intrastat
return vals

View File

@@ -13,18 +13,3 @@ class AccountFiscalPosition(models.Model):
help="Set to True if the invoices with this fiscal position should "
"be taken into account for the generation of the intrastat reports.",
)
class AccountFiscalPositionTemplate(models.Model):
_inherit = "account.fiscal.position.template"
intrastat = fields.Boolean(string="Intrastat")
class AccountChartTemplate(models.Model):
_inherit = "account.chart.template"
def _get_fp_vals(self, company, position):
vals = super()._get_fp_vals(company, position)
vals["intrastat"] = position.intrastat
return vals

View File

@@ -0,0 +1,14 @@
# Copyright 2020 Akretion France (http://www.akretion.com/)
# @author: <alexis.delattre@akretion.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo import fields, models
class AccountFiscalPositionTemplate(models.Model):
_inherit = "account.fiscal.position.template"
intrastat = fields.Boolean(
string="Intrastat",
help="Check this if you want to generate intrastat declarations with"
"the created fiscal position",
)