add documentation
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
from odoo import http
|
||||
from odoo.addons.base import controllers
|
||||
from odoo.tools import config
|
||||
from werkzeug.exceptions import NotFound
|
||||
from odoo.http import request
|
||||
import os
|
||||
class Documentation(http.Controller):
|
||||
|
||||
@http.route('/documentation', auth='public', cache=3600)
|
||||
def serve_static_html(self):
|
||||
# Get absolute path to your HTML file
|
||||
module = '/root/dev/NextERP/dev/odoo18/Odoo18/exercise/documentation'
|
||||
resource_path = 'static/html/18.0/index.html'
|
||||
file_path = os.path.join(module, resource_path)
|
||||
|
||||
with open(file_path, 'r') as f:
|
||||
content = f.read()
|
||||
|
||||
return request.make_response(content, [
|
||||
('Content-Type', 'text/html'),
|
||||
])
|
||||
Reference in New Issue
Block a user