new Odoo v8 API is breaking interactive session
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
| OpenERP buildout recipe |
Critical
|
Unassigned |
Bug Description
Hello,
until Odoo master commit d78192c489d3be6
Now on commit cbe2dbb672a6c55
>>> session.
Traceback (most recent call last):
File "<console>", line 1, in <module>
File "/home/
return old_api(self, *args, **kwargs)
File "/home/
return self._browse(
File "/home/
env, envs = None, cls._local.
File "/home/
raise AttributeError(
AttributeError: environments
Hope this helps.
Related branches
Georges Racinet (gracinet) wrote : | #1 |
Changed in anybox.recipe.openerp: | |
importance: | Undecided → Critical |
status: | New → Confirmed |
Georges Racinet (gracinet) wrote : | #2 |
I pushed working code for the current master version in the related branch (comments welcome)
This was done from the stable 1.8 branch, but given that Odoo master is now reporting to be 9.0.0 alpha, we may not need to rush this in stable (I did not check the 8.0 branch of Odoo yet).
Changed in anybox.recipe.openerp: | |
status: | Confirmed → In Progress |
Simon ANDRÉ (sandre) wrote : | #3 |
Hey,
This bug affect me on a another part of the recipe. The upgrade script. I will try to fix it like you say, and maybe make a merge request.
Thanks a lot
logfile
******
2014-07-11 14:49:28,149 INFO Read package version: 0.4.1-dev from /home/sandre/
2014-07-11 14:49:28,149 4822 INFO project_base openerp.upgrade: Read package version: 0.4.1-dev from /home/sandre/
Traceback (most recent call last):
File "bin/upgrade_
sys.
File "/home/
statuscode = getattr(
File "/home/
session.
File "/home/
self.
File "/home/
self.
File "/home/
return old_api(self, *args, **kwargs)
File "/home/
known_mods = self.browse(cr, uid, self.search(cr, uid, []))
File "/home/
return old_api(self, *args, **kwargs)
File "/home/
return self._browse(
File "/home/
env, envs = None, cls._local.
File "/home/
raise AttributeError(
AttributeError: environments
Simon ANDRÉ (sandre) wrote : | #4 |
Hey,
I have found the branch related to new odoo api.
It works much better now!
Thanks
Also just confirming that worked in my console use case too. Thanks.
Georges Racinet (gracinet) wrote : | #6 |
Thanks for the feedback, guys !
Changed in anybox.recipe.openerp: | |
milestone: | none → 1.8.5 |
status: | In Progress → Fix Committed |
Changed in anybox.recipe.openerp: | |
status: | Fix Committed → Fix Released |
The call to the context manager that initializes the environments weakset class-level attr is indeed missing.
From registry.py:
with openerp. api.Environment .manage( ):
registry = Registry(db_name)
That should be an easy fix, although care must be taken (version check, check that "local" stands for "thread local" etc.)