19.0 vanilla

This commit is contained in:
Ernad Husremovic 2026-03-09 09:31:28 +01:00
parent ff721d030e
commit 7721452493
1826 changed files with 124775 additions and 274114 deletions

View file

@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from . import chart_template
from . import account_journal
from . import template_at

View file

@ -0,0 +1,22 @@
# -*- coding: utf-8 -*-
from odoo import api, models, Command
class AccountJournal(models.Model):
_inherit = 'account.journal'
@api.model
def _prepare_liquidity_account_vals(self, company, code, vals):
''' Set Balance Sheet and SAF-T tags on new bank and cash accounts.'''
# OVERRIDE
account_vals = super()._prepare_liquidity_account_vals(company, code, vals)
if company.account_fiscal_country_id.code == 'AT':
account_vals.setdefault('tag_ids', [])
account_vals['tag_ids'] += [
Command.link(self.env.ref('l10n_at.account_tag_l10n_at_ABIV').id),
Command.link(self.env.ref('l10n_at.account_tag_external_code_2300').id),
]
return account_vals

View file

@ -1,16 +0,0 @@
# -*- coding: utf-8 -*-
from odoo import models
class AccountChartTemplate(models.Model):
_inherit = 'account.chart.template'
# Write paperformat and report template used on company
def _load(self, company):
res = super(AccountChartTemplate, self)._load(company)
if self == self.env.ref('l10n_at.l10n_at_chart_template'):
company.write({
'external_report_layout_id': self.env.ref('l10n_din5008.external_layout_din5008').id,
'paperformat_id': self.env.ref('l10n_din5008.paperformat_euro_din').id
})
return res

View file

@ -0,0 +1,57 @@
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import models
from odoo.addons.account.models.chart_template import template
class AccountChartTemplate(models.AbstractModel):
_inherit = 'account.chart.template'
@template('at')
def _get_at_template_data(self):
return {
'visible': True,
'property_account_receivable_id': 'chart_at_template_2000',
'property_account_payable_id': 'chart_at_template_3300',
'property_stock_valuation_account_id': 'chart_at_template_1600',
'code_digits': '4',
}
@template('at', 'res.company')
def _get_at_res_company(self):
return {
self.env.company.id: {
'account_fiscal_country_id': 'base.at',
'bank_account_code_prefix': '280',
'cash_account_code_prefix': '270',
'transfer_account_code_prefix': '288',
'account_default_pos_receivable_account_id': 'chart_at_template_2099',
'income_currency_exchange_account_id': 'chart_at_template_4860',
'expense_currency_exchange_account_id': 'chart_at_template_7860',
'account_journal_early_pay_discount_loss_account_id': 'chart_at_template_5800',
'account_journal_early_pay_discount_gain_account_id': 'chart_at_template_8350',
'external_report_layout_id': 'l10n_din5008.external_layout_din5008',
'paperformat_id': 'l10n_din5008.paperformat_euro_din',
'account_sale_tax_id': 'account_tax_template_sales_20_code022',
'account_purchase_tax_id': 'account_tax_template_purchase_20_code060',
'income_account_id': 'chart_at_template_4000',
'expense_account_id': 'chart_at_template_5010',
'account_stock_journal_id': 'inventory_valuation',
'account_stock_valuation_id': 'chart_at_template_1600',
},
}
def _setup_utility_bank_accounts(self, template_code, company, template_data):
super()._setup_utility_bank_accounts(template_code, company, template_data)
if template_code == "at":
bank_tags = self.env.ref('l10n_at.account_tag_external_code_2300') | self.env.ref('l10n_at.account_tag_l10n_at_ABIV')
company.account_journal_suspense_account_id.tag_ids = bank_tags
company.transfer_account_id.tag_ids = self.env.ref('l10n_at.account_tag_external_code_2885') | self.env.ref('l10n_at.account_tag_l10n_at_ABIV')
@template('at', 'account.account')
def _get_at_account_account(self):
return {
'chart_at_template_1600': {
'account_stock_expense_id': 'chart_at_template_5010',
'account_stock_variation_id': 'chart_at_template_5880',
},
}