[MIG] intrastat_base: Migration to v10

* Update README.rst: switch to new intrastat project
* Move Intrastat menu entry to Accounting > Report instead of Accounting > Report > PDF Reports (because intrastat reports are not in PDF !)
This commit is contained in:
Alexis de Lattre
2016-10-11 14:59:28 +02:00
parent e10548ed3d
commit 35c04a5ded
19 changed files with 206 additions and 350 deletions

View File

@@ -43,13 +43,13 @@ It adds a tab *Intrastat* on the company form view.
.. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas .. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas
:alt: Try me on Runbot :alt: Try me on Runbot
:target: https://runbot.odoo-community.org/runbot/91/8.0 :target: https://runbot.odoo-community.org/runbot/227/10.0
Bug Tracker Bug Tracker
=========== ===========
Bugs are tracked on `GitHub Issues Bugs are tracked on `GitHub Issues
<https://github.com/OCA/account-financial-reporting/issues>`_. In case <https://github.com/OCA/intrastat/issues>`_. In case
of trouble, please check there if your issue has already been reported. of trouble, please check there if your issue has already been reported.
If you spotted it first, help us smashing it by providing a detailed and If you spotted it first, help us smashing it by providing a detailed and
welcomed feedback. welcomed feedback.

View File

@@ -0,0 +1,28 @@
# -*- coding: utf-8 -*-
# © 2011-2016 Akretion (http://www.akretion.com)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
{
'name': 'Intrastat Reporting Base',
'version': '10.0.1.0.0',
'category': 'Intrastat',
'license': 'AGPL-3',
'summary': 'Base module for Intrastat reporting',
'author': 'Akretion,Odoo Community Association (OCA)',
'website': 'http://www.akretion.com',
'depends': ['base_vat'],
'conflicts': ['report_intrastat'],
'data': [
'data/country_data.xml',
'views/product_template.xml',
'views/res_partner.xml',
'views/res_country.xml',
'views/account_tax.xml',
'views/account_config_settings.xml',
'views/intrastat.xml',
],
'demo': [
'demo/intrastat_demo.xml',
],
'installable': True,
}

View File

@@ -1,46 +0,0 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# Intrastat base module for Odoo
# Copyright (C) 2011-2015 Akretion (http://www.akretion.com)
# @author Alexis de Lattre <alexis.delattre@akretion.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
{
'name': 'Intrastat Reporting Base',
'version': '8.0.1.3.0',
'category': 'Intrastat',
'license': 'AGPL-3',
'summary': 'Base module for Intrastat reporting',
'author': 'Akretion,Odoo Community Association (OCA)',
'website': 'http://www.akretion.com',
'depends': ['base_vat'],
'conflicts': ['report_intrastat'],
'data': [
'data/country_data.xml',
'views/product_template.xml',
'views/res_partner.xml',
'views/res_country.xml',
'views/account_tax.xml',
'views/res_company.xml',
'views/intrastat.xml',
],
'demo': [
'demo/intrastat_demo.xml',
],
'installable': True,
}

View File

@@ -1,7 +1,6 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<openerp> <odoo noupdate="1">
<data noupdate="1">
<record id="base.fr" model="res.country"> <record id="base.fr" model="res.country">
<field name="intrastat" eval="True"/> <field name="intrastat" eval="True"/>
</record> </record>
@@ -86,5 +85,5 @@
<record id="base.hr" model="res.country"> <record id="base.hr" model="res.country">
<field name="intrastat" eval="True"/> <field name="intrastat" eval="True"/>
</record> </record>
</data>
</openerp> </odoo>

View File

@@ -1,57 +1,27 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<!-- <!--
Copyright (C) 2011-2014 Akretion (http://www.akretion.com/) © 2011-2016 Akretion (Alexis de Lattre <alexis.delattre@akretion.com>)
@author Alexis de Lattre <alexis.delattre@akretion.com> License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
The licence is in the file __openerp__.py
--> -->
<openerp> <odoo noupdate="1">
<data noupdate="1">
<record id="base.main_partner" model="res.partner"> <record id="base.main_partner" model="res.partner">
<field name="vat">FR58441019213</field> <field name="vat">FR58441019213</field>
</record> </record>
<record id="base.res_partner_8" model="res.partner"> <!-- MediaPole -->
<field name="vat">BE0828696437</field>
<field name="supplier">True</field>
</record>
<record id="base.res_partner_24" model="res.partner"> <!-- OpenCorp -->
<field name="vat">BE0443167858</field>
<field name="supplier">True</field>
</record>
<record id="base.res_partner_2" model="res.partner"> <!-- Agrolait --> <record id="base.res_partner_2" model="res.partner"> <!-- Agrolait -->
<field name="vat">BE0884025633</field> <field name="vat">BE0884025633</field>
<field name="supplier">True</field> <field name="supplier">True</field>
</record> </record>
<record id="account.sales_journal" model="account.journal">
<field name="update_posted">True</field>
</record>
<record id="account.refund_sales_journal" model="account.journal">
<field name="update_posted">True</field>
</record>
<record id="account.expenses_journal" model="account.journal">
<field name="update_posted">True</field>
</record>
<record id="account.refund_expenses_journal" model="account.journal">
<field name="update_posted">True</field>
</record>
<record id="shipping_costs_exclude" model="product.product"> <record id="shipping_costs_exclude" model="product.product">
<field name="name">Shipping costs</field> <field name="name">Shipping costs</field>
<field name="code">SHIP</field> <field name="default_code">SHIP</field>
<field name="type">service</field> <field name="type">service</field>
<field name="categ_id" ref="product.product_category_all"/> <field name="categ_id" ref="product.product_category_all"/>
<field name="list_price">30</field> <field name="list_price">30</field>
<field name="is_accessory_cost">True</field> <field name="is_accessory_cost">True</field>
</record> </record>
</data> </odoo>
</openerp>

View File

@@ -4,4 +4,5 @@ from . import res_country
from . import product_template from . import product_template
from . import account_tax from . import account_tax
from . import res_company from . import res_company
from . import account_config_settings
from . import intrastat_common from . import intrastat_common

View File

@@ -0,0 +1,12 @@
# -*- coding: utf-8 -*-
# © 2017 Akretion (Alexis de Lattre <alexis.delattre@akretion.com>)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from odoo import models, fields
class AccountConfigSettings(models.TransientModel):
_inherit = 'account.config.settings'
intrastat_remind_user_ids = fields.Many2many(
related='company_id.intrastat_remind_user_ids')

View File

@@ -1,26 +1,8 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
############################################################################## # © 2011-2016 Akretion (http://www.akretion.com).
# # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
# Intrastat base module for Odoo
# Copyright (C) 2011-2014 Akretion (http://www.akretion.com).
# @author Alexis de Lattre <alexis.delattre@akretion.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
from openerp import models, fields from odoo import models, fields
class AccountTax(models.Model): class AccountTax(models.Model):

View File

@@ -1,27 +1,9 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
############################################################################## # © 2010-2016 Akretion (Alexis de Lattre <alexis.delattre@akretion.com>)
# # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
# Intrastat base module for Odoo
# Copyright (C) 2010-2014 Akretion (http://www.akretion.com/).
# @author Alexis de Lattre <alexis.delattre@akretion.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
from openerp import models, fields, api, tools, _ from odoo import models, fields, api, tools, _
from openerp.exceptions import Warning as UserError from odoo.exceptions import UserError
import logging import logging
logger = logging.getLogger(__name__) logger = logging.getLogger(__name__)

View File

@@ -1,27 +1,9 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
############################################################################## # © 2010-2016 Akretion (Alexis de Lattre <alexis.delattre@akretion.com>)
# # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
# Intrastat base module for Odoo
# Copyright (C) 2010-2014 Akretion (http://www.akretion.com/)
# @author Alexis de Lattre <alexis.delattre@akretion.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
from openerp import models, fields, api, _ from odoo import models, fields, api, _
from openerp.exceptions import ValidationError from odoo.exceptions import ValidationError
class ProductTemplate(models.Model): class ProductTemplate(models.Model):

View File

@@ -1,27 +1,9 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
############################################################################## # © 2013-2017 Akretion (Alexis de Lattre <alexis.delattre@akretion.com>)
# # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
# Intrastat base module for Odoo
# Copyright (C) 2013-2014 Akretion (http://www.akretion.com)
# @author Alexis de Lattre <alexis.delattre@akretion.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
from openerp import models, fields, api, _ from odoo import models, fields, api, _
from openerp.exceptions import ValidationError from odoo.exceptions import ValidationError
class ResCompany(models.Model): class ResCompany(models.Model):
@@ -30,7 +12,7 @@ class ResCompany(models.Model):
intrastat_remind_user_ids = fields.Many2many( intrastat_remind_user_ids = fields.Many2many(
'res.users', column1='company_id', column2='user_id', 'res.users', column1='company_id', column2='user_id',
string="Users Receiving the Intrastat Reminder", string="Users Receiving the Intrastat Reminder",
help="List of OpenERP users who will receive a notification to " help="List of Odoo users who will receive a notification to "
"remind them about the Intrastat declaration.") "remind them about the Intrastat declaration.")
intrastat_email_list = fields.Char( intrastat_email_list = fields.Char(
compute='_compute_intrastat_email_list', compute='_compute_intrastat_email_list',

View File

@@ -1,26 +1,8 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
############################################################################## # © 2011-2014 Akretion (Alexis de Lattre <alexis.delattre@akretion.com>)
# # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
# Intrastat base module for Odoo
# Copyright (C) 2011-2014 Akretion (http://www.akretion.com).
# @author Alexis de Lattre <alexis.delattre@akretion.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
from openerp import models, fields from odoo import models, fields
class ResCountry(models.Model): class ResCountry(models.Model):

View File

@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
© 2013-2017 Akretion (Alexis de Lattre <alexis.delattre@akretion.com>)
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
-->
<odoo>
<record id="view_account_config_settings" model="ir.ui.view">
<field name="name">intrastat.account.config.settings.form</field>
<field name="model">account.config.settings</field>
<field name="inherit_id" ref="account.view_account_config_settings" />
<field name="arch" type="xml">
<xpath expr="//field[@name='overdue_msg']/.." position="after">
<group name="intrastat" string="Intrastat">
<field name="intrastat_remind_user_ids" widget="many2many_tags" />
</group>
</xpath>
</field>
</record>
</odoo>

View File

@@ -1,13 +1,10 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<!-- <!--
Copyright (C) 2011-2015 Akretion (http://www.akretion.com/) © 2011-2016 Akretion (Alexis de Lattre <alexis.delattre@akretion.com>)
@author Alexis de Lattre <alexis.delattre@akretion.com> License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
The licence is in the file __openerp__.py
--> -->
<openerp> <odoo>
<data>
<!-- Add 'exclude_from_intrastat_if_present' on tax form view --> <!-- Add 'exclude_from_intrastat_if_present' on tax form view -->
<record id="view_tax_form" model="ir.ui.view"> <record id="view_tax_form" model="ir.ui.view">
@@ -15,11 +12,10 @@
<field name="model">account.tax</field> <field name="model">account.tax</field>
<field name="inherit_id" ref="account.view_tax_form"/> <field name="inherit_id" ref="account.view_tax_form"/>
<field name="arch" type="xml"> <field name="arch" type="xml">
<field name="active" position="after"> <field name="active" position="before">
<field name="exclude_from_intrastat_if_present"/> <field name="exclude_from_intrastat_if_present"/>
</field> </field>
</field> </field>
</record> </record>
</data> </odoo>
</openerp>

View File

@@ -1,18 +1,16 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<!-- <!--
Copyright (C) 2011-2015 Akretion (http://www.akretion.com/) © 2011-2016 Akretion (http://www.akretion.com/)
Copyright (C) 2015 Noviat (http://www.noviat.com/) © 2015-2016 Noviat (http://www.noviat.com/)
The licence is in the file __openerp__.py License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
--> -->
<openerp> <odoo>
<data>
<!-- Menu entries for Intrastat --> <!-- Menu entries for Intrastat -->
<menuitem id="menu_intrastat_base_root" <menuitem id="menu_intrastat_base_root"
name="Intrastat" name="Intrastat"
parent="account.menu_finance_legal_statement"/> parent="account.menu_finance_reports" sequence="50"/>
<menuitem id="menu_intrastat_config_root" name="Intrastat" <menuitem id="menu_intrastat_config_root" name="Intrastat"
parent="account.menu_finance_configuration" sequence="50"/> parent="account.menu_finance_configuration" sequence="50"/>
@@ -32,5 +30,4 @@
</field> </field>
</record> </record>
</data> </odoo>
</openerp>

View File

@@ -1,13 +1,11 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<!-- <!--
Copyright (C) 2010-2014 Akretion (http://www.akretion.com/) © 2010-2016 Akretion (Alexis de Lattre <alexis.delattre@akretion.com>)
@author Alexis de Lattre <alexis.delattre@akretion.com> License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
The licence is in the file __openerp__.py
--> -->
<openerp> <odoo>
<data>
<record id="product_template_form_view" model="ir.ui.view"> <record id="product_template_form_view" model="ir.ui.view">
<field name="name">intrastat.base.product.template.form</field> <field name="name">intrastat.base.product.template.form</field>
@@ -16,6 +14,8 @@
<field name="arch" type="xml"> <field name="arch" type="xml">
<group name="properties" position="after"> <group name="properties" position="after">
<group string="Intrastat Properties" name="intrastat"> <group string="Intrastat Properties" name="intrastat">
<!-- If you need this field, inherit this view in a
localisation module to set invisible="0" -->
<field name="is_accessory_cost" <field name="is_accessory_cost"
attrs="{'invisible': [('type', '!=', 'service')]}" attrs="{'invisible': [('type', '!=', 'service')]}"
invisible="1"/> invisible="1"/>
@@ -24,5 +24,5 @@
</field> </field>
</record> </record>
</data>
</openerp> </odoo>

View File

@@ -1,29 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2013-2014 Akretion (http://www.akretion.com/)
@author Alexis de Lattre <alexis.delattre@akretion.com>
The licence is in the file __openerp__.py
-->
<openerp>
<data>
<record id="view_company_form" model="ir.ui.view">
<field name="name">intrastat.company.form</field>
<field name="model">res.company</field>
<field name="inherit_id" ref="base.view_company_form" />
<field name="arch" type="xml">
<notebook position="inside">
<page name="intrastat" string="Intrastat">
<group name="intrastat-common" string="Intrastat Settings">
<field name="intrastat_remind_user_ids" widget="many2many_tags" />
</group>
</page>
</notebook>
</field>
</record>
</data>
</openerp>

View File

@@ -1,12 +1,11 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<!-- <!--
Copyright (C) 2011-2014 Akretion (http://www.akretion.com) © 2011-2016 Akretion (http://www.akretion.com)
The licence is in the file __openerp__.py License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
--> -->
<openerp> <odoo>
<data>
<!-- Add intrastat field on res_country --> <!-- Add intrastat field on res_country -->
<record id="view_country_tree" model="ir.ui.view"> <record id="view_country_tree" model="ir.ui.view">
@@ -46,5 +45,4 @@
</record> </record>
</data> </odoo>
</openerp>

View File

@@ -1,13 +1,11 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<!-- <!--
Copyright (C) 2010-2014 Akretion (http://www.akretion.com/) © 2010-2016 Akretion (http://www.akretion.com/)
@author David BEAL <david.beal@akretion.com> @author David BEAL <david.beal@akretion.com>
The licence is in the file __openerp__.py License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
--> -->
<openerp> <odoo>
<data>
<!-- Set country_id field to required on partner form view --> <!-- Set country_id field to required on partner form view -->
<record id="view_partner_form" model="ir.ui.view"> <record id="view_partner_form" model="ir.ui.view">
@@ -24,5 +22,4 @@
</field> </field>
</record> </record>
</data> </odoo>
</openerp>