Skip to content
This repository has been archived by the owner on Dec 17, 2019. It is now read-only.

Fix change log html #100

Open
wants to merge 1 commit into
base: 11.0
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions app_store/models/appstore_account.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import json

from odoo import api, fields, models
from odoo.tools import plaintext2html

class AppstoreAccount(models.Model):

Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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})
self.env['module.overview.model.view'].create({'model_id': model.id, 'name': record_name, 'x_id': record_id})