Installation of SYSCOHADA Charts of accounts

Hello Community!

I have tried to installed a syscohada chart of account( it is used by about 14 countries in Africa and close to french chart of account) on tryton 6.0.x from a module that was working well on tryton 4.2.
But now I’m getting the following errors:

Traceback (most recent call last):
  File "/trytond/wsgi.py", line 117, in dispatch_request
    return endpoint(request, **request.view_args)
  File "/trytond/protocols/dispatcher.py", line 47, in rpc
    request, database_name, *request.rpc_params)
  File "/trytond/wsgi.py", line 84, in auth_required
    return wrapped(*args, **kwargs)
  File "/trytond/protocols/wrappers.py", line 178, in wrapper
    return func(request, pool, *args, **kwargs)
  File "/trytond/protocols/dispatcher.py", line 180, in _dispatch
    result = rpc.result(meth(*c_args, **c_kwargs))
  File "/trytond/wizard/wizard.py", line 313, in execute
    return wizard._execute(state_name)
  File "/trytond/wizard/wizard.py", line 344, in _execute
    result = self._execute(transition())
  File "/trytond/ir/module.py", line 572, in transition_upgrade
    pool.init(update=update, lang=lang)
  File "/trytond/pool.py", line 166, in init
    activatedeps=activatedeps)
  File "/trytond/modules/__init__.py", line 448, in load_modules
    _load_modules(update)
  File "/trytond/modules/__init__.py", line 411, in _load_modules
    load_module_graph(graph, pool, update, lang)
  File "/trytond/modules/__init__.py", line 245, in load_module_graph
    pool, module, package_state, modules, lang)
  File "/trytond/convert.py", line 424, in __init__
    self.ModelData = pool.get('ir.model.data')
  File "/trytond/pool.py", line 187, in get
    return self._pool[self.database_name][type][name]
KeyError: 'ir.model.data'

Fault: 'ir.model.data'

Any idea of how to fix it?
Best regards

It looks like the module is not compatible with your Tryton series.
You should try to activate it from command line to get better error message.

By the way, this remember me that I have a pending patch to include SYSCOHADA chart of accounts: Add account SYSCOHADA module (!766) · Merge requests · Tryton / Tryton · GitLab

This module was made par @RichmondFiko. It has all the accounts from SYSCOHADA chart it was working well on tryton 4 series.
But not on 6.
To include it in tryton there are just few things to change in the code(the setup file is just about 95 lines of code)
the module can be found here:

Best regards

Could you check the version of Add account SYSCOHADA module (!766) · Merge requests · Tryton / Tryton · GitLab
The goal is to include it in standard and have it maintained for future releases.

I have managed to make the module for the merge request 766 to working in tryton 6.0.39 by modifying the version to 6.0.39 in tryton.cfg and by modifying account.py. Of course it work without modication using the 7.1.0 for now.

from trytond.pool import Pool, PoolMeta


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)
        for lang in ['fr']:
            for version in ['2001', '2016']:
                try:
                    template_id = ModelData.get_id(
                        'account_syscohada.root_%s_%s' % (version, lang))
                except KeyError:
                    continue
                if self.account.account_template.id == template_id:
                    # defaults['account_receivable'] = self.get_account(
                    #     'account_syscohada.4111_%s_%s' % (version, lang))
                    # defaults['account_payable'] = self.get_account(
                    #     'account_syscohada.4011_%s_%s' % (version, lang))
                    break
        return defaults