mirror of
https://github.com/OCA/intrastat-extrastat.git
synced 2025-02-16 17:13:41 +02:00
[MIG] intrastat_product: Migration to 11.0
* Small fixes in intrastat_base * account_tax_template [UPD] Update intrastat_base.pot
This commit is contained in:
committed by
Alexis de Lattre
parent
71ce016036
commit
ea11ddb9db
@@ -1,5 +1,6 @@
|
|||||||
# © 2011-2016 Akretion (http://www.akretion.com)
|
# Copyright 2011-2016 Akretion (http://www.akretion.com)
|
||||||
# © 2018 brain-tec AG (Kumar Aberer <kumar.aberer@braintec-group.com>)
|
# Copyright 2018 brain-tec AG (Kumar Aberer <kumar.aberer@braintec-group.com>)
|
||||||
|
# Copyright 2009-2019 Noviat (http://www.noviat.com)
|
||||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||||
|
|
||||||
{
|
{
|
||||||
@@ -8,7 +9,7 @@
|
|||||||
'category': 'Intrastat',
|
'category': 'Intrastat',
|
||||||
'license': 'AGPL-3',
|
'license': 'AGPL-3',
|
||||||
'summary': 'Base module for Intrastat reporting',
|
'summary': 'Base module for Intrastat reporting',
|
||||||
'author': 'Akretion,Odoo Community Association (OCA)',
|
'author': 'Akretion,Noviat,Odoo Community Association (OCA)',
|
||||||
'website': 'https://github.com/OCA/intrastat',
|
'website': 'https://github.com/OCA/intrastat',
|
||||||
'depends': ['base_vat', 'account'],
|
'depends': ['base_vat', 'account'],
|
||||||
'conflicts': ['report_intrastat'],
|
'conflicts': ['report_intrastat'],
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ msgid "Activate this option for shipping costs, packaging costs and all services
|
|||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#. module: intrastat_base
|
#. module: intrastat_base
|
||||||
#: code:addons/intrastat_base/models/intrastat_common.py:154
|
#: code:addons/intrastat_base/models/intrastat_common.py:151
|
||||||
#, python-format
|
#, python-format
|
||||||
msgid "Cannot delete the declaration %s because it is in Done state"
|
msgid "Cannot delete the declaration %s because it is in Done state"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
@@ -36,7 +36,7 @@ msgid "Companies"
|
|||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#. module: intrastat_base
|
#. module: intrastat_base
|
||||||
#: code:addons/intrastat_base/models/intrastat_common.py:33
|
#: code:addons/intrastat_base/models/intrastat_common.py:39
|
||||||
#, python-format
|
#, python-format
|
||||||
msgid "Company not yet set on intrastat report."
|
msgid "Company not yet set on intrastat report."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
@@ -70,6 +70,7 @@ msgstr ""
|
|||||||
|
|
||||||
#. module: intrastat_base
|
#. 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_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"
|
msgid "Exclude invoice line from intrastat if this tax is present"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
@@ -81,6 +82,7 @@ msgstr ""
|
|||||||
|
|
||||||
#. module: intrastat_base
|
#. 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_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."
|
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 ""
|
msgstr ""
|
||||||
|
|
||||||
@@ -177,35 +179,34 @@ msgid "Tax"
|
|||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#. module: intrastat_base
|
#. module: intrastat_base
|
||||||
#: code:addons/intrastat_base/models/intrastat_common.py:51
|
#: model:ir.model,name:intrastat_base.model_account_tax_template
|
||||||
|
msgid "Templates for Taxes"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#. module: intrastat_base
|
||||||
|
#: code:addons/intrastat_base/models/intrastat_common.py:52
|
||||||
#, python-format
|
#, python-format
|
||||||
msgid "The VAT number is not set for the partner '%s'."
|
msgid "The VAT number is not set for the partner '%s'."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#. module: intrastat_base
|
#. module: intrastat_base
|
||||||
#: code:addons/intrastat_base/models/intrastat_common.py:41
|
#: code:addons/intrastat_base/models/intrastat_common.py:43
|
||||||
#, python-format
|
|
||||||
msgid "The company currency must be 'EUR', but is currently '%s'."
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#. module: intrastat_base
|
|
||||||
#: code:addons/intrastat_base/models/intrastat_common.py:37
|
|
||||||
#, python-format
|
#, python-format
|
||||||
msgid "The country is not set on the company '%s'."
|
msgid "The country is not set on the company '%s'."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#. module: intrastat_base
|
|
||||||
#: code:addons/intrastat_base/models/intrastat_common.py:74
|
|
||||||
#, python-format
|
|
||||||
msgid "The generated XML file is not valid against the official XML Schema Definition. The generated XML file and the full error have been written in the server logs. Here is the error, which may give you an idea on the cause of the problem : %s."
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#. module: intrastat_base
|
#. module: intrastat_base
|
||||||
#: code:addons/intrastat_base/models/product_template.py:23
|
#: code:addons/intrastat_base/models/product_template.py:23
|
||||||
#, python-format
|
#, 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'"
|
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 ""
|
msgstr ""
|
||||||
|
|
||||||
|
#. module: intrastat_base
|
||||||
|
#: code:addons/intrastat_base/models/intrastat_common.py:73
|
||||||
|
#, python-format
|
||||||
|
msgid "Unknown Error"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
#. module: intrastat_base
|
#. 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_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_config_settings_intrastat_remind_user_ids
|
||||||
|
|||||||
@@ -1,12 +1,16 @@
|
|||||||
# © 2010-2016 Akretion (Alexis de Lattre <alexis.delattre@akretion.com>)
|
# Copyright 2010-2016 Akretion (<alexis.delattre@akretion.com>)
|
||||||
|
# Copyright 2009-2019 Noviat (http://www.noviat.com)
|
||||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||||
|
|
||||||
from odoo import models, fields, api, tools, _
|
from io import BytesIO
|
||||||
from odoo.exceptions import UserError
|
|
||||||
import base64
|
|
||||||
from lxml import etree
|
from lxml import etree
|
||||||
|
from sys import exc_info
|
||||||
|
from traceback import format_exception
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
|
from odoo import api, fields, models, tools, _
|
||||||
|
from odoo.exceptions import UserError
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
@@ -50,43 +54,40 @@ class IntrastatCommon(models.AbstractModel):
|
|||||||
return True
|
return True
|
||||||
|
|
||||||
@api.model
|
@api.model
|
||||||
def _check_xml_schema(self, xml_etree, xsd_file):
|
def _check_xml_schema(self, xml_string, xsd_file):
|
||||||
'''Validate the XML file against the XSD'''
|
'''Validate the XML file against the XSD'''
|
||||||
xsd_etree_obj = etree.parse(
|
xsd_etree_obj = etree.parse(
|
||||||
tools.file_open(xsd_file))
|
tools.file_open(xsd_file, mode='rb'))
|
||||||
official_schema = etree.XMLSchema(xsd_etree_obj)
|
official_schema = etree.XMLSchema(xsd_etree_obj)
|
||||||
try:
|
try:
|
||||||
official_schema.assertValid(xml_etree)
|
t = etree.parse(BytesIO(xml_string))
|
||||||
except Exception as e:
|
official_schema.assertValid(t)
|
||||||
# if the validation of the XSD fails, we arrive here
|
except (etree.XMLSchemaParseError, etree.DocumentInvalid) as e:
|
||||||
logger = logging.getLogger(__name__)
|
|
||||||
logger.warning(
|
logger.warning(
|
||||||
"The XML file is invalid against the XML Schema Definition")
|
"The XML file is invalid against the XML Schema Definition")
|
||||||
xml_string = etree.tostring(
|
|
||||||
xml_etree, pretty_print=True, encoding='UTF-8',
|
|
||||||
xml_declaration=True).decode()
|
|
||||||
logger.warning(xml_string)
|
logger.warning(xml_string)
|
||||||
logger.warning(e)
|
logger.warning(e)
|
||||||
raise UserError(_(
|
usererror = '%s\n\n%s' % (e.__class__.__name__, str(e))
|
||||||
"The generated XML file is not valid against the official "
|
raise UserError(usererror)
|
||||||
"XML Schema Definition. The generated XML file and the "
|
except Exception:
|
||||||
"full error have been written in the server logs. "
|
error = _("Unknown Error")
|
||||||
"Here is the error, which may give you an idea on the "
|
tb = ''.join(format_exception(*exc_info()))
|
||||||
"cause of the problem : %s.")
|
error += '\n%s' % tb
|
||||||
% str(e))
|
logger.warning(error)
|
||||||
return True
|
raise UserError(error)
|
||||||
|
|
||||||
@api.multi
|
@api.multi
|
||||||
def _attach_xml_file(self, xml_string, declaration_name):
|
def _attach_xml_file(self, xml_string, declaration_name):
|
||||||
'''Attach the XML file to the report_intrastat_product/service
|
'''Attach the XML file to the report_intrastat_product/service
|
||||||
object'''
|
object'''
|
||||||
self.ensure_one()
|
self.ensure_one()
|
||||||
|
import base64
|
||||||
filename = '%s_%s.xml' % (self.year_month, declaration_name)
|
filename = '%s_%s.xml' % (self.year_month, declaration_name)
|
||||||
attach = self.env['ir.attachment'].create({
|
attach = self.env['ir.attachment'].create({
|
||||||
'name': filename,
|
'name': filename,
|
||||||
'res_id': self.id,
|
'res_id': self.id,
|
||||||
'res_model': self._name,
|
'res_model': self._name,
|
||||||
'datas': base64.b64encode(xml_string),
|
'datas': base64.encodestring(xml_string),
|
||||||
'datas_fname': filename})
|
'datas_fname': filename})
|
||||||
return attach.id
|
return attach.id
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
# © 2010-2016 Akretion (Alexis de Lattre <alexis.delattre@akretion.com>)
|
# Copyright 2010-2016 Akretion (<alexis.delattre@akretion.com>)
|
||||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||||
|
|
||||||
from odoo import models, fields, api, _
|
from odoo import api, fields, models, _
|
||||||
from odoo.exceptions import ValidationError
|
from odoo.exceptions import ValidationError
|
||||||
|
|
||||||
|
|
||||||
@@ -19,8 +19,9 @@ class ProductTemplate(models.Model):
|
|||||||
def _check_accessory_cost(self):
|
def _check_accessory_cost(self):
|
||||||
for this in self:
|
for this in self:
|
||||||
if this.is_accessory_cost and this.type != 'service':
|
if this.is_accessory_cost and this.type != 'service':
|
||||||
raise ValidationError(_(
|
raise ValidationError(
|
||||||
"The option 'Is accessory cost' should only be "
|
_("The option 'Is accessory cost?' should only be "
|
||||||
"activated on 'Service' products. You have activated "
|
"activated on 'Service' products. You have activated "
|
||||||
"this option for the product '%s' which is of type "
|
"this option for the product '%s' which is of type "
|
||||||
"'%s'") % (this.name, this.type))
|
"'%s'") %
|
||||||
|
(this.name, this.type))
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
# © 2013-2017 Akretion (Alexis de Lattre <alexis.delattre@akretion.com>)
|
# Copyright 2013-2017 Akretion (<alexis.delattre@akretion.com>)
|
||||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||||
|
|
||||||
from odoo import models, fields, api, _
|
from odoo import api, fields, models, _
|
||||||
from odoo.exceptions import ValidationError
|
from odoo.exceptions import ValidationError
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
# © 2017 Akretion (Alexis de Lattre <alexis.delattre@akretion.com>)
|
# Copyright 2017 Akretion (Alexis de Lattre <alexis.delattre@akretion.com>)
|
||||||
# © 2018 brain-tec AG (Kumar Aberer <kumar.aberer@braintec-group.com>)
|
# Copyright 2018 brain-tec AG (Kumar Aberer <kumar.aberer@braintec-group.com>)
|
||||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
|
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
|
||||||
|
|
||||||
from odoo import models, fields
|
from odoo import fields, models
|
||||||
|
|
||||||
|
|
||||||
class ResConfigSettings(models.TransientModel):
|
class ResConfigSettings(models.TransientModel):
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
# © 2011-2014 Akretion (Alexis de Lattre <alexis.delattre@akretion.com>)
|
# Copyright 2011-2014 Akretion (<alexis.delattre@akretion.com>)
|
||||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||||
|
|
||||||
from odoo import models, fields
|
from odoo import fields, models
|
||||||
|
|
||||||
|
|
||||||
class ResCountry(models.Model):
|
class ResCountry(models.Model):
|
||||||
|
|||||||
BIN
intrastat_base/static/description/icon.png
Normal file
BIN
intrastat_base/static/description/icon.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 9.2 KiB |
@@ -12,9 +12,9 @@
|
|||||||
<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">
|
||||||
<group name="advanced_booleans" position="inside">
|
<field name="active" position="before">
|
||||||
<field name="exclude_from_intrastat_if_present"/>
|
<field name="exclude_from_intrastat_if_present"/>
|
||||||
</group>
|
</field>
|
||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
|
|||||||
@@ -15,17 +15,16 @@
|
|||||||
<xpath expr="//div[@id='recommended_apps']" position="after">
|
<xpath expr="//div[@id='recommended_apps']" position="after">
|
||||||
<h2>Intrastat</h2>
|
<h2>Intrastat</h2>
|
||||||
<div class="row mt16 o_settings_container" id="intrastat">
|
<div class="row mt16 o_settings_container" id="intrastat">
|
||||||
<div class="col-xs-12 col-md-6 o_setting_box">
|
<div class="col-xs-12 col-md-12 o_setting_box">
|
||||||
|
<div class="o_setting_left_pane"/>
|
||||||
<div class="o_setting_right_pane">
|
<div class="o_setting_right_pane">
|
||||||
<div class="content-group" id="intrastat_content_grp">
|
<div class="row">
|
||||||
<div class="row mt16">
|
|
||||||
<label for="intrastat_remind_user_ids" class="col-md-5 o_light_label"/>
|
<label for="intrastat_remind_user_ids" class="col-md-5 o_light_label"/>
|
||||||
<field name="intrastat_remind_user_ids" widget="many2many_tags"/>
|
<field name="intrastat_remind_user_ids" widget="many2many_tags"/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
</xpath>
|
</xpath>
|
||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
|
|||||||
Reference in New Issue
Block a user