İçereği Atla
Menü
Bu soru işaretlendi
1 Cevapla
5389 Görünümler

Hello,

I'm installing a module that was made for Odoo 14.0 Enterprise inside of Odoo 15.0 Enterprise. It works in 14.0 but it completely crashes Odoo in 15.0. I'm hoping to get someone to give me an idea of where to look since the traceback is pretty generic.


It might have something to do with my assets. I moved assets from assets.xml (inherit=web.assets_backend) to the manifest.py 



'assets': {
'web.assets_backend': [
'excederin/static/**/**/*',
],
},
'uninstall_hook': 'uninstall_hook',

}


2021-12-14 22:34:58,155 2201752 ERROR test werkzeug: Error on request:
Traceback (most recent call last):
File "/home/iHaveAmigraine/odoo/.venv/lib/python3.9/site-packages/werkzeug/serving.py", line 306, in run_wsgi
execute(self.server.app)
File "/home/iHaveAmigraine/odoo/.venv/lib/python3.9/site-packages/werkzeug/serving.py", line 294, in execute
application_iter = app(environ, start_response)
File "/home/iHaveAmigraine/odoo/odoo/service/wsgi_server.py", line 112, in application
return application_unproxied(environ, start_response)
File "/home/iHaveAmigraine/odoo/odoo/service/wsgi_server.py", line 87, in application_unproxied
result = odoo.http.root(environ, start_response)
File "/home/iHaveAmigraine/odoo/odoo/http.py", line 1313, in __call__
return self.dispatch(environ, start_response)
File "/home/iHaveAmigraine/odoo/odoo/http.py", line 1279, in __call__
return self.app(environ, start_wrapped)
File "/home/iHaveAmigraine/odoo/.venv/lib/python3.9/site-packages/werkzeug/middleware/shared_data.py", line 220, in __call__
return self.app(environ, start_response)
File "/home/iHaveAmigraine/odoo/odoo/http.py", line 1489, in dispatch
result = ir_http._dispatch()
File "/home/iHaveAmigraine/odoo/addons/auth_signup/models/ir_http.py", line 19, in _dispatch
return super(Http, cls)._dispatch()
File "/home/iHaveAmigraine/odoo/addons/web_editor/models/ir_http.py", line 21, in _dispatch
return super(IrHttp, cls)._dispatch()
File "/home/iHaveAmigraine/odoo/addons/utm/models/ir_http.py", line 29, in _dispatch
response = super(IrHttp, cls)._dispatch()
File "/home/iHaveAmigraine/odoo/addons/http_routing/models/ir_http.py", line 431, in _dispatch
rule, arguments = cls._match(request.httprequest.path)
File "/home/iHaveAmigraine/odoo/odoo/addons/base/models/ir_http.py", line 90, in _match
return cls.routing_map().bind_to_environ(request.httprequest.environ).match(path_info=path_info, return_rule=True)
File "/home/iHaveAmigraine/odoo/odoo/addons/base/models/ir_http.py", line 279, in routing_map
for url, endpoint, routing in cls._generate_routing_rules(mods, converters=cls._get_converters()):
File "/home/iHaveAmigraine/odoo/odoo/http.py", line 943, in _generate_routing_rules
members = inspect.getmembers(o, inspect.ismethod)
File "/usr/lib/python3.9/inspect.py", line 351, in getmembers
value = getattr(object, key)
File "/home/iHaveAmigraine/odoo/addons/web/controllers/main.py", line 1771, in extension
raise NotImplementedError()
NotImplementedError - - -
Avatar
Vazgeç
En İyi Yanıt

Hello,

The problem for this is not the assets as we see the error clearly, it indicates that we need to implement a method from the class which is defined in the odoo/addons/web/controllers/main.py

class ExportFormat(object):

Solution : Implement the methods in your custom controller file 

@property
def content_type(self):
@property
def extension(self):






Avatar
Vazgeç
Üretici

Thank you for your response. This is correct if anyone sees this in the future. I am partially blind 50% of the time and missed that in the error. Thank you again.

could you upvote it, it will help others

@BilllNye how did you implemented extension function? Can you please put me in the direction?

@Yagami
Example

class ExcelExport(http.Controller):

# Excel needs raw data to correctly handle numbers and date values
raw_data = True

@http.route('/export/chart_xls', type='http', auth="user")
@serialize_exception
def index(self, data, token):
return self.base(data, token)

@property
def content_type(self):
return 'application/vnd.ms-excel'

def filename(self, base):
return base + '.xls'

İlgili Gönderiler Cevaplar Görünümler Aktivite
2
Eyl 24
5188
0
Şub 24
2345
1
Kas 23
2678
0
Eyl 23
2154
1
Haz 23
3867