mirror of
https://github.com/bringout/oca-ocb-l10n_europe.git
synced 2026-04-27 13:42:01 +02:00
Initial commit: L10N_Europe packages
This commit is contained in:
commit
9803722600
2377 changed files with 380711 additions and 0 deletions
7
odoo-bringout-oca-ocb-l10n_nl/l10n_nl/models/__init__.py
Normal file
7
odoo-bringout-oca-ocb-l10n_nl/l10n_nl/models/__init__.py
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
||||
|
||||
from . import account_journal
|
||||
from . import account_chart_template
|
||||
from . import res_partner
|
||||
from . import res_company
|
||||
|
|
@ -0,0 +1,23 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
|
||||
from odoo import api, Command, models
|
||||
|
||||
|
||||
class AccountChartTemplate(models.Model):
|
||||
_inherit = 'account.chart.template'
|
||||
|
||||
def _load(self, company):
|
||||
# Add tag to 999999 account
|
||||
res = super(AccountChartTemplate, self)._load(company)
|
||||
if company.account_fiscal_country_id.code == 'NL':
|
||||
account = self.env['account.account'].search([('code', '=', '999999'), ('company_id', '=', self.env.company.id)])
|
||||
if account:
|
||||
account.tag_ids = [(4, self.env.ref('l10n_nl.account_tag_12').id)]
|
||||
return res
|
||||
|
||||
@api.model
|
||||
def _create_liquidity_journal_suspense_account(self, company, code_digits):
|
||||
account = super()._create_liquidity_journal_suspense_account(company, code_digits)
|
||||
if company.account_fiscal_country_id.code == 'NL':
|
||||
account.tag_ids = [Command.link(self.env.ref('l10n_nl.account_tag_25').id)]
|
||||
return account
|
||||
|
|
@ -0,0 +1,20 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
|
||||
from odoo import api, fields, models, _
|
||||
|
||||
|
||||
class AccountJournal(models.Model):
|
||||
_inherit = 'account.journal'
|
||||
|
||||
@api.model
|
||||
def _prepare_liquidity_account_vals(self, company, code, vals):
|
||||
# OVERRIDE
|
||||
account_vals = super()._prepare_liquidity_account_vals(company, code, vals)
|
||||
|
||||
if company.account_fiscal_country_id.code == 'NL':
|
||||
# Ensure the newly liquidity accounts have the right account tag in order to be part
|
||||
# of the Dutch financial reports.
|
||||
account_vals.setdefault('tag_ids', [])
|
||||
account_vals['tag_ids'].append((4, self.env.ref('l10n_nl.account_tag_25').id))
|
||||
|
||||
return account_vals
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
# coding: utf-8
|
||||
from odoo import fields, models
|
||||
|
||||
|
||||
class ResCompany(models.Model):
|
||||
_inherit = 'res.company'
|
||||
|
||||
l10n_nl_kvk = fields.Char(related='partner_id.l10n_nl_kvk', readonly=False)
|
||||
l10n_nl_oin = fields.Char(related='partner_id.l10n_nl_oin', readonly=False)
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
# coding: utf-8
|
||||
from odoo import fields, models
|
||||
|
||||
|
||||
class ResPartner(models.Model):
|
||||
_inherit = 'res.partner'
|
||||
|
||||
l10n_nl_kvk = fields.Char(string='KVK-nummer')
|
||||
l10n_nl_oin = fields.Char(string='Organisatie Indentificatie Nummer')
|
||||
Loading…
Add table
Add a link
Reference in a new issue