chore: import enterprise addons 19.0 bulk snapshot

This commit is contained in:
1b-agent committed 2026-09-16 10:13:08 +00:00
commit ca4af030d3
39951 files changed
+15570005

No files matched your search

+1
View File
@@ -0,0 +1 @@
from . import models
+1
View File
@@ -0,0 +1 @@
{'name': 'Spain - Intrastat Declaration', 'category': 'Accounting/Localizations/Reporting', 'description': '\n Spain - Intrastat Report\n ', 'depends': [], 'data': ['data/account_return_data.xml'], 'auto_install': True, 'author': 'Odoo S.A.', 'license': 'LGPL-3'}
@@ -0,0 +1,24 @@
<?xml version='1.0' encoding='utf-8'?>
<odoo>
<data>
<record id='es_intrastat_goods_return_type' model='account.return.type'>
<field name='name'>Intrastat (Goods)</field>
<field name='report_id' ref='account_intrastat.intrastat_report'/>
<field name='country_id' ref='base.es'/>
<field name='auto_generate' eval='False'/>
<field name='default_deadline_periodicity'>monthly</field>
<field name='default_deadline_days_delay'>12</field>
</record>
<record id='es_intrastat_service_return_type' model='account.return.type'>
<field name='name'>Intrastat (Services)</field>
<field name='report_id' ref='account_intrastat.intrastat_report_services'/>
<field name='country_id' ref='base.es'/>
<field name='auto_generate' eval='False'/>
<field name='default_deadline_periodicity'>monthly</field>
<field name='default_deadline_days_delay'>12</field>
</record>
</data>
</odoo>
+44
View File
@@ -0,0 +1,44 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * l10n_es_intrastat
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 19.1a1+e\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2025-10-13 06:03+0000\n"
"PO-Revision-Date: 2026-04-20 07:17+0000\n"
"Last-Translator: Anonymous <[email protected]>\n"
"Language-Team: Spanish <https://translate.odoo.com/projects/odoo-19-l10n/"
"l10n_es_intrastat/es/>\n"
"Language: es\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"
"X-Generator: Weblate 5.16.2\n"
#. module: l10n_es_intrastat
#: model:ir.model,name:l10n_es_intrastat.model_account_return_type
msgid "Accounting Return Type"
msgstr "Tipo de declaración contable"
#. module: l10n_es_intrastat
#: model:ir.model.fields,field_description:l10n_es_intrastat.field_account_return_type__display_name
msgid "Display Name"
msgstr "Nombre mostrado"
#. module: l10n_es_intrastat
#: model:ir.model.fields,field_description:l10n_es_intrastat.field_account_return_type__id
msgid "ID"
msgstr "ID"
#. module: l10n_es_intrastat
#: model:account.return.type,name:l10n_es_intrastat.es_intrastat_goods_return_type
msgid "Intrastat (Goods)"
msgstr "Intrastat (Bienes)"
#. module: l10n_es_intrastat
#: model:account.return.type,name:l10n_es_intrastat.es_intrastat_service_return_type
msgid "Intrastat (Services)"
msgstr "Intrastat (Servicios)"
@@ -0,0 +1,41 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * l10n_es_intrastat
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 19.0+e\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2025-12-30 19:06+0000\n"
"PO-Revision-Date: 2025-12-30 19:06+0000\n"
"Last-Translator: \n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"
#. module: l10n_es_intrastat
#: model:ir.model,name:l10n_es_intrastat.model_account_return_type
msgid "Accounting Return Type"
msgstr ""
#. module: l10n_es_intrastat
#: model:ir.model.fields,field_description:l10n_es_intrastat.field_account_return_type__display_name
msgid "Display Name"
msgstr ""
#. module: l10n_es_intrastat
#: model:ir.model.fields,field_description:l10n_es_intrastat.field_account_return_type__id
msgid "ID"
msgstr ""
#. module: l10n_es_intrastat
#: model:account.return.type,name:l10n_es_intrastat.es_intrastat_goods_return_type
msgid "Intrastat (Goods)"
msgstr ""
#. module: l10n_es_intrastat
#: model:account.return.type,name:l10n_es_intrastat.es_intrastat_service_return_type
msgid "Intrastat (Services)"
msgstr ""
+1
View File
@@ -0,0 +1 @@
from . import account_return_type
@@ -0,0 +1,62 @@
from dateutil.relativedelta import relativedelta
from odoo import api, fields, models
class AccountReturnType(models.Model):
_inherit = 'account.return.type'
@api.model
def _generate_all_returns(self, country_code, main_company, tax_unit=None):
"""
Generate all periodic returns for Spain (ES).
This includes Intrastat returns for goods and services,
which are only created if sales or purchase balance exceeds the legal threshold (400,000€).
"""
super()._generate_all_returns(country_code, main_company, tax_unit=tax_unit)
if country_code == 'ES':
# NOTE: This currently includes triangular sales.
# TODO: We may want to exclude them in the future using l10n_es_reports_mod349_invoice_type == 'T'.
tax_return_report = self.env.ref('l10n_es_reports.es_mod303_tax_return_type').report_id
expression_purchase = self.env.ref('l10n_es.mod_303_casilla_10_balance')
expression_sale = self.env.ref('l10n_es.mod_303_casilla_59_balance')
expressions = expression_purchase + expression_sale
# Date range for the current year
today = fields.Date.context_today(self)
intrastat_date_from = fields.Date.start_of(today - relativedelta(years=1), 'year')
intrastat_date_to = fields.Date.end_of(today, 'year')
date = {
'date_from': fields.Date.to_string(intrastat_date_from),
'date_to': fields.Date.to_string(intrastat_date_to),
'filter': 'custom',
'mode': 'range',
}
# Evaluate each Intrastat return type
for return_type in [
self.env.ref('l10n_es_intrastat.es_intrastat_goods_return_type'),
self.env.ref('l10n_es_intrastat.es_intrastat_service_return_type'),
]:
# Prepare options for computing return values
options = {
'date': date,
'selected_variant_id': return_type.report_id.id,
'sections_source_id': return_type.report_id.id,
'tax_unit': 'company_only' if not tax_unit else tax_unit.id,
}
company_ids = self.env['account.return'].sudo()._get_company_ids(main_company, tax_unit, return_type.report_id)
options = return_type.report_id.with_context(allowed_company_ids=company_ids.ids).get_options(previous_options=options)
# Compute the balance for the threshold expressions
totals_per_group = tax_return_report._compute_expression_totals_for_each_column_group(expressions, options, warnings={})
totals = next(iter(totals_per_group.values()))
balance_purchase = totals.get(expression_purchase, {}).get('value') or 0
balance_sale = totals.get(expression_sale, {}).get('value') or 0
# The Intrastat return must be generated when either the total sales or total purchases balance is equal to or greater than €400,000.
if main_company.currency_id.compare_amounts(balance_sale, 400_000) >= 0 or main_company.currency_id.compare_amounts(balance_purchase, 400_000) >= 0:
months_offset = return_type._get_periodicity_months_delay(main_company)
return_type._try_create_return_for_period(today - relativedelta(months=months_offset), main_company, tax_unit)