diff --git a/app_store/models/appstore_account.py b/app_store/models/appstore_account.py index da125d6fe..d4e224000 100644 --- a/app_store/models/appstore_account.py +++ b/app_store/models/appstore_account.py @@ -20,6 +20,7 @@ import json from odoo import api, fields, models +from odoo.tools import plaintext2html class AppstoreAccount(models.Model): @@ -147,16 +148,16 @@ def analyse_module(self, module_name, app_directory): try: #Read /doc/changelog.rst file if os.path.exists(app_directory + "/" + module_name + "/doc/changelog.rst"): - with open(app_directory + "/" + module_name + "/doc/changelog.rst", 'r') as changelogfile: - changelogdata = changelogfile.read() + with open(app_directory + "/" + module_name + "/doc/changelog.rst", 'rb') as changelogfile: + changelogdata = changelogfile.read().decode("UTF-8") module_overview.change_log_raw = changelogdata - module_overview.change_log_html = changelogdata + module_overview.change_log_html = plaintext2html(changelogdata) #module_overview.change_log_html = publish_string(changelogdata, writer_name='html').split("\n",2)[2] #Read /static/description/index.html file if os.path.exists(app_directory + "/" + module_name + "/static/description/index.html"): - with open(app_directory + "/" + module_name + "/static/description/index.html", 'r') as descriptionfile: - descriptiondata = descriptionfile.read() + with open(app_directory + "/" + module_name + "/static/description/index.html", 'rb') as descriptionfile: + descriptiondata = descriptionfile.read().decode("UTF-8") module_overview.store_description = descriptiondata if 'depends' in op_settings: @@ -308,4 +309,4 @@ def _read_xml(self, file_path, m_id): model = model_exist[0] #add this view to this model - self.env['module.overview.model.view'].create({'model_id': model.id, 'name': record_name, 'x_id': record_id}) \ No newline at end of file + self.env['module.overview.model.view'].create({'model_id': model.id, 'name': record_name, 'x_id': record_id})