In Odoo v9, every request calls `res.users.check()`, which stores one authentication attempt per request, which is false.
Besides, it easily leads to hitting ip-api.com rate limits, so now that API is only asked when seeing in form view (simply by setting the computed field as not stored).
Also, form view was hidden, so it's now visible.
Odoo v9 auth methods usually violate both old and new api; they just only work in old api, so I had to adapt some tests to use it instead.
Normal backport outside of that.
Include HACK for https://github.com/odoo/odoo/pull/24833, which explains the false positive problem we were having here: an addon being importable doesn't mean it is installed.
Without this patch, if your tests are run under a `PYTHONOPTIMIZE=2` precompiled environment, they'd fail with this error because a new `.pyo` file would be created.:
FAIL: test_basic (openerp.addons.module_auto_update.tests.test_addon_hash.TestAddonHash)
Traceback (most recent call last):
` File "/opt/odoo/auto/addons/module_auto_update/tests/test_addon_hash.py", line 41, in test_basic
` 'static/src/some.js',
` AssertionError: Lists differ: ['README.rst', 'data/f1.xml', ... != ['README.rst', 'data/f1.xml', ...
`
` First differing element 13:
` models/stuff.pyo
` static/src/some.js
`
` First list contains 1 additional elements.
` First extra element 14:
` static/src/some.js
`
` ['README.rst',
` 'data/f1.xml',
` 'data/f2.xml',
` 'i18n/en.po',
` 'i18n/en_US.po',
` 'i18n/fr.po',
` 'i18n/fr_BE.po',
` 'i18n/test.pot',
` 'i18n_extra/en.po',
` 'i18n_extra/fr.po',
` 'i18n_extra/nl_NL.po',
` 'models/stuff.py',
` 'models/stuff.pyc',
` - 'models/stuff.pyo',
` 'static/src/some.js']
Ran 3 tests in 0.005s
FAILED
With this patch, the `.pyo` file is included, so tests will pass anywhere.
Without this patch, when upgrading after you have stored the deprecated features parameter, the cursor became broken and no more migrations could happen. You got this error:
Traceback (most recent call last):
File "/usr/local/bin/odoo", line 6, in <module>
exec(compile(open(__file__).read(), __file__, 'exec'))
File "/opt/odoo/custom/src/odoo/odoo.py", line 160, in <module>
main()
File "/opt/odoo/custom/src/odoo/odoo.py", line 157, in main
openerp.cli.main()
File "/opt/odoo/custom/src/odoo/openerp/cli/command.py", line 64, in main
o.run(args)
File "/opt/odoo/custom/src/odoo/openerp/cli/shell.py", line 65, in run
self.shell(openerp.tools.config['db_name'])
File "/opt/odoo/custom/src/odoo/openerp/cli/shell.py", line 52, in shell
registry = openerp.modules.registry.RegistryManager.get(dbname)
File "/opt/odoo/custom/src/odoo/openerp/modules/registry.py", line 355, in get
update_module)
File "/opt/odoo/custom/src/odoo/openerp/modules/registry.py", line 386, in new
openerp.modules.load_modules(registry._db, force_demo, status, update_module)
File "/opt/odoo/custom/src/odoo/openerp/modules/loading.py", line 335, in load_modules
force, status, report, loaded_modules, update_module)
File "/opt/odoo/custom/src/odoo/openerp/modules/loading.py", line 239, in load_marked_modules
loaded, processed = load_module_graph(cr, graph, progressdict, report=report, skip_modules=loaded_modules, perform_checks=perform_checks)
File "/opt/odoo/custom/src/odoo/openerp/modules/loading.py", line 136, in load_module_graph
registry.setup_models(cr, partial=True)
File "/opt/odoo/custom/src/odoo/openerp/modules/registry.py", line 186, in setup_models
cr.execute('select model, transient from ir_model where state=%s', ('manual',))
File "/opt/odoo/custom/src/odoo/openerp/sql_db.py", line 154, in wrapper
return f(self, *args, **kwargs)
File "/opt/odoo/custom/src/odoo/openerp/sql_db.py", line 233, in execute
res = self._obj.execute(query, params)
psycopg2.InternalError: current transaction is aborted, commands ignored until end of transaction block
Now you can safely migrate, be that parameter pre-created or not.