mirror of
https://github.com/OCA/intrastat-extrastat.git
synced 2025-02-16 17:13:41 +02:00
intrastat_base: use fiscal position, following suggestion on issue #110
Improve layout of config page
This commit is contained in:
30
intrastat_base/models/account_fiscal_position.py
Normal file
30
intrastat_base/models/account_fiscal_position.py
Normal file
@@ -0,0 +1,30 @@
|
||||
# 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 AccountFiscalPosition(models.Model):
|
||||
_inherit = "account.fiscal.position"
|
||||
|
||||
intrastat = fields.Boolean(
|
||||
string="Intrastat",
|
||||
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
|
||||
Reference in New Issue
Block a user