I'm working on a migration of a module that was developed for Odoo 11 and I want to use in Odoo 15, I try to use the plugin odoo-module-migrator, which I can install but, when I access the website section that is included in this module I receive the following error:
Traceback (most recent call last): File "/usr/lib/python3/dist-packages/odoo/addons/base/models/ir_http.py", line 237, in _dispatch result = request.dispatch() File "/usr/lib/python3/dist-packages/odoo/http.py", line 810, in dispatch r = self._call_function(**self.params) File "/usr/lib/python3/dist-packages/odoo/http.py", line 359, in _call_function return checked_call(self.db, *args, **kwargs) File "/usr/lib/python3/dist-packages/odoo/service/model.py", line 94, in wrapper return f(dbname, *args, **kwargs) File "/usr/lib/python3/dist-packages/odoo/http.py", line 348, in checked_call result = self.endpoint(*a, **kw) File "/usr/lib/python3/dist-packages/odoo/http.py", line 916, in __call__ return self.method(*args, **kw) File "/usr/lib/python3/dist-packages/odoo/http.py", line 535, in response_wrap response = f(*args, **kw) File "/mnt/extra-addons/website_business_directory/controllers/main.py", line 26, in directory_search page_directory_search = request.env['ir.model.data'].get_object('website_business_directory', 'page_directory_search') Exception The above exception was the direct cause of the following exception: Traceback (most recent call last): File "/usr/lib/python3/dist-packages/odoo/addons/base/models/ir_http.py", line 237, in _dispatch result = request.dispatch() File "/usr/lib/python3/dist-packages/odoo/http.py", line 810, in dispatch r = self._call_function(**self.params) File "/usr/lib/python3/dist-packages/odoo/http.py", line 359, in _call_function return checked_call(self.db, *args, **kwargs) File "/usr/lib/python3/dist-packages/odoo/service/model.py", line 94, in wrapper return f(dbname, *args, **kwargs) File "/usr/lib/python3/dist-packages/odoo/http.py", line 348, in checked_call result = self.endpoint(*a, **kw) File "/usr/lib/python3/dist-packages/odoo/http.py", line 916, in __call__ return self.method(*args, **kw) File "/usr/lib/python3/dist-packages/odoo/http.py", line 535, in response_wrap response = f(*args, **kw) File "/mnt/extra-addons/website_business_directory/controllers/main.py", line 26, in directory_search page_directory_search = request.env['ir.model.data'].get_object('website_business_directory', 'page_directory_search') AttributeError: 'ir.model.data' object has no attribute 'get_object'
and this is the code that builds this website section:
@http.route('/directory', type="http", auth="public", website=True)
def directory_search(self, **kwargs):
featured_listings = request.env['res.partner'].sudo().search([('in_directory','=', True), ('featured_listing','=',True) ])
regular_listings = request.env['res.partner'].sudo().search([('in_directory','=', True), ('featured_listing','=',False) ])
google_maps_api_key = request.env['ir.config_parameter'].sudo().get_param('google_maps_api_key')
directory_categories = request.env['res.partner.directory.category'].sudo().search([('parent_category','=',False)])
page_directory_search = request.env['ir.model.data'].get_object('website_business_directory', 'page_directory_search')
return http.request.render(page_directory_search.view_id.id, {'featured_listings': featured_listings, 'regular_listings': regular_listings, 'google_maps_api_key': google_maps_api_key, 'directory_categories': directory_categories} )