Proteus KeyError

I can’t access the “analytic_account_account” table with proteus.


from proteus import Model

Analytic = Model.get('analytic_account.account')


Traceback (most recent call last):
  File "/.../env_tryton/reprise-donnees-jm/", line 41, in <module>
  File "/.../env_tryton/reprise-donnees-jm/Controllers/", line 23, in create_analytics
    Analytic = Model.get('analytic_account.account')
  File "/.../env_tryton/lib/python3.9/site-packages/proteus/", line 760, in get
    class Spam(Model, metaclass=MetaModelFactory(name, config=config)()):
  File "/.../env_tryton/lib/python3.9/site-packages/proteus/", line 481, in __new__
    proxy = self.config.get_proxy(self.model_name)
  File "/.../env_tryton/lib/python3.9/site-packages/proteus/", line 299, in get_proxy
    return TrytondProxy(name, self, type=type)
  File "/.../env_tryton/lib/python3.9/site-packages/proteus/", line 225, in __init__
    self._object = config.pool.get(name, type=type)
  File "/.../env_tryton/lib/python3.9/site-packages/trytond/", line 188, in get
    return self._pool[self.database_name][type][name]
KeyError: 'analytic_account.account'

The analytic account module is installed correctly, the table is present in the database.

I have no problem with other table like “account_account”, “product_template”, “party_party”…

What’s going on here ?

proteus version = 6.4
tryton version = 6.4

Do you have the analytic_account module activated on your database? If the module is not activated it is expected to have such error.

Yes, it’s activated.

Are you sure you are connected to the correct database (the one with the module active)? (check your console command parameters)

I am stupid. I had not actually modified the database in my connection method.
Thanks for unlocking me.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.