Skip to content

Commit 58b0320

Browse files
committed
[18.0] [ADD] signage
1 parent 0881d75 commit 58b0320

File tree

13 files changed

+257
-0
lines changed

13 files changed

+257
-0
lines changed

signage/__init__.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
2+
3+
from . import models

signage/__manifest__.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Copyright (C) 2025 Dimitrios Tanis (<dtanis@tanisfood.gr>).
2+
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
3+
{
4+
"name": "Signage",
5+
"summary": "Base module to create signs",
6+
"version": "18.0.1.0.0",
7+
"category": "Knowledge Management",
8+
"website": "https://github.com/OCA/knowledge",
9+
"author": "Dimitrios Tanis, Odoo Community Association (OCA)",
10+
"license": "AGPL-3",
11+
"depends": [
12+
"document_page",
13+
],
14+
"data": [
15+
"security/ir.model.access.csv",
16+
"views/signage_view.xml",
17+
"views/signage_category_view.xml",
18+
],
19+
}

signage/models/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
from . import signage
2+
from . import signage_category

signage/models/signage.py

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# Copyright (C) 2025 Dimitrios Tanis (<dtanis@tanisfood.gr>).
2+
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
3+
from odoo import api, fields, models
4+
from odoo.tools.mail import html2plaintext
5+
6+
7+
class Signage(models.Model):
8+
_name = "signage"
9+
_description = "Warning, obligation and information signs"
10+
11+
@api.depends("name")
12+
def _compute_display_name(self):
13+
for record in self:
14+
record.display_name = html2plaintext(record.name)
15+
16+
name = fields.Html(
17+
sanitize_style=True,
18+
required=True,
19+
)
20+
description = fields.Text()
21+
image = fields.Binary(
22+
attachment=True, help="This field holds the image used for the signage."
23+
)
24+
category_id = fields.Many2one(
25+
"signage.category",
26+
group_expand="_read_group_stage_ids",
27+
)
28+
29+
@api.model
30+
def _read_group_stage_ids(self, stages, domain):
31+
"""Show always the stages not folded."""
32+
search_domain = [
33+
("fold", "=", False),
34+
]
35+
return stages.search(search_domain)

signage/models/signage_category.py

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# Copyright (C) 2025 Dimitrios Tanis (<dtanis@tanisfood.gr>).
2+
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
3+
from odoo import fields, models
4+
5+
6+
class SignageCategory(models.Model):
7+
_name = "signage.category"
8+
_description = "Category for signs"
9+
10+
name = fields.Char(
11+
"Category Name",
12+
required=True,
13+
)
14+
description = fields.Text()
15+
signage_ids = fields.One2many(
16+
comodel_name="signage",
17+
inverse_name="category_id",
18+
string="Signage",
19+
)
20+
sequence = fields.Integer(default=1)
21+
fold = fields.Boolean(
22+
string="Folded in Kanban",
23+
help="This stage is folded in the kanban view "
24+
"when there are no records in that stage "
25+
"to display.",
26+
)
27+
font_color_hex = fields.Char(
28+
"Font Color Code",
29+
default=False,
30+
help="Color code in Hex, # (pound sign) included",
31+
)
32+
background_color_hex = fields.Char(
33+
"Background Color Code",
34+
default=False,
35+
help="Color code in Hex used for background, # (pound sign) included",
36+
)

signage/pyproject.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[build-system]
2+
requires = ["whool"]
3+
build-backend = "whool.buildapi"

signage/readme/CONTRIBUTORS.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
- Dimitrios Tanis \<dtanis@tanisfood.gr\>

signage/readme/DESCRIPTION.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
This module allows to handle signage and create type of signs
2+
e.g. ISO 3864, ISO 7001, GHS and connect.
3+
It is a base module providing only the signare part.
4+
Other glue modules will allow to link signs to mrp.production,
5+
mrp.workcenter, stock.location, etc.

signage/readme/USAGE.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
To create a sign you can upload a sign image and add
2+
the explanation text in the html field, or add all the
3+
sign components in the html field itself.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
2+
signage_read,Permission to read signage,model_signage,base.group_user,1,0,0,0
3+
signage_manager,Permission to modify signage,model_signage,document_page.group_document_editor,1,1,1,1
4+
signage_category_read,Permission to read signage_category,model_signage_category,base.group_user,1,0,0,0
5+
signage_category_manager,Permission to modify signage_category,model_signage_category,document_page.group_document_editor,1,1,1,1

0 commit comments

Comments
 (0)