mirror of
https://github.com/bringout/oca-ocb-l10n_europe.git
synced 2026-04-27 19:01:58 +02:00
19.0 vanilla
This commit is contained in:
parent
ff721d030e
commit
7721452493
1826 changed files with 124775 additions and 274114 deletions
29
odoo-bringout-oca-ocb-l10n_be/l10n_be/demo/account_demo.py
Normal file
29
odoo-bringout-oca-ocb-l10n_be/l10n_be/demo/account_demo.py
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
from odoo import api, models, Command
|
||||
|
||||
|
||||
class AccountChartTemplate(models.AbstractModel):
|
||||
_inherit = "account.chart.template"
|
||||
|
||||
@api.model
|
||||
def _get_demo_data(self, company=False):
|
||||
def link_tag(tag_xml_id):
|
||||
tag = self.env.ref(tag_xml_id, raise_if_not_found=False)
|
||||
return [Command.link(tag.id)] if tag else []
|
||||
|
||||
demo_data = super()._get_demo_data(company)
|
||||
if company.chart_template.startswith('be'):
|
||||
cid = company.id
|
||||
account_data = demo_data.setdefault('account.account', {})
|
||||
account_tag_map = {
|
||||
'a100': 'account.demo_capital_account',
|
||||
'a300': 'account.demo_stock_account',
|
||||
'a7600': 'account.demo_sale_of_land_account',
|
||||
'a6201': 'account.demo_ceo_wages_account',
|
||||
'a240000': 'account.demo_office_furniture_account',
|
||||
}
|
||||
account_data.update({
|
||||
f"account.{cid}_{account}": {'tag_ids': link_tag(tag)}
|
||||
for account, tag in account_tag_map.items()
|
||||
})
|
||||
|
||||
return demo_data
|
||||
Loading…
Add table
Add a link
Reference in a new issue