Contributors mailing list archives
contributors@odoo-community.org
Browse archives
Re: odoo13 unittest: installed modules not available while testing
by
Camptocamp SA, Simone Orsi
Hi,
without your test class it is hard to guess what's wrong ;)
Can you provide it?
Bests
Hi there I try to add some functionality to the payroll. Now when I try to access the payroll stuff from within a test like so: self.env['hr.payroll.structure'] I get a traceback: Traceback (most recent call last): Debug Console, prompt 68, line 1 import base64 File "/home/robert/projects/odoo13/odoo13/downloads/odoo-13.0.post20201211/odoo/api.py", line 463, in __getitem__ return self.registry[model_name]._browse(self, (), ()) File "/home/robert/projects/odoo13/odoo13/downloads/odoo-13.0.post20201211/odoo/modules/registry.py", line 177, in __getitem__ return self.models[model_name] builtins.KeyError: 'hr.payroll.structure' However, when I do exactly the same when not being in a unittest, everything works fine. What could be the reason? I am running on an ubuntu: Distributor ID: Ubuntu Description: Ubuntu 20.04.2 LTS Release: 20.04 Codename: focal using Python: python Python 3.8.2 (default, Feb 25 2020, 13:04:52) [GCC 9.2.1 20200224] on linux thanks for your input Robert_______________________________________________
Mailing-List: https://odoo-community.org/groups/contributors-15
Post to: mailto:contributors@odoo-community.org
Unsubscribe: https://odoo-community.org/groups?unsubscribe
--
Simone Orsi
Full stack Python web developer,
Odoo specialist,
Odoo Community Board Member,
in love with open source.
Reference
-
odoo13 unittest: installed modules not available while testing
byrobert-
solved:Re: odoo13 unittest: installed modules not available while testing
byrobert -
Re: odoo13 unittest: installed modules not available while testing
byModoolar, Petar Najman -
Re: odoo13 unittest: installed modules not available while testing
byrobert -
Re: odoo13 unittest: installed modules not available while testing
byCamptocamp SA, Simone Orsi
-