Skip to Content
Menu
This question has been flagged
1 Reply
2779 Views

I need to port the code from odoo version 8 to version 10. 

Odoo 8 code, 


import pooler

class migrator():

     def getPoolObj(self, cr):

return pooler.get_pool(cr.dbname)

I need to replace the pooler in odoo 10.


In Odoo 10, i tried this, 

from odoo import pooler

class migrator():

     def getPoolObj(self, cr):

return pooler.get_pool(cr.dbname)

I got the import error. The error is ImportError: cannot import name pooler.

Avatar
Discard
Author Best Answer

I got it.

There is no pooler in Odoo 10. 

If we want to get the cursor database, use self.env.cr.dbname. 

self.env['model'] is replaced to get self.pool.get('model')

Avatar
Discard