mirror of
https://github.com/OCA/intrastat-extrastat.git
synced 2025-02-16 17:13:41 +02:00
[MIG] intrastat_base: migrate from v16 to v17
This commit is contained in:
@@ -5,11 +5,11 @@
|
||||
|
||||
{
|
||||
"name": "Intrastat Reporting Base",
|
||||
"version": "16.0.1.1.0",
|
||||
"version": "17.0.1.0.0",
|
||||
"category": "Intrastat",
|
||||
"license": "AGPL-3",
|
||||
"summary": "Base module for Intrastat reporting",
|
||||
"author": "ACSONE SA/NV, Akretion,Noviat,Odoo Community Association (OCA)",
|
||||
"author": "ACSONE SA/NV,Akretion,Noviat,Odoo Community Association (OCA)",
|
||||
"maintainers": ["alexis-via", "luc-demeyer"],
|
||||
"website": "https://github.com/OCA/intrastat-extrastat",
|
||||
"depends": ["base_vat", "account"],
|
||||
@@ -20,7 +20,6 @@
|
||||
"views/res_config_settings.xml",
|
||||
"views/intrastat.xml",
|
||||
"views/account_fiscal_position.xml",
|
||||
"views/account_fiscal_position_template.xml",
|
||||
],
|
||||
"demo": ["demo/intrastat_demo.xml"],
|
||||
"installable": True,
|
||||
|
||||
@@ -63,7 +63,7 @@
|
||||
<record id="shipping_costs_exclude" model="product.product">
|
||||
<field name="name">Shipping costs</field>
|
||||
<field name="default_code">SHIP_S</field>
|
||||
<field name="type">service</field>
|
||||
<field name="detailed_type">service</field>
|
||||
<field name="categ_id" ref="product.product_category_all" />
|
||||
<field name="list_price">30</field>
|
||||
<field name="is_accessory_cost" eval="True" />
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
from . import product_template
|
||||
from . import res_company
|
||||
from . import account_fiscal_position
|
||||
from . import account_fiscal_position_template
|
||||
from . import account_move
|
||||
|
||||
@@ -1,18 +0,0 @@
|
||||
# Copyright 2020-2022 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
|
||||
@@ -1,18 +0,0 @@
|
||||
# Copyright 2020-2022 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 api, fields, models
|
||||
|
||||
|
||||
class AccountFiscalPositionTemplate(models.Model):
|
||||
_inherit = "account.fiscal.position.template"
|
||||
|
||||
intrastat = fields.Selection(
|
||||
"_intrastat_selection",
|
||||
help="When set to B2B or B2C, the invoices with this fiscal position will "
|
||||
"be taken into account for the generation of the intrastat reports.",
|
||||
)
|
||||
|
||||
@api.model
|
||||
def _intrastat_selection(self):
|
||||
return self.env["account.fiscal.position"]._intrastat_selection()
|
||||
@@ -35,10 +35,9 @@ class ResCompany(models.Model):
|
||||
@api.depends("intrastat_remind_user_ids", "intrastat_remind_user_ids.email")
|
||||
def _compute_intrastat_email_list(self):
|
||||
for this in self:
|
||||
emails = []
|
||||
for user in this.intrastat_remind_user_ids:
|
||||
if user.email:
|
||||
emails.append(user.email)
|
||||
emails = [
|
||||
user.email for user in this.intrastat_remind_user_ids if user.email
|
||||
]
|
||||
this.intrastat_email_list = ",".join(emails)
|
||||
|
||||
@api.constrains("intrastat_remind_user_ids")
|
||||
|
||||
@@ -27,7 +27,7 @@ class TestIntrastatBase(IntrastatCommon):
|
||||
|
||||
def test_accessory(self):
|
||||
with self.assertRaises(ValidationError):
|
||||
self.shipping_cost.type = "consu"
|
||||
self.shipping_cost.detailed_type = "consu"
|
||||
|
||||
def test_fiscal_position(self):
|
||||
with self.assertRaises(ValidationError):
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
<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="auto_apply" position="after">
|
||||
<field name="intrastat" />
|
||||
</field>
|
||||
</field>
|
||||
|
||||
@@ -1,48 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<!--
|
||||
Copyright 2023 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_template_form" model="ir.ui.view">
|
||||
<field name="name">intrastat.account.fiscal.position.form</field>
|
||||
<field name="model">account.fiscal.position.template</field>
|
||||
<field name="inherit_id" ref="account.view_account_position_template_form" />
|
||||
<field name="arch" type="xml">
|
||||
<field name="name" position="after">
|
||||
<field name="intrastat" />
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
<record id="view_account_position_template_tree" model="ir.ui.view">
|
||||
<field name="name">intrastat.account.fiscal.position.tree</field>
|
||||
<field name="model">account.fiscal.position.template</field>
|
||||
<field name="inherit_id" ref="account.view_account_position_template_tree" />
|
||||
<field name="arch" type="xml">
|
||||
<field name="name" position="after">
|
||||
<field name="intrastat" optional="show" />
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
<record id="view_account_position_template_search" model="ir.ui.view">
|
||||
<field name="model">account.fiscal.position.template</field>
|
||||
<field name="inherit_id" ref="account.view_account_position_template_search" />
|
||||
<field name="arch" type="xml">
|
||||
<field name="name" position="after">
|
||||
<filter
|
||||
name="intrastat"
|
||||
domain="[('intrastat', 'in', ('b2b', 'b2c'))]"
|
||||
string="Intrastat"
|
||||
/>
|
||||
<group name="groupby">
|
||||
<filter
|
||||
name="intrastat_groupby"
|
||||
string="Intrastat"
|
||||
context="{'group_by': 'intrastat'}"
|
||||
/>
|
||||
</group>
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
</odoo>
|
||||
@@ -10,15 +10,11 @@
|
||||
<field name="model">product.template</field>
|
||||
<field name="inherit_id" ref="account.product_template_form_view" />
|
||||
<field name="arch" type="xml">
|
||||
<group name="properties" position="after">
|
||||
<group name="accounting" position="inside">
|
||||
<group string="Intrastat" name="intrastat">
|
||||
<!-- If you need this field, inherit this view in a
|
||||
localisation module to set invisible="0" -->
|
||||
<field
|
||||
name="is_accessory_cost"
|
||||
attrs="{'invisible': [('type', '!=', 'service')]}"
|
||||
invisible="1"
|
||||
/>
|
||||
localisation module to set invisible="type != 'service'" -->
|
||||
<field name="is_accessory_cost" invisible="1" />
|
||||
</group>
|
||||
</group>
|
||||
</field>
|
||||
|
||||
@@ -11,16 +11,14 @@
|
||||
<field name="model">res.config.settings</field>
|
||||
<field name="inherit_id" ref="account.res_config_settings_view_form" />
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//div[@id='storno']" position="after">
|
||||
<h2>Intrastat</h2>
|
||||
<div class="row mt16 o_settings_container" id="intrastat">
|
||||
<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">
|
||||
<block id="storno" position="after">
|
||||
<block id="intrastat" title="Intrastat">
|
||||
<setting id="intrastat">
|
||||
<div class="content-group">
|
||||
<div class="row mt16">
|
||||
<label
|
||||
for="intrastat_remind_user_ids"
|
||||
class="col-md-5"
|
||||
class="col-lg-5 o_light_label"
|
||||
/>
|
||||
<field
|
||||
name="intrastat_remind_user_ids"
|
||||
@@ -28,9 +26,9 @@
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</xpath>
|
||||
</setting>
|
||||
</block>
|
||||
</block>
|
||||
</field>
|
||||
</record>
|
||||
</odoo>
|
||||
|
||||
@@ -21,4 +21,15 @@
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="view_partner_address_form" model="ir.ui.view">
|
||||
<field name="model">res.partner</field>
|
||||
<field name="inherit_id" ref="base.view_partner_address_form" />
|
||||
<field name="arch" type="xml">
|
||||
<field name="country_id" position="attributes">
|
||||
<attribute name="required">1</attribute>
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
</odoo>
|
||||
|
||||
Reference in New Issue
Block a user