Skip to content
Open
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion document_page_environment_manual/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

{
"name": "Document Management - Wiki - Environment Manual",
"version": "19.0.1.0.1",
"version": "19.0.1.1.0",
"author": "Savoir-faire Linux,Gray Matter Logic, Odoo Community Association (OCA)",
"website": "https://github.com/OCA/management-system",
"license": "AGPL-3",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
<field name="name">Environment Manual</field>
<field name="type">category</field>
<field name="company_id" eval="False" />
<field name="mgmtsystem_page_type">quality_manual</field>
<field name="template">
<![CDATA[
<h1>Application Domain</h1>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
from openupgradelib import openupgrade


@openupgrade.migrate()
def migrate(env, version):
if (
env["ir.config_parameter"]
.sudo()
.get_param("migration.document_page_mgmtsystem.type")
):
return
env.ref("document_page_environment_manual.document_page_environment_manual").write(
{"mgmtsystem_page_type": "quality_manual"}
)
20 changes: 1 addition & 19 deletions document_page_environmental_aspect/__init__.py
Original file line number Diff line number Diff line change
@@ -1,19 +1 @@
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2010 Savoir-faire Linux (<http://www.savoirfairelinux.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
from . import models
6 changes: 3 additions & 3 deletions document_page_environmental_aspect/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@
##############################################################################
{
"name": "Environmental Aspects",
"version": "19.0.1.0.1",
"version": "19.0.1.1.0",
"author": "Savoir-faire Linux, Gray Matter Logic, Odoo Community Association (OCA)",
"website": "https://github.com/OCA/management-system",
"license": "AGPL-3",
"category": "Management Systems",
"depends": ["document_page", "mgmtsystem"],
"category": "Generic Modules/Others",
"depends": ["document_page_mgmtsystem", "mgmtsystem"],
"data": ["data/document_page.xml", "views/document_page.xml"],
"installable": True,
}
1 change: 1 addition & 0 deletions document_page_environmental_aspect/data/document_page.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
<field name="name">Environmental Aspect</field>
<field name="type">category</field>
<field name="company_id" eval="False" />
<field name="mgmtsystem_page_type">environmental_aspect</field>
<field name="template">
<![CDATA[
<h1>Activity</h1>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
from openupgradelib import openupgrade


@openupgrade.migrate()
def migrate(env, version):
if (
env["ir.config_parameter"]
.sudo()
.get_param("migration.document_page_mgmtsystem.type")
):
return
env.ref(
"document_page_environmental_aspect.document_page_environmental_aspect"
).write({"mgmtsystem_page_type": "environmental_aspect"})
1 change: 1 addition & 0 deletions document_page_environmental_aspect/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import document_page
12 changes: 12 additions & 0 deletions document_page_environmental_aspect/models/document_page.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Copyright 2025 Dixmit
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

from odoo import fields, models


class DocumentPage(models.Model):
_inherit = "document.page"

mgmtsystem_page_type = fields.Selection(
selection_add=[("environmental_aspect", "Environmental Aspect")],
)
2 changes: 1 addition & 1 deletion document_page_environmental_aspect/views/document_page.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<field name="help">Environmental aspects of your management system.</field>
<field
name="domain"
eval="[('parent_id','=',ref('document_page_group_environmental_aspect'))]"
eval="[('mgmtsystem_page_type','=','environmental_aspect'), ('type', '=', 'content')]"
/>
<field
name="context"
Expand Down
1 change: 1 addition & 0 deletions document_page_health_safety_manual/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
# Copyright (C) 2010 Savoir-faire Linux (<http://www.savoirfairelinux.com>).
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from . import models
2 changes: 1 addition & 1 deletion document_page_health_safety_manual/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

{
"name": "Document Management - Wiki - Health and Safety Manual",
"version": "19.0.1.0.1",
"version": "19.0.1.1.0",
"author": "Savoir-faire Linux,Gray Matter Logic, Odoo Community Association (OCA)",
"website": "https://github.com/OCA/management-system",
"license": "AGPL-3",
Expand Down
1 change: 1 addition & 0 deletions document_page_health_safety_manual/data/document_page.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
<field name="name">Health and Safety Manual</field>
<field name="type">category</field>
<field name="company_id" eval="False" />
<field name="mgmtsystem_page_type">health_safety_manual</field>
<field name="template">
TODO: Add the structure of the health and safety manual from the OHSAS 18001 standard.
</field>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
from openupgradelib import openupgrade


@openupgrade.migrate()
def migrate(env, version):
if (
env["ir.config_parameter"]
.sudo()
.get_param("migration.document_page_mgmtsystem.type")
):
return
env.ref(
"document_page_health_safety_manual.document_page_health_safety_manual"
).write({"mgmtsystem_page_type": "health_safety_manual"})
1 change: 1 addition & 0 deletions document_page_health_safety_manual/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import document_page
12 changes: 12 additions & 0 deletions document_page_health_safety_manual/models/document_page.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Copyright 2025 Dixmit
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

from odoo import fields, models


class DocumentPage(models.Model):
_inherit = "document.page"

mgmtsystem_page_type = fields.Selection(
selection_add=[("health_safety_manual", "Health Safety Manual")],
)
82 changes: 82 additions & 0 deletions document_page_mgmtsystem/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
.. image:: https://odoo-community.org/readme-banner-image
:target: https://odoo-community.org/get-involved?utm_source=readme
:alt: Odoo Community Association

========================
Document Page Mgmtsystem
========================

..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:571afabdc7bc6fb587d6cc786a67775e6fd1556fa77347f5a8af40795864505d
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
:target: https://odoo-community.org/page/development-status
:alt: Beta
.. |badge2| image:: https://img.shields.io/badge/license-AGPL--3-blue.png
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fmanagement--system-lightgray.png?logo=github
:target: https://github.com/OCA/management-system/tree/19.0/document_page_mgmtsystem
:alt: OCA/management-system
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/management-system-19-0/management-system-19-0-document_page_mgmtsystem
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
:target: https://runboat.odoo-community.org/builds?repo=OCA/management-system&target_branch=19.0
:alt: Try me on Runboat

|badge1| |badge2| |badge3| |badge4| |badge5|

Adds a new field in categories to be used later on.

**Table of contents**

.. contents::
:local:

Bug Tracker
===========

Bugs are tracked on `GitHub Issues <https://github.com/OCA/management-system/issues>`_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us to smash it by providing a detailed and welcomed
`feedback <https://github.com/OCA/management-system/issues/new?body=module:%20document_page_mgmtsystem%0Aversion:%2019.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.

Do not contact contributors directly about support or help with technical issues.

Credits
=======

Authors
-------

* Dixmit

Contributors
------------

- `Dixmit <https://www.dixmit.com>`__

- Enric Tobella

Maintainers
-----------

This module is maintained by the OCA.

.. image:: https://odoo-community.org/logo.png
:alt: Odoo Community Association
:target: https://odoo-community.org

OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.

This module is part of the `OCA/management-system <https://github.com/OCA/management-system/tree/19.0/document_page_mgmtsystem>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
1 change: 1 addition & 0 deletions document_page_mgmtsystem/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import models
18 changes: 18 additions & 0 deletions document_page_mgmtsystem/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Copyright 2025 Dixmit
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

{
"name": "Document Page Mgmtsystem",
"summary": """Add a new mgmtsystem type field for classification""",
"version": "19.0.1.0.0",
"license": "AGPL-3",
"author": "Dixmit,Odoo Community Association (OCA)",
"website": "https://github.com/OCA/management-system",
"depends": [
"document_page",
],
"data": [
"views/document_page.xml",
],
"demo": [],
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
from openupgradelib import openupgrade


@openupgrade.migrate()
def migrate(env, version):
env["ir.config_parameter"].sudo().set_param(
"migration.document_page_mgmtsystem.type", False
)
15 changes: 15 additions & 0 deletions document_page_mgmtsystem/migrations/19.0.1.0.0/pre-migration.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
from openupgradelib import openupgrade


@openupgrade.migrate()
def migrate(env, version):
"""
This is a small trick. We set the parameter to False in the end-migration.py file,
and then we set it to True here.
This way, we can check in all dependent modules if the module existed or not.
We will remove the parameter in the end-migration.py file of this module,
so that it is not set to True for future migrations.
"""
env["ir.config_parameter"].sudo().set_param(
"migration.document_page_mgmtsystem.type", "1"
)
1 change: 1 addition & 0 deletions document_page_mgmtsystem/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import document_page
26 changes: 26 additions & 0 deletions document_page_mgmtsystem/models/document_page.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Copyright 2025 Dixmit
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

from odoo import api, fields, models


class DocumentPage(models.Model):
_inherit = "document.page"

mgmtsystem_page_type = fields.Selection(
selection=[],
string="Management System Page Type",
help="Classification of the management system document page.",
compute="_compute_mgmtsystem_page_type",
store=True,
recursive=True,
readonly=False,
)

@api.depends("parent_id.mgmtsystem_page_type", "parent_id")
def _compute_mgmtsystem_page_type(self):
for record in self:
mgmtsystem_page_type = record.parent_id.mgmtsystem_page_type
if record.type == "category" and not mgmtsystem_page_type:
mgmtsystem_page_type = record.mgmtsystem_page_type
record.mgmtsystem_page_type = mgmtsystem_page_type
3 changes: 3 additions & 0 deletions document_page_mgmtsystem/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[build-system]
requires = ["whool"]
build-backend = "whool.buildapi"
2 changes: 2 additions & 0 deletions document_page_mgmtsystem/readme/CONTRIBUTORS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
- [Dixmit](https://www.dixmit.com)
- Enric Tobella
1 change: 1 addition & 0 deletions document_page_mgmtsystem/readme/DESCRIPTION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Adds a new field in categories to be used later on.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading