From 35c04a5dedbee62cca000703eaf2f9a84d0ecd61 Mon Sep 17 00:00:00 2001 From: Alexis de Lattre Date: Tue, 11 Oct 2016 14:59:28 +0200 Subject: [PATCH] [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 !) --- intrastat_base/README.rst | 4 +- intrastat_base/__manifest__.py | 28 +++ intrastat_base/__openerp__.py | 46 ----- intrastat_base/data/country_data.xml | 175 +++++++++--------- intrastat_base/demo/intrastat_demo.xml | 40 +--- intrastat_base/models/__init__.py | 1 + .../models/account_config_settings.py | 12 ++ intrastat_base/models/account_tax.py | 24 +-- intrastat_base/models/intrastat_common.py | 26 +-- intrastat_base/models/product_template.py | 26 +-- intrastat_base/models/res_company.py | 28 +-- intrastat_base/models/res_country.py | 24 +-- .../views/account_config_settings.xml | 23 +++ intrastat_base/views/account_tax.xml | 14 +- intrastat_base/views/intrastat.xml | 15 +- intrastat_base/views/product_template.xml | 16 +- intrastat_base/views/res_company.xml | 29 --- intrastat_base/views/res_country.xml | 12 +- intrastat_base/views/res_partner.xml | 13 +- 19 files changed, 206 insertions(+), 350 deletions(-) create mode 100644 intrastat_base/__manifest__.py delete mode 100644 intrastat_base/__openerp__.py create mode 100644 intrastat_base/models/account_config_settings.py create mode 100644 intrastat_base/views/account_config_settings.xml delete mode 100644 intrastat_base/views/res_company.xml diff --git a/intrastat_base/README.rst b/intrastat_base/README.rst index 284f240..65531ec 100644 --- a/intrastat_base/README.rst +++ b/intrastat_base/README.rst @@ -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 :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 =========== Bugs are tracked on `GitHub Issues -`_. In case +`_. In case 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 welcomed feedback. diff --git a/intrastat_base/__manifest__.py b/intrastat_base/__manifest__.py new file mode 100644 index 0000000..c30463a --- /dev/null +++ b/intrastat_base/__manifest__.py @@ -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, +} diff --git a/intrastat_base/__openerp__.py b/intrastat_base/__openerp__.py deleted file mode 100644 index 12a810b..0000000 --- a/intrastat_base/__openerp__.py +++ /dev/null @@ -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 -# -# 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 . -# -############################################################################## - -{ - '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, -} diff --git a/intrastat_base/data/country_data.xml b/intrastat_base/data/country_data.xml index c77f548..3c75a3a 100644 --- a/intrastat_base/data/country_data.xml +++ b/intrastat_base/data/country_data.xml @@ -1,90 +1,89 @@ - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/intrastat_base/demo/intrastat_demo.xml b/intrastat_base/demo/intrastat_demo.xml index 422afa8..f53d397 100644 --- a/intrastat_base/demo/intrastat_demo.xml +++ b/intrastat_base/demo/intrastat_demo.xml @@ -1,57 +1,27 @@ - - - + FR58441019213 - - BE0828696437 - True - - - - BE0443167858 - True - - BE0884025633 True - - True - - - - True - - - - True - - - - True - - Shipping costs - SHIP + SHIP service 30 True - - + diff --git a/intrastat_base/models/__init__.py b/intrastat_base/models/__init__.py index a571f6a..fa36185 100644 --- a/intrastat_base/models/__init__.py +++ b/intrastat_base/models/__init__.py @@ -4,4 +4,5 @@ from . import res_country from . import product_template from . import account_tax from . import res_company +from . import account_config_settings from . import intrastat_common diff --git a/intrastat_base/models/account_config_settings.py b/intrastat_base/models/account_config_settings.py new file mode 100644 index 0000000..78a9fca --- /dev/null +++ b/intrastat_base/models/account_config_settings.py @@ -0,0 +1,12 @@ +# -*- coding: utf-8 -*- +# © 2017 Akretion (Alexis de Lattre ) +# 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') diff --git a/intrastat_base/models/account_tax.py b/intrastat_base/models/account_tax.py index e11db59..f9997fc 100644 --- a/intrastat_base/models/account_tax.py +++ b/intrastat_base/models/account_tax.py @@ -1,26 +1,8 @@ # -*- coding: utf-8 -*- -############################################################################## -# -# Intrastat base module for Odoo -# Copyright (C) 2011-2014 Akretion (http://www.akretion.com). -# @author Alexis de Lattre -# -# 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 . -# -############################################################################## +# © 2011-2016 Akretion (http://www.akretion.com). +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -from openerp import models, fields +from odoo import models, fields class AccountTax(models.Model): diff --git a/intrastat_base/models/intrastat_common.py b/intrastat_base/models/intrastat_common.py index ff49c96..de3b04b 100644 --- a/intrastat_base/models/intrastat_common.py +++ b/intrastat_base/models/intrastat_common.py @@ -1,27 +1,9 @@ # -*- coding: utf-8 -*- -############################################################################## -# -# Intrastat base module for Odoo -# Copyright (C) 2010-2014 Akretion (http://www.akretion.com/). -# @author Alexis de Lattre -# -# 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 . -# -############################################################################## +# © 2010-2016 Akretion (Alexis de Lattre ) +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -from openerp import models, fields, api, tools, _ -from openerp.exceptions import Warning as UserError +from odoo import models, fields, api, tools, _ +from odoo.exceptions import UserError import logging logger = logging.getLogger(__name__) diff --git a/intrastat_base/models/product_template.py b/intrastat_base/models/product_template.py index 07e0b2b..71cb987 100644 --- a/intrastat_base/models/product_template.py +++ b/intrastat_base/models/product_template.py @@ -1,27 +1,9 @@ # -*- coding: utf-8 -*- -############################################################################## -# -# Intrastat base module for Odoo -# Copyright (C) 2010-2014 Akretion (http://www.akretion.com/) -# @author Alexis de Lattre -# -# 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 . -# -############################################################################## +# © 2010-2016 Akretion (Alexis de Lattre ) +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -from openerp import models, fields, api, _ -from openerp.exceptions import ValidationError +from odoo import models, fields, api, _ +from odoo.exceptions import ValidationError class ProductTemplate(models.Model): diff --git a/intrastat_base/models/res_company.py b/intrastat_base/models/res_company.py index 291d846..5d4a4e7 100644 --- a/intrastat_base/models/res_company.py +++ b/intrastat_base/models/res_company.py @@ -1,27 +1,9 @@ # -*- coding: utf-8 -*- -############################################################################## -# -# Intrastat base module for Odoo -# Copyright (C) 2013-2014 Akretion (http://www.akretion.com) -# @author Alexis de Lattre -# -# 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 . -# -############################################################################## +# © 2013-2017 Akretion (Alexis de Lattre ) +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -from openerp import models, fields, api, _ -from openerp.exceptions import ValidationError +from odoo import models, fields, api, _ +from odoo.exceptions import ValidationError class ResCompany(models.Model): @@ -30,7 +12,7 @@ class ResCompany(models.Model): intrastat_remind_user_ids = fields.Many2many( 'res.users', column1='company_id', column2='user_id', 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.") intrastat_email_list = fields.Char( compute='_compute_intrastat_email_list', diff --git a/intrastat_base/models/res_country.py b/intrastat_base/models/res_country.py index 8703f10..19f34f2 100644 --- a/intrastat_base/models/res_country.py +++ b/intrastat_base/models/res_country.py @@ -1,26 +1,8 @@ # -*- coding: utf-8 -*- -############################################################################## -# -# Intrastat base module for Odoo -# Copyright (C) 2011-2014 Akretion (http://www.akretion.com). -# @author Alexis de Lattre -# -# 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 . -# -############################################################################## +# © 2011-2014 Akretion (Alexis de Lattre ) +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -from openerp import models, fields +from odoo import models, fields class ResCountry(models.Model): diff --git a/intrastat_base/views/account_config_settings.xml b/intrastat_base/views/account_config_settings.xml new file mode 100644 index 0000000..c890c40 --- /dev/null +++ b/intrastat_base/views/account_config_settings.xml @@ -0,0 +1,23 @@ + + + + + + + intrastat.account.config.settings.form + account.config.settings + + + + + + + + + + + + diff --git a/intrastat_base/views/account_tax.xml b/intrastat_base/views/account_tax.xml index d38cee6..a1e72cd 100644 --- a/intrastat_base/views/account_tax.xml +++ b/intrastat_base/views/account_tax.xml @@ -1,13 +1,10 @@ - - - + @@ -15,11 +12,10 @@ account.tax - + - - + diff --git a/intrastat_base/views/intrastat.xml b/intrastat_base/views/intrastat.xml index 73762d0..cc5a186 100644 --- a/intrastat_base/views/intrastat.xml +++ b/intrastat_base/views/intrastat.xml @@ -1,18 +1,16 @@ - - - + + parent="account.menu_finance_reports" sequence="50"/> @@ -32,5 +30,4 @@ - - + diff --git a/intrastat_base/views/product_template.xml b/intrastat_base/views/product_template.xml index 1f4f73f..6440407 100644 --- a/intrastat_base/views/product_template.xml +++ b/intrastat_base/views/product_template.xml @@ -1,13 +1,11 @@ - - - + + intrastat.base.product.template.form @@ -16,6 +14,8 @@ + @@ -24,5 +24,5 @@ - - + + diff --git a/intrastat_base/views/res_company.xml b/intrastat_base/views/res_company.xml deleted file mode 100644 index 0565f00..0000000 --- a/intrastat_base/views/res_company.xml +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - - - - intrastat.company.form - res.company - - - - - - - - - - - - - - - diff --git a/intrastat_base/views/res_country.xml b/intrastat_base/views/res_country.xml index ac0f6f6..e9dec05 100644 --- a/intrastat_base/views/res_country.xml +++ b/intrastat_base/views/res_country.xml @@ -1,12 +1,11 @@ - - - + + @@ -46,5 +45,4 @@ - - + diff --git a/intrastat_base/views/res_partner.xml b/intrastat_base/views/res_partner.xml index 6184e8c..7a9dfeb 100644 --- a/intrastat_base/views/res_partner.xml +++ b/intrastat_base/views/res_partner.xml @@ -1,13 +1,11 @@ - - - + @@ -24,5 +22,4 @@ - - +