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:
@@ -1 +1,2 @@
|
||||
from . import models
|
||||
from . import wizards
|
||||
|
||||
@@ -19,9 +19,9 @@
|
||||
"views/product_template.xml",
|
||||
"views/res_partner.xml",
|
||||
"views/res_country.xml",
|
||||
"views/account_tax.xml",
|
||||
"views/res_config_settings.xml",
|
||||
"views/intrastat.xml",
|
||||
"views/account_fiscal_position.xml",
|
||||
],
|
||||
"demo": ["demo/intrastat_demo.xml"],
|
||||
"installable": True,
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
from . import res_country
|
||||
from . import product_template
|
||||
from . import account_tax
|
||||
from . import res_company
|
||||
from . import res_config_settings
|
||||
from . import intrastat_common
|
||||
from . import account_fiscal_position
|
||||
|
||||
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
|
||||
@@ -1,26 +0,0 @@
|
||||
# Copyright 2011-2020 Akretion France (http://www.akretion.com).
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
|
||||
from odoo import fields, models
|
||||
|
||||
|
||||
class AccountTax(models.Model):
|
||||
_inherit = "account.tax"
|
||||
|
||||
exclude_from_intrastat_if_present = fields.Boolean(
|
||||
string="Exclude invoice line from intrastat if this tax is present",
|
||||
help="If this tax is present on an invoice line, this invoice "
|
||||
"line will be skipped when generating Intrastat Product or "
|
||||
"Service lines from invoices.",
|
||||
)
|
||||
|
||||
|
||||
class AccountTaxTemplate(models.Model):
|
||||
_inherit = "account.tax.template"
|
||||
|
||||
exclude_from_intrastat_if_present = fields.Boolean(
|
||||
string="Exclude invoice line from intrastat if this tax is present",
|
||||
help="If this tax is present on an invoice line, this invoice "
|
||||
"line will be skipped when generating Intrastat Product or "
|
||||
"Service lines from invoices.",
|
||||
)
|
||||
28
intrastat_base/views/account_fiscal_position.xml
Normal file
28
intrastat_base/views/account_fiscal_position.xml
Normal file
@@ -0,0 +1,28 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<!--
|
||||
Copyright 2020 Akretion France (https://akretion.com/)
|
||||
@author: Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
-->
|
||||
<odoo>
|
||||
<record id="view_account_position_form" model="ir.ui.view">
|
||||
<field name="name">intrastat.account.fiscal.position.form</field>
|
||||
<field name="model">account.fiscal.position</field>
|
||||
<field name="inherit_id" ref="account.view_account_position_form" />
|
||||
<field name="arch" type="xml">
|
||||
<field name="vat_required" position="after">
|
||||
<field name="intrastat"/>
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
<record id="view_account_position_tree" model="ir.ui.view">
|
||||
<field name="name">intrastat.account.fiscal.position.tree</field>
|
||||
<field name="model">account.fiscal.position</field>
|
||||
<field name="inherit_id" ref="account.view_account_position_tree" />
|
||||
<field name="arch" type="xml">
|
||||
<field name="name" position="after">
|
||||
<field name="intrastat" optional="show"/>
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
</odoo>
|
||||
@@ -1,18 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<!--
|
||||
Copyright 2011-2020 Akretion France (http://www.akretion.com/)
|
||||
@author: Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
-->
|
||||
<odoo>
|
||||
<record id="view_tax_form" model="ir.ui.view">
|
||||
<field name="name">intrastat.base.tax</field>
|
||||
<field name="model">account.tax</field>
|
||||
<field name="inherit_id" ref="account.view_tax_form" />
|
||||
<field name="arch" type="xml">
|
||||
<group name="advanced_booleans" position="inside">
|
||||
<field name="exclude_from_intrastat_if_present" />
|
||||
</group>
|
||||
</field>
|
||||
</record>
|
||||
</odoo>
|
||||
@@ -14,13 +14,13 @@
|
||||
<xpath expr="//div[@id='analytic']" position="after">
|
||||
<h2>Intrastat</h2>
|
||||
<div class="row mt16 o_settings_container" id="intrastat">
|
||||
<div class="col-xs-12 col-md-12 o_setting_box">
|
||||
<div class="col-12 col-lg-12 o_setting_box" id="intrastat-settings">
|
||||
<div class="o_setting_left_pane" />
|
||||
<div class="o_setting_right_pane">
|
||||
<div class="row">
|
||||
<label
|
||||
for="intrastat_remind_user_ids"
|
||||
class="col-md-5 o_light_label"
|
||||
class="col-md-5"
|
||||
/>
|
||||
<field
|
||||
name="intrastat_remind_user_ids"
|
||||
|
||||
1
intrastat_base/wizards/__init__.py
Normal file
1
intrastat_base/wizards/__init__.py
Normal file
@@ -0,0 +1 @@
|
||||
from . import res_config_settings
|
||||
Reference in New Issue
Block a user