From 9233e67012e2b083de595c9aa2cde6f796a5e615 Mon Sep 17 00:00:00 2001 From: Alexis de Lattre Date: Tue, 28 May 2019 19:09:32 +0200 Subject: [PATCH] [MIG] Migrate all modules from v11 to v12 [UPD] Update intrastat_base.pot --- intrastat_base/__manifest__.py | 6 +- intrastat_base/demo/intrastat_demo.xml | 5 +- intrastat_base/i18n/intrastat_base.pot | 121 ++++++++++++------- intrastat_base/models/account_tax.py | 2 +- intrastat_base/models/intrastat_common.py | 11 +- intrastat_base/models/product_template.py | 1 - intrastat_base/models/res_company.py | 5 +- intrastat_base/models/res_config_settings.py | 2 +- intrastat_base/models/res_country.py | 3 +- intrastat_base/readme/CONTRIBUTORS.rst | 4 + intrastat_base/readme/DESCRIPTION.rst | 11 ++ intrastat_base/readme/INSTALL.rst | 5 + intrastat_base/readme/USAGE.rst | 9 ++ intrastat_base/views/account_tax.xml | 3 +- intrastat_base/views/intrastat.xml | 4 +- intrastat_base/views/product_template.xml | 3 +- intrastat_base/views/res_config_settings.xml | 7 +- intrastat_base/views/res_country.xml | 10 +- intrastat_base/views/res_partner.xml | 2 +- 19 files changed, 135 insertions(+), 79 deletions(-) create mode 100644 intrastat_base/readme/CONTRIBUTORS.rst create mode 100644 intrastat_base/readme/DESCRIPTION.rst create mode 100644 intrastat_base/readme/INSTALL.rst create mode 100644 intrastat_base/readme/USAGE.rst diff --git a/intrastat_base/__manifest__.py b/intrastat_base/__manifest__.py index c372a09..0113306 100644 --- a/intrastat_base/__manifest__.py +++ b/intrastat_base/__manifest__.py @@ -5,14 +5,14 @@ { 'name': 'Intrastat Reporting Base', - 'version': '11.0.1.0.0', + 'version': '12.0.1.0.0', 'category': 'Intrastat', 'license': 'AGPL-3', 'summary': 'Base module for Intrastat reporting', 'author': 'Akretion,Noviat,Odoo Community Association (OCA)', 'website': 'https://github.com/OCA/intrastat', 'depends': ['base_vat', 'account'], - 'conflicts': ['report_intrastat'], + 'excludes': ['account_intrastat'], 'data': [ 'data/country_data.xml', 'views/product_template.xml', @@ -25,5 +25,5 @@ 'demo': [ 'demo/intrastat_demo.xml', ], - 'installable': False, + 'installable': True, } diff --git a/intrastat_base/demo/intrastat_demo.xml b/intrastat_base/demo/intrastat_demo.xml index f53d397..181a244 100644 --- a/intrastat_base/demo/intrastat_demo.xml +++ b/intrastat_base/demo/intrastat_demo.xml @@ -1,6 +1,7 @@ @@ -10,7 +11,7 @@ FR58441019213 - + BE0884025633 True diff --git a/intrastat_base/i18n/intrastat_base.pot b/intrastat_base/i18n/intrastat_base.pot index 315e3f2..00e44dc 100644 --- a/intrastat_base/i18n/intrastat_base.pot +++ b/intrastat_base/i18n/intrastat_base.pot @@ -4,7 +4,7 @@ # msgid "" msgstr "" -"Project-Id-Version: Odoo Server 11.0\n" +"Project-Id-Version: Odoo Server 12.0\n" "Report-Msgid-Bugs-To: \n" "Last-Translator: <>\n" "Language-Team: \n" @@ -14,13 +14,13 @@ msgstr "" "Plural-Forms: \n" #. module: intrastat_base -#: model:ir.model.fields,help:intrastat_base.field_product_product_is_accessory_cost -#: model:ir.model.fields,help:intrastat_base.field_product_template_is_accessory_cost +#: model:ir.model.fields,help:intrastat_base.field_product_product__is_accessory_cost +#: model:ir.model.fields,help:intrastat_base.field_product_template__is_accessory_cost msgid "Activate this option for shipping costs, packaging costs and all services related to the sale of products. This option is used for Intrastat reports." msgstr "" #. module: intrastat_base -#: code:addons/intrastat_base/models/intrastat_common.py:151 +#: code:addons/intrastat_base/models/intrastat_common.py:143 #, python-format msgid "Cannot delete the declaration %s because it is in Done state" msgstr "" @@ -36,134 +36,159 @@ msgid "Companies" msgstr "" #. module: intrastat_base -#: code:addons/intrastat_base/models/intrastat_common.py:39 +#: code:addons/intrastat_base/models/intrastat_common.py:38 #, python-format msgid "Company not yet set on intrastat report." msgstr "" +#. module: intrastat_base +#: model:ir.model,name:intrastat_base.model_res_config_settings +msgid "Config Settings" +msgstr "" + #. module: intrastat_base #: model:ir.model,name:intrastat_base.model_res_country msgid "Country" msgstr "" #. module: intrastat_base -#: model:ir.model.fields,field_description:intrastat_base.field_intrastat_result_view_create_uid +#: model:ir.model.fields,field_description:intrastat_base.field_intrastat_result_view__create_uid msgid "Created by" msgstr "" #. module: intrastat_base -#: model:ir.model.fields,field_description:intrastat_base.field_intrastat_result_view_create_date +#: model:ir.model.fields,field_description:intrastat_base.field_intrastat_result_view__create_date msgid "Created on" msgstr "" #. module: intrastat_base -#: model:ir.model.fields,field_description:intrastat_base.field_intrastat_common_display_name -#: model:ir.model.fields,field_description:intrastat_base.field_intrastat_result_view_display_name +#: model_terms:ir.ui.view,arch_db:intrastat_base.res_country_view_search +msgid "Currency" +msgstr "" + +#. module: intrastat_base +#: model:ir.model.fields,field_description:intrastat_base.field_intrastat_common__display_name +#: model:ir.model.fields,field_description:intrastat_base.field_intrastat_result_view__display_name msgid "Display Name" msgstr "" #. module: intrastat_base -#: model:ir.model.fields,field_description:intrastat_base.field_res_country_intrastat -#: model:ir.ui.view,arch_db:intrastat_base.res_country_view_search +#: model:ir.model.fields,field_description:intrastat_base.field_res_country__intrastat +#: model_terms:ir.ui.view,arch_db:intrastat_base.res_country_view_search msgid "EU Country" msgstr "" #. module: intrastat_base -#: model:ir.model.fields,field_description:intrastat_base.field_account_tax_exclude_from_intrastat_if_present -#: model:ir.model.fields,field_description:intrastat_base.field_account_tax_template_exclude_from_intrastat_if_present +#: model:ir.model.fields,field_description:intrastat_base.field_account_tax__exclude_from_intrastat_if_present +#: model:ir.model.fields,field_description:intrastat_base.field_account_tax_template__exclude_from_intrastat_if_present msgid "Exclude invoice line from intrastat if this tax is present" msgstr "" #. module: intrastat_base -#: model:ir.model.fields,field_description:intrastat_base.field_intrastat_common_id -#: model:ir.model.fields,field_description:intrastat_base.field_intrastat_result_view_id +#: model_terms:ir.ui.view,arch_db:intrastat_base.res_country_view_search +msgid "Group By" +msgstr "" + +#. module: intrastat_base +#: model:ir.model.fields,field_description:intrastat_base.field_intrastat_common__id +#: model:ir.model.fields,field_description:intrastat_base.field_intrastat_result_view__id msgid "ID" msgstr "" #. module: intrastat_base -#: model:ir.model.fields,help:intrastat_base.field_account_tax_exclude_from_intrastat_if_present -#: model:ir.model.fields,help:intrastat_base.field_account_tax_template_exclude_from_intrastat_if_present +#: model:ir.model.fields,help:intrastat_base.field_account_tax__exclude_from_intrastat_if_present +#: model:ir.model.fields,help:intrastat_base.field_account_tax_template__exclude_from_intrastat_if_present msgid "If this tax is present on an invoice line, this invoice line will be skipped when generating Intrastat Product or Service lines from invoices." msgstr "" #. module: intrastat_base #: model:ir.ui.menu,name:intrastat_base.menu_intrastat_base_root #: model:ir.ui.menu,name:intrastat_base.menu_intrastat_config_root -#: model:ir.ui.view,arch_db:intrastat_base.view_intrastat_res_config_settings +#: model_terms:ir.ui.view,arch_db:intrastat_base.view_intrastat_res_config_settings msgid "Intrastat" msgstr "" #. module: intrastat_base -#: model:ir.ui.view,arch_db:intrastat_base.product_template_form_view +#: model_terms:ir.ui.view,arch_db:intrastat_base.product_template_form_view msgid "Intrastat Properties" msgstr "" #. module: intrastat_base -#: model:ir.ui.view,arch_db:intrastat_base.intrastat_result_view_form +#: model_terms:ir.ui.view,arch_db:intrastat_base.intrastat_result_view_form msgid "Intrastat Result View" msgstr "" #. module: intrastat_base -#: model:ir.model.fields,field_description:intrastat_base.field_product_product_is_accessory_cost -#: model:ir.model.fields,field_description:intrastat_base.field_product_template_is_accessory_cost +#: model:ir.model.fields,field_description:intrastat_base.field_product_product__is_accessory_cost +#: model:ir.model.fields,field_description:intrastat_base.field_product_template__is_accessory_cost msgid "Is accessory cost" msgstr "" #. module: intrastat_base -#: model:ir.model.fields,field_description:intrastat_base.field_intrastat_common___last_update -#: model:ir.model.fields,field_description:intrastat_base.field_intrastat_result_view___last_update +#: model:ir.model.fields,field_description:intrastat_base.field_intrastat_common____last_update +#: model:ir.model.fields,field_description:intrastat_base.field_intrastat_result_view____last_update msgid "Last Modified on" msgstr "" #. module: intrastat_base -#: model:ir.model.fields,field_description:intrastat_base.field_intrastat_result_view_write_uid +#: model:ir.model.fields,field_description:intrastat_base.field_intrastat_result_view__write_uid msgid "Last Updated by" msgstr "" #. module: intrastat_base -#: model:ir.model.fields,field_description:intrastat_base.field_intrastat_result_view_write_date +#: model:ir.model.fields,field_description:intrastat_base.field_intrastat_result_view__write_date msgid "Last Updated on" msgstr "" #. module: intrastat_base -#: model:ir.model.fields,help:intrastat_base.field_res_company_intrastat_remind_user_ids -#: model:ir.model.fields,help:intrastat_base.field_res_config_settings_intrastat_remind_user_ids +#: model:ir.model.fields,help:intrastat_base.field_res_company__intrastat_remind_user_ids +#: model:ir.model.fields,help:intrastat_base.field_res_config_settings__intrastat_remind_user_ids msgid "List of Odoo users who will receive a notification to remind them about the Intrastat declaration." msgstr "" #. module: intrastat_base -#: model:ir.model.fields,field_description:intrastat_base.field_res_company_intrastat_email_list +#: model:ir.model.fields,field_description:intrastat_base.field_res_company__intrastat_email_list msgid "List of emails of Users Receiving the Intrastat Reminder" msgstr "" #. module: intrastat_base -#: code:addons/intrastat_base/models/res_company.py:38 +#: code:addons/intrastat_base/models/res_company.py:37 #, python-format msgid "Missing e-mail address on user '%s'." msgstr "" #. module: intrastat_base -#: model:ir.model.fields,field_description:intrastat_base.field_intrastat_result_view_note +#: model_terms:ir.ui.view,arch_db:intrastat_base.res_country_view_search +msgid "Name or Code" +msgstr "" + +#. module: intrastat_base +#: model:ir.model.fields,field_description:intrastat_base.field_intrastat_result_view__note msgid "Notes" msgstr "" #. module: intrastat_base -#: model:ir.ui.view,arch_db:intrastat_base.intrastat_result_view_form +#: model_terms:ir.ui.view,arch_db:intrastat_base.intrastat_result_view_form msgid "Ok" msgstr "" +#. module: intrastat_base +#: model:ir.model,name:intrastat_base.model_intrastat_result_view +msgid "Pop-up to show errors on intrastat report generation" +msgstr "" + #. module: intrastat_base #: model:ir.model,name:intrastat_base.model_product_template msgid "Product Template" msgstr "" #. module: intrastat_base -#: model:ir.ui.view,arch_db:intrastat_base.res_country_view_search +#: model_terms:ir.ui.view,arch_db:intrastat_base.res_country_view_search msgid "Search Countries" msgstr "" #. module: intrastat_base -#: model:ir.model.fields,help:intrastat_base.field_res_country_intrastat +#: model:ir.model.fields,help:intrastat_base.field_res_country__intrastat msgid "Set to True for all European Union countries." msgstr "" @@ -184,42 +209,44 @@ msgid "Templates for Taxes" msgstr "" #. module: intrastat_base -#: code:addons/intrastat_base/models/intrastat_common.py:52 +#: code:addons/intrastat_base/models/intrastat_common.py:50 #, python-format msgid "The VAT number is not set for the partner '%s'." msgstr "" #. module: intrastat_base -#: code:addons/intrastat_base/models/intrastat_common.py:43 +#: code:addons/intrastat_base/models/intrastat_common.py:42 #, python-format msgid "The country is not set on the company '%s'." msgstr "" #. module: intrastat_base -#: code:addons/intrastat_base/models/product_template.py:23 +#: code:addons/intrastat_base/models/product_template.py:22 #, python-format msgid "The option 'Is accessory cost?' should only be activated on 'Service' products. You have activated this option for the product '%s' which is of type '%s'" msgstr "" #. module: intrastat_base -#: code:addons/intrastat_base/models/intrastat_common.py:73 +#: model:product.product,uom_name:intrastat_base.shipping_costs_exclude +#: model:product.template,uom_name:intrastat_base.shipping_costs_exclude_product_template +msgid "Unit(s)" +msgstr "" + +#. module: intrastat_base +#: code:addons/intrastat_base/models/intrastat_common.py:71 #, python-format msgid "Unknown Error" msgstr "" #. module: intrastat_base -#: model:ir.model.fields,field_description:intrastat_base.field_res_company_intrastat_remind_user_ids -#: model:ir.model.fields,field_description:intrastat_base.field_res_config_settings_intrastat_remind_user_ids +#: model:ir.model.fields,field_description:intrastat_base.field_res_company__intrastat_remind_user_ids +#: model:ir.model.fields,field_description:intrastat_base.field_res_config_settings__intrastat_remind_user_ids msgid "Users Receiving the Intrastat Reminder" msgstr "" #. module: intrastat_base -#: model:ir.model,name:intrastat_base.model_intrastat_result_view -msgid "intrastat.result.view" -msgstr "" - -#. module: intrastat_base -#: model:ir.model,name:intrastat_base.model_res_config_settings -msgid "res.config.settings" +#: model:product.product,weight_uom_name:intrastat_base.shipping_costs_exclude +#: model:product.template,weight_uom_name:intrastat_base.shipping_costs_exclude_product_template +msgid "kg" msgstr "" diff --git a/intrastat_base/models/account_tax.py b/intrastat_base/models/account_tax.py index df81523..79f5c72 100644 --- a/intrastat_base/models/account_tax.py +++ b/intrastat_base/models/account_tax.py @@ -1,4 +1,4 @@ -# © 2011-2016 Akretion (http://www.akretion.com). +# Copyright 2011-2019 Akretion France (http://www.akretion.com). # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). from odoo import models, fields diff --git a/intrastat_base/models/intrastat_common.py b/intrastat_base/models/intrastat_common.py index 048d5c5..1b9e36a 100644 --- a/intrastat_base/models/intrastat_common.py +++ b/intrastat_base/models/intrastat_common.py @@ -5,6 +5,7 @@ from io import BytesIO from lxml import etree from sys import exc_info +import base64 from traceback import format_exception import logging @@ -19,7 +20,6 @@ class IntrastatCommon(models.AbstractModel): _description = "Common functions for intrastat reports for products " "and services" - @api.multi @api.depends('declaration_line_ids.amount_company_currency') def _compute_numbers(self): for this in self: @@ -31,7 +31,6 @@ class IntrastatCommon(models.AbstractModel): this.num_decl_lines = num_lines this.total_amount = total_amount - @api.multi def _check_generate_lines(self): """Check wether all requirements are met for generating lines.""" for this in self: @@ -44,7 +43,6 @@ class IntrastatCommon(models.AbstractModel): % company.name) return True - @api.multi def _check_generate_xml(self): for this in self: if not this.company_id.partner_id.vat: @@ -76,12 +74,10 @@ class IntrastatCommon(models.AbstractModel): logger.warning(error) raise UserError(error) - @api.multi def _attach_xml_file(self, xml_string, declaration_name): '''Attach the XML file to the report_intrastat_product/service object''' self.ensure_one() - import base64 filename = '%s_%s.xml' % (self.year_month, declaration_name) attach = self.env['ir.attachment'].create({ 'name': filename, @@ -91,7 +87,6 @@ class IntrastatCommon(models.AbstractModel): 'datas_fname': filename}) return attach.id - @api.multi def _unlink_attachments(self): atts = self.env['ir.attachment'].search( [('res_model', '=', self._name), @@ -114,7 +109,6 @@ class IntrastatCommon(models.AbstractModel): } return action - @api.multi def _generate_xml(self): """ Inherit this method in the localization module @@ -128,7 +122,6 @@ class IntrastatCommon(models.AbstractModel): """ return False - @api.multi def send_reminder_email(self, mail_template_xmlid): mail_template = self.env.ref(mail_template_xmlid) for this in self: @@ -143,7 +136,6 @@ class IntrastatCommon(models.AbstractModel): 'empty on company %s' % this.company_id.name) return True - @api.multi def unlink(self): for intrastat in self: if intrastat.state == 'done': @@ -158,6 +150,7 @@ class IntrastatResultView(models.TransientModel): Transient Model to display Intrastat Report results """ _name = 'intrastat.result.view' + _description = 'Pop-up to show errors on intrastat report generation' note = fields.Text( string='Notes', readonly=True, diff --git a/intrastat_base/models/product_template.py b/intrastat_base/models/product_template.py index bc3f6ca..804aa59 100644 --- a/intrastat_base/models/product_template.py +++ b/intrastat_base/models/product_template.py @@ -14,7 +14,6 @@ class ProductTemplate(models.Model): "costs and all services related to the sale of products. " "This option is used for Intrastat reports.") - @api.multi @api.constrains('type', 'is_accessory_cost') def _check_accessory_cost(self): for this in self: diff --git a/intrastat_base/models/res_company.py b/intrastat_base/models/res_company.py index f67bcf5..05c3d15 100644 --- a/intrastat_base/models/res_company.py +++ b/intrastat_base/models/res_company.py @@ -1,4 +1,5 @@ -# Copyright 2013-2017 Akretion () +# Copyright 2013-2017 Akretion France (http://www.akretion.com/) +# @author: # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). from odoo import api, fields, models, _ @@ -17,7 +18,6 @@ class ResCompany(models.Model): compute='_compute_intrastat_email_list', string='List of emails of Users Receiving the Intrastat Reminder') - @api.multi @api.depends( 'intrastat_remind_user_ids', 'intrastat_remind_user_ids.email') def _compute_intrastat_email_list(self): @@ -28,7 +28,6 @@ class ResCompany(models.Model): emails.append(user.email) this.intrastat_email_list = ','.join(emails) - @api.multi @api.constrains('intrastat_remind_user_ids') def _check_intrastat_remind_users(self): for this in self: diff --git a/intrastat_base/models/res_config_settings.py b/intrastat_base/models/res_config_settings.py index 14c62ec..51bec6c 100644 --- a/intrastat_base/models/res_config_settings.py +++ b/intrastat_base/models/res_config_settings.py @@ -9,4 +9,4 @@ class ResConfigSettings(models.TransientModel): _inherit = 'res.config.settings' intrastat_remind_user_ids = fields.Many2many( - related='company_id.intrastat_remind_user_ids') + related='company_id.intrastat_remind_user_ids', readonly=False) diff --git a/intrastat_base/models/res_country.py b/intrastat_base/models/res_country.py index 3af71f0..74f0685 100644 --- a/intrastat_base/models/res_country.py +++ b/intrastat_base/models/res_country.py @@ -1,4 +1,5 @@ -# Copyright 2011-2014 Akretion () +# Copyright 2011-2019 Akretion France (http://www.akretion.com/) +# @author: # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). from odoo import fields, models diff --git a/intrastat_base/readme/CONTRIBUTORS.rst b/intrastat_base/readme/CONTRIBUTORS.rst new file mode 100644 index 0000000..6a9e1c1 --- /dev/null +++ b/intrastat_base/readme/CONTRIBUTORS.rst @@ -0,0 +1,4 @@ +* Alexis de Lattre, Akretion +* Luc De Meyer, Noviat +* Kumar Aberer, brain-tec AG +* Andrea Stirpe diff --git a/intrastat_base/readme/DESCRIPTION.rst b/intrastat_base/readme/DESCRIPTION.rst new file mode 100644 index 0000000..179c7eb --- /dev/null +++ b/intrastat_base/readme/DESCRIPTION.rst @@ -0,0 +1,11 @@ +This module contains common functions for the intrastat reporting and +should be used in combination with the generic reporting module +*intrastat_product* and with the country-specific reporting modules such +as: + +- *l10n_fr_intrastat_service*: + the module for the *Déclaration Européenne des Services* (DES) for France +- *l10n_fr_intrastat_product*: + the module for the *Déclaration d'Echange de Biens* (DEB) for France +- *l10n_be_intrastat_product*: + the module for the Intrastat Declaration for Belgium. diff --git a/intrastat_base/readme/INSTALL.rst b/intrastat_base/readme/INSTALL.rst new file mode 100644 index 0000000..2f4f69f --- /dev/null +++ b/intrastat_base/readme/INSTALL.rst @@ -0,0 +1,5 @@ +WARNING: + +This module conflicts with the module *account_intrastat* from Odoo Enterprise. +If you have already installed the module *account_intrastat*, +you should uninstall it first before installing this module. diff --git a/intrastat_base/readme/USAGE.rst b/intrastat_base/readme/USAGE.rst new file mode 100644 index 0000000..32dbe07 --- /dev/null +++ b/intrastat_base/readme/USAGE.rst @@ -0,0 +1,9 @@ +This module adds an intrastat property on countries and activates this property +on the countries of the European Union. + +With this module, the country field on partners becomes a required field. + +It adds an option *Exclude invoice line from intrastat if this tax is present* +on taxes. + +It adds an *Intrastat* section on the *Invoicing* configuration page. diff --git a/intrastat_base/views/account_tax.xml b/intrastat_base/views/account_tax.xml index a1e72cd..222f71b 100644 --- a/intrastat_base/views/account_tax.xml +++ b/intrastat_base/views/account_tax.xml @@ -1,6 +1,7 @@ diff --git a/intrastat_base/views/intrastat.xml b/intrastat_base/views/intrastat.xml index cc5a186..3381e0c 100644 --- a/intrastat_base/views/intrastat.xml +++ b/intrastat_base/views/intrastat.xml @@ -1,7 +1,7 @@ diff --git a/intrastat_base/views/product_template.xml b/intrastat_base/views/product_template.xml index 6440407..fff74e1 100644 --- a/intrastat_base/views/product_template.xml +++ b/intrastat_base/views/product_template.xml @@ -1,6 +1,7 @@ diff --git a/intrastat_base/views/res_config_settings.xml b/intrastat_base/views/res_config_settings.xml index f472061..ec5ea7d 100644 --- a/intrastat_base/views/res_config_settings.xml +++ b/intrastat_base/views/res_config_settings.xml @@ -1,7 +1,8 @@ @@ -21,7 +22,7 @@
+ diff --git a/intrastat_base/views/res_country.xml b/intrastat_base/views/res_country.xml index e9dec05..3ecc2fd 100644 --- a/intrastat_base/views/res_country.xml +++ b/intrastat_base/views/res_country.xml @@ -1,6 +1,6 @@ @@ -36,10 +36,14 @@ res.country - + + + domain="[('intrastat', '=', True)]" /> + + +
diff --git a/intrastat_base/views/res_partner.xml b/intrastat_base/views/res_partner.xml index 7a9dfeb..5f31add 100644 --- a/intrastat_base/views/res_partner.xml +++ b/intrastat_base/views/res_partner.xml @@ -1,6 +1,6 @@