mirror of
https://github.com/bringout/oca-ocb-l10n_europe.git
synced 2026-04-27 01:22:05 +02:00
19.0 vanilla
This commit is contained in:
parent
ff721d030e
commit
7721452493
1826 changed files with 124775 additions and 274114 deletions
3
odoo-bringout-oca-ocb-l10n_uk/l10n_uk/models/__init__.py
Normal file
3
odoo-bringout-oca-ocb-l10n_uk/l10n_uk/models/__init__.py
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
||||
from . import template_uk
|
||||
from . import template_xi
|
||||
63
odoo-bringout-oca-ocb-l10n_uk/l10n_uk/models/template_uk.py
Normal file
63
odoo-bringout-oca-ocb-l10n_uk/l10n_uk/models/template_uk.py
Normal file
|
|
@ -0,0 +1,63 @@
|
|||
# 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('uk')
|
||||
def _get_uk_template_data(self):
|
||||
return {
|
||||
'property_account_receivable_id': '110000',
|
||||
'property_account_payable_id': '210000',
|
||||
'code_digits': '6',
|
||||
}
|
||||
|
||||
@template('uk', 'res.company')
|
||||
def _get_uk_res_company(self):
|
||||
return {
|
||||
self.env.company.id: {
|
||||
'anglo_saxon_accounting': True,
|
||||
'account_fiscal_country_id': 'base.uk',
|
||||
'bank_account_code_prefix': '1200',
|
||||
'cash_account_code_prefix': '1210',
|
||||
'transfer_account_code_prefix': '1220',
|
||||
'account_default_pos_receivable_account_id': '110400',
|
||||
'income_currency_exchange_account_id': '770000',
|
||||
'expense_currency_exchange_account_id': '770000',
|
||||
'account_sale_tax_id': 'ST11',
|
||||
'account_purchase_tax_id': 'PT_20_G',
|
||||
'expense_account_id': '500000',
|
||||
'income_account_id': '400000',
|
||||
'deferred_expense_account_id': '110300',
|
||||
'deferred_revenue_account_id': '210900',
|
||||
'account_stock_journal_id': 'inventory_valuation',
|
||||
'account_stock_valuation_id': '100100',
|
||||
},
|
||||
}
|
||||
|
||||
def _post_load_data(self, template_code, company, template_data):
|
||||
"""If the company is located in Northern Ireland, activate the relevant taxes and fiscal postions."""
|
||||
result = super()._post_load_data(template_code, company, template_data)
|
||||
|
||||
is_ni_state = {
|
||||
'base.state_uk18', 'base.state_uk19', 'base.state_uk20', 'base.state_uk21',
|
||||
'base.state_uk22', 'base.state_uk23', 'base.state_uk24',
|
||||
}.intersection(
|
||||
company.state_id._get_external_ids().get(company.state_id.id, [])
|
||||
)
|
||||
|
||||
if is_ni_state or company.country_id.code == 'XI':
|
||||
for xmlid in ['PT8', 'ST4', 'PT7', 'account_fiscal_position_ni_to_eu_b2b']:
|
||||
self.ref(xmlid).active = True
|
||||
|
||||
return result
|
||||
|
||||
@template('uk', 'account.account')
|
||||
def _get_uk_account_account(self):
|
||||
return {
|
||||
'100100': {
|
||||
'account_stock_variation_id': '630000',
|
||||
},
|
||||
}
|
||||
18
odoo-bringout-oca-ocb-l10n_uk/l10n_uk/models/template_xi.py
Normal file
18
odoo-bringout-oca-ocb-l10n_uk/l10n_uk/models/template_xi.py
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
# 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('xi')
|
||||
def _get_mc_template_data(self):
|
||||
return {
|
||||
'parent': 'uk',
|
||||
}
|
||||
|
||||
def _deref_account_tags(self, template_code, tax_data):
|
||||
if template_code == 'xi':
|
||||
template_code = 'uk'
|
||||
return super()._deref_account_tags(template_code, tax_data)
|
||||
Loading…
Add table
Add a link
Reference in a new issue