Skip to content

Commit 7d44743

Browse files
committed
[IMP] vcp_*: fetch html description
1 parent 0f40497 commit 7d44743

3 files changed

Lines changed: 17 additions & 2 deletions

File tree

vcp_odoo/models/vcp_odoo_module_version.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ class VcpOdooModuleVersion(models.Model):
4545
string="Python Binaries",
4646
readonly=True,
4747
)
48+
description = fields.Html(readonly=True)
4849

4950
def _get_local_path(self):
5051
return f"{self.repository_branch_id.local_path}/{self.path}"

vcp_odoo/models/vcp_rule.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import copy
66
import logging
77
import os
8+
from pathlib import Path
89

910
from odoo import fields, models
1011
from odoo.fields import Command
@@ -75,6 +76,11 @@ def _get_odoo_icon_path(self):
7576
"static/description/icon.png",
7677
]
7778

79+
def _get_html_description_path(self):
80+
return [
81+
"static/description/index.html",
82+
]
83+
7884
def _process_rule_odoo_module_prepare_vals(
7985
self, repository_branch, module_id, manifest_path
8086
):
@@ -100,6 +106,12 @@ def _process_rule_odoo_module_prepare_vals(
100106
package_bins.append(
101107
self.env["vcp.odoo.bin.package"]._get_bin_package(package_bin)
102108
)
109+
description = False
110+
for html_description_path in self._get_html_description_path():
111+
path = Path(os.path.dirname(manifest_path)) / html_description_path
112+
if path.exists():
113+
description = path.read_text()
114+
break
103115
return {
104116
"name": manifest.get("name"),
105117
"module_id": module_id,
@@ -118,4 +130,5 @@ def _process_rule_odoo_module_prepare_vals(
118130
"image_1920": icon,
119131
"python_library_ids": [Command.set(python_libs)],
120132
"bin_package_ids": [Command.set(package_bins)],
133+
"description": description,
121134
}

vcp_odoo/views/vcp_odoo_module_version.xml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,13 @@
2626
<field name="auto_install" />
2727
<field name="license" />
2828
<field name="website" />
29+
<field name="summary" />
2930
<field name="python_library_ids" widget="many2many_tags" />
3031
<field name="bin_package_ids" widget="many2many_tags" />
3132
</group>
3233
<notebook>
33-
<page name="summary" string="Summary">
34-
<field name="summary" />
34+
<page name="description" string="Description">
35+
<field name="description" widget="html" />
3536
</page>
3637
<page string="Information" name="information">
3738
<field name="rule_information_ids" />

0 commit comments

Comments
 (0)