Error assert issubclass(cls, PoolBase), cls

Hi i need to activate a module .

My issue is that during the activation of the module it shows me this error:

Traceback (most recent call last):
  File "trytond/bin/trytond-admin", line 21, in <module>
    admin.run(options)
  File "/home/developer/venv/project/trytond/trytond/admin.py", line 53, in run
    activatedeps=options.activatedeps)
  File "/home/developer/venv/project/trytond/trytond/pool.py", line 160, in init
    lang=lang, activatedeps=activatedeps)
  File "/home/developer/venv/project/trytond/trytond/modules/__init__.py", line 420, in load_modules
    _load_modules(update)
  File "/home/developer/venv/project/trytond/trytond/modules/__init__.py", line 390, in _load_modules
    load_module_graph(graph, pool, update, lang)
  File "/home/developer/venv/project/trytond/trytond/modules/__init__.py", line 201, in load_module_graph
    classes = pool.fill(module, modules)
  File "/home/developer/venv/project/trytond/trytond/pool.py", line 221, in fill
    assert issubclass(cls, PoolBase), cls
AssertionError: <class 'trytond.modules.payroll.payslip.Intervention'>

what does this error mean exactly !!!

It means that you have a class named trytond.modules.payroll.payslip.Intervention that does not inherit from any Model class so it can not be registered in the pool.

You need to make it inherit from some Model or remove it from the pool to fix it.

Or use the metaclass PoolMeta if it is to extend an existing model.

Hi M.@ced, in the module, the class is already defined like that:

class Intervention(metaclass=PoolMeta):

So as @pokoli said it is no a class that extends an existing model so it must at least inherit from Model if it is a model, from Wizard if it is a wizard and from Report if it is a report.

Hello,
I have the same problem with a Sale class.

class Sale(metaclass=PoolMeta):
    """ Ajout de contrat à la vue Vente """
    __name__= 'sale.sale'

    contract = fields.One2Many('contract.contract', 'contract', "Contrats")

  • The sale module is activated.
  • I have already overridden the sale class in another module.

Error:

Traceback (most recent call last):
  File "/trytond/wsgi.py", line 118, in dispatch_request
    self.check_request_size(request, max_request_size)
  File "/trytond/wsgi.py", line 98, in check_request_size
    if request.user_id:
  File "/functools.py", line 969, in __get__
    val = self.func(instance)
  File "/trytond/protocols/wrappers.py", line 95, in user_id
    user_id = security.check(
  File "/trytond/security.py", line 82, in check
    pool = _get_pool(dbname)
  File "/trytond/security.py", line 18, in _get_pool
    pool.init()
  File "/trytond/pool.py", line 165, in init
    restart = not load_modules(
  File "/trytond/modules/__init__.py", line 443, in load_modules
    _load_modules(update)
  File "/trytond/modules/__init__.py", line 406, in _load_modules
    load_module_graph(graph, pool, update, lang)
  File "/trytond/modules/__init__.py", line 221, in load_module_graph
    classes = pool.fill(module, modules)
  File "/trytond/pool.py", line 236, in fill
    assert issubclass(cls, PoolBase), cls
AssertionError: <class 'trytond.modules.contract.contract_contract.Sale'>

Probably sale is not declared as a dependency of contract module.

That’s it.
Thanks I could have searched for a long time

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