OS template account

This commit is contained in:
2026-04-23 21:43:03 +02:00
parent 04e9d7dc03
commit 9879926f08
6 changed files with 2457 additions and 0 deletions

View File

@@ -0,0 +1,15 @@
# This file is part of Tryton. The COPYRIGHT file at the top level of
# this repository contains the full copyright notices and license terms.
from trytond.pool import Pool
from . import account
def register():
Pool.register(
account.AccountTemplate,
module='account_ch_os', type_='model')
Pool.register(
account.CreateChart,
module='account_ch_os', type_='wizard')

View File

@@ -0,0 +1,27 @@
# This file is part of Tryton. The COPYRIGHT file at the top level of
# this repository contains the full copyright notices and license terms.
from trytond.pool import Pool, PoolMeta
class AccountTemplate(metaclass=PoolMeta):
__name__ = 'account.account.template'
class CreateChart(metaclass=PoolMeta):
__name__ = 'account.create_chart'
def default_properties(self, fields):
pool = Pool()
ModelData = pool.get('ir.model.data')
defaults = super().default_properties(fields)
try:
template_id = ModelData.get_id('account_ch_os', 'root')
except KeyError:
return defaults
if self.account.account_template.id == template_id:
defaults['account_receivable'] = self.get_account(
'account_ch_os.acct_110000')
defaults['account_payable'] = self.get_account(
'account_ch_os.acct_200000')
return defaults

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,2 @@
# This file is part of Tryton. The COPYRIGHT file at the top level of
# this repository contains the full copyright notices and license terms.

View File

@@ -0,0 +1,12 @@
# This file is part of Tryton. The COPYRIGHT file at the top level of
# this repository contains the full copyright notices and license terms.
from trytond.tests.test_tryton import ModuleTestCase
class AccountCHOSTestCase(ModuleTestCase):
'Test Account CH OS module'
module = 'account_ch_os'
del ModuleTestCase

View File

@@ -0,0 +1,6 @@
[tryton]
version=7.2.3
depends:
account
xml:
account_ch_os.xml