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

+9
View File
@@ -0,0 +1,9 @@
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
# Copyright (c) 2022 WT-IO-IT GmbH (https://www.wt-io-it.at)
# Mag. Wolfgang Taferner <[email protected]>
from . import account_report_l10n_at_balance_custom_handler
from . import account_return
from . import account_sales_report
@@ -0,0 +1,28 @@
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
# Copyright (c) 2023 WT-IO-IT GmbH (https://www.wt-io-it.at)
# Mag. Wolfgang Taferner <[email protected]>
from odoo import models, _
from odoo.tools import float_compare
class AccountReportL10n_AtBalanceCustomHandler(models.AbstractModel):
_name = 'account.report.l10n_at.balance.custom.handler'
_inherit = ['account.balance.sheet.report.handler']
_description = 'Austrian Balance Sheet Report Custom Handler'
def _custom_line_postprocessor(self, report, options, lines):
""" Postprocesses the result of the report's _get_lines() before returning it. """
equity_root = self.env.ref('l10n_at_reports.account_financial_report_l10n_at_paragraph_224_ugb_line_passiva_1', raise_if_not_found=False)
for line in lines:
_model, res_id = report._get_model_info_from_id(line['id'])
if equity_root and equity_root.id == res_id:
for column in line['columns']:
if column['expression_label'] == 'balance':
if float_compare(column['no_format'], 0, 2) < 0:
line['name'] = _("A. Negative equity capital")
# We do only consider the first result, otherwise a positive equity capital this year will
# be overridden by a negative equity capital in the previous comparison years
break
return lines
+45
View File
@@ -0,0 +1,45 @@
from itertools import chain
from dateutil.relativedelta import relativedelta
from odoo import fields, models
class AccountReturnType(models.Model):
_inherit = 'account.return.type'
def _generate_all_returns(self, country_code, main_company, tax_unit=None):
rslt = super()._generate_all_returns(country_code, main_company, tax_unit=tax_unit)
if country_code == 'AT' and (ec_sales_return_type := self.env.ref('l10n_at_reports.at_ec_sales_list_return_type', raise_if_not_found=False)):
months_offset = ec_sales_return_type._get_periodicity_months_delay(main_company)
previous_period_start, previous_period_end = ec_sales_return_type._get_period_boundaries(main_company, fields.Date.context_today(self) - relativedelta(months=months_offset))
company_ids = self.env['account.return'].sudo()._get_company_ids(main_company, tax_unit, ec_sales_return_type.report_id)
ec_sales_list_tags_info = self.env['l10n_at.ec.sales.report.handler']._get_tax_tags_for_at_sales_report()
ec_sales_list_tag_ids = list(chain(*ec_sales_list_tags_info.values()))
need_ec_sales_list = bool(self.env['account.move.line'].search_count([
('tax_tag_ids', 'in', ec_sales_list_tag_ids),
*self.env['account.move.line']._check_company_domain(company_ids.ids),
('date', '>=', previous_period_start),
('date', '<=', previous_period_end),
], limit=1))
if need_ec_sales_list:
ec_sales_return_type._try_create_return_for_period(previous_period_start, main_company, tax_unit)
return rslt
class AccountReturn(models.Model):
_inherit = 'account.return'
def _evaluate_deadline(self, company, return_type, return_type_external_id, date_from, date_to):
months_per_period = return_type._get_periodicity_months_delay(company)
if return_type_external_id == "l10n_at_reports.at_tax_return_type":
return date_to + relativedelta(months=2, day=15)
if return_type_external_id == "l10n_at_reports.at_ec_sales_list_return_type" and months_per_period in (1, 3):
return date_to + relativedelta(months=1, day=31)
return super()._evaluate_deadline(company, return_type, return_type_external_id, date_from, date_to)
@@ -0,0 +1,44 @@
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
# Copyright (c) 2022 WT-IO-IT GmbH (https://www.wt-io-it.at)
# Mag. Wolfgang Taferner <[email protected]>
from odoo import models
class L10n_AtEcSalesReportHandler(models.AbstractModel):
_name = 'l10n_at.ec.sales.report.handler'
_inherit = ['account.ec.sales.report.handler']
_description = 'Austrian EC Sales Report Custom Handler'
def _custom_options_initializer(self, report, options, previous_options):
"""
Add the invoice lines search domain that is specific to the country.
Typically, the taxes account.report.expression ids relative to the country for the triangular, sale of goods
or services.
:param dict options: Report options
:return dict: The modified options dictionary
"""
super()._init_core_custom_options(report, options, previous_options)
ec_operation_category = options.setdefault('sales_report_taxes', {})
ec_operation_category.update(self._get_tax_tags_for_at_sales_report())
# Change the names of the taxes to specific ones that are dependant to the tax type
ec_operation_category['operation_category'] = {
'goods': 'L',
'triangular': 'D',
'services': 'S',
}
options.update({'sales_report_taxes': ec_operation_category})
def _get_tax_tags_for_at_sales_report(self):
goods = self.env.ref('l10n_at.tax_report_line_l10n_at_tva_line_4_8_tag')
goods |= self.env.ref('l10n_at.tax_report_line_l10n_at_tva_line_4_9_tag')
triangular = self.env.ref('l10n_at.tax_report_line_l10n_at_tva_line_3_zm_igl3_tag')
services = self.env.ref('l10n_at.tax_report_line_l10n_at_tva_line_3_zm_dl_tag')
return {
'goods': tuple(goods._get_matching_tags().ids),
'triangular': tuple(triangular._get_matching_tags().ids),
'services': tuple(services._get_matching_tags().ids),
}