mirror of
https://github.com/bringout/oca-ocb-l10n_europe.git
synced 2026-04-26 19:22:02 +02:00
19.0 vanilla
This commit is contained in:
parent
ff721d030e
commit
7721452493
1826 changed files with 124775 additions and 274114 deletions
4
odoo-bringout-oca-ocb-l10n_lt/l10n_lt/models/__init__.py
Normal file
4
odoo-bringout-oca-ocb-l10n_lt/l10n_lt/models/__init__.py
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
||||
from . import account_journal
|
||||
from . import account_tax
|
||||
from . import template_lt
|
||||
|
|
@ -0,0 +1,19 @@
|
|||
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 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 == 'LT':
|
||||
account_vals.setdefault('tag_ids', [])
|
||||
account_vals['tag_ids'] += [
|
||||
Command.link(self.env.ref('l10n_lt.account_account_tag_b_4').id),
|
||||
]
|
||||
|
||||
return account_vals
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
from odoo import models, fields
|
||||
|
||||
|
||||
class AccountTax(models.Model):
|
||||
_inherit = 'account.tax'
|
||||
|
||||
l10n_lt_tax_code = fields.Char(string='Tax Code', help='The Lithuanian tax system has a code for standard taxes, to use in iSAF and SAFT.')
|
||||
58
odoo-bringout-oca-ocb-l10n_lt/l10n_lt/models/template_lt.py
Normal file
58
odoo-bringout-oca-ocb-l10n_lt/l10n_lt/models/template_lt.py
Normal file
|
|
@ -0,0 +1,58 @@
|
|||
# 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('lt')
|
||||
def _get_lt_template_data(self):
|
||||
return {
|
||||
'property_account_receivable_id': 'account_account_template_2410',
|
||||
'property_account_payable_id': 'account_account_template_4430',
|
||||
'property_stock_valuation_account_id': 'account_account_template_2040',
|
||||
'code_digits': '6',
|
||||
}
|
||||
|
||||
@template('lt', 'res.company')
|
||||
def _get_lt_res_company(self):
|
||||
return {
|
||||
self.env.company.id: {
|
||||
'anglo_saxon_accounting': True,
|
||||
'account_fiscal_country_id': 'base.lt',
|
||||
'bank_account_code_prefix': '271',
|
||||
'cash_account_code_prefix': '272',
|
||||
'transfer_account_code_prefix': '273',
|
||||
'account_default_pos_receivable_account_id': 'account_account_template_2411',
|
||||
'income_currency_exchange_account_id': 'account_account_template_5803',
|
||||
'expense_currency_exchange_account_id': 'account_account_template_6803',
|
||||
'account_journal_early_pay_discount_loss_account_id': 'account_account_template_509',
|
||||
'account_journal_early_pay_discount_gain_account_id': 'account_account_template_6209',
|
||||
'account_sale_tax_id': 'account_tax_template_sales_21',
|
||||
'account_purchase_tax_id': 'account_tax_template_purchase_21',
|
||||
'expense_account_id': 'account_account_template_6000',
|
||||
'income_account_id': 'account_account_template_5000',
|
||||
'account_stock_journal_id': 'inventory_valuation',
|
||||
'account_stock_valuation_id': 'account_account_template_2010',
|
||||
},
|
||||
}
|
||||
def _setup_utility_bank_accounts(self, template_code, company, template_data):
|
||||
super()._setup_utility_bank_accounts(template_code, company, template_data)
|
||||
if template_code == "lt":
|
||||
bank_tags = self.env.ref('l10n_lt.account_account_tag_b_4')
|
||||
company.account_journal_suspense_account_id.tag_ids |= bank_tags
|
||||
company.transfer_account_id.tag_ids |= bank_tags
|
||||
|
||||
other_operating_results_tags = self.env.ref('l10n_lt.account_account_tag_6_other_operating_results')
|
||||
company.default_cash_difference_income_account_id.tag_ids |= other_operating_results_tags
|
||||
company.default_cash_difference_expense_account_id.tag_ids |= other_operating_results_tags
|
||||
|
||||
@template('lt', 'account.account')
|
||||
def _get_lt_account_account(self):
|
||||
return {
|
||||
'account_account_template_2010': {
|
||||
'account_stock_expense_id': 'account_account_template_6208',
|
||||
'account_stock_variation_id': 'account_account_template_6005',
|
||||
},
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue