# HG changeset patch # User Axel Prel <axel.prel@xcg-consulting.fr> # Date 1730993610 -3600 # Thu Nov 07 16:33:30 2024 +0100 # Branch 18.0 # Node ID a4274b7055fa21013a89f3cb5bd824745c053220 # Parent 94357b1df882aa7c974812af2c934f89d480bbd6 regenerate doc according to spec diff --git a/doc/autotodo.py b/doc/autotodo.py --- a/doc/autotodo.py +++ b/doc/autotodo.py @@ -2,7 +2,7 @@ ############################################################################## # # OpenERP, Open Source Management Solution -# Copyright (C) 2014, 2018, 2022, 2024 XCG Consulting +# Copyright © 2014, 2018, 2022, 2024 XCG Consulting # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as diff --git a/doc/index.rst b/doc/index.rst --- a/doc/index.rst +++ b/doc/index.rst @@ -1,9 +1,9 @@ .. |coverage| image:: .badges/coverage.svg - :target: https://orus.io/xcg/odoo-modules/xbus_common/-/pipelines?ref=branch/16.0 + :target: https://orus.io/xcg/odoo-modules/xbus_common/-/pipelines?ref=branch/18.0 :alt: Coverage report .. the image is updated by the CI when building the documentation .. |pylint| image:: .badges/pylint.svg - :target: https://orus.io/xcg/odoo-modules/xbus_common/-/pipelines?ref=branch/16.0 + :target: https://orus.io/xcg/odoo-modules/xbus_common/-/pipelines?ref=branch/18.0 :alt: pylint score |coverage| |pylint| @@ -15,6 +15,7 @@ .. toctree:: :maxdepth: 4 + modules NEWS TODO # HG changeset patch # User Vincent Hatakeyama <vincent.hatakeyama@xcg-consulting.fr> # Date 1734343690 -3600 # Mon Dec 16 11:08:10 2024 +0100 # Branch 18.0 # Node ID 48ec25e39dd8df9fae6e34a9689464dadf496142 # Parent a4274b7055fa21013a89f3cb5bd824745c053220 Remove unwanted breaking change diff --git a/NEWS.rst b/NEWS.rst --- a/NEWS.rst +++ b/NEWS.rst @@ -1,10 +1,9 @@ Changelog ========= -18.0.1.1.0 +18.0.1.0.1 ---------- -* Provides a way for other modules to define a message type. * Fix message body encoding and display. 18.0.1.0.0 diff --git a/models/xbus_message.py b/models/xbus_message.py --- a/models/xbus_message.py +++ b/models/xbus_message.py @@ -46,7 +46,7 @@ # is only used to display information uid = fields.Char(string="UID", readonly=True) - type = fields.Selection(selection="_get_type_selection", required=True) + type = fields.Selection([], required=True) header = fields.Binary(attachment=False) @@ -88,12 +88,6 @@ return False return False - def _get_type_selection(self): - """Provides a list of message type selection values. - Should return a list of value-label tuples. - """ - raise NotImplementedError - link_ids = fields.One2many( comodel_name="xbus.message.link", string="Linked Records", diff --git a/tests/models.py b/tests/models.py --- a/tests/models.py +++ b/tests/models.py @@ -17,7 +17,7 @@ # along with this program. If not, see <http://www.gnu.org/licenses/>. # ############################################################################# -from odoo import models # type: ignore[import-untyped] +from odoo import fields, models # type: ignore[import-untyped] class XbusMessage(models.Model): @@ -26,8 +26,10 @@ _inherit = "xbus.message" - def _get_type_selection(self): - return [ + type = fields.Selection( + selection_add=[ ("test_1", "Test Message Type 1"), ("test_2", "Test Message Type 2"), - ] + ], + ondelete={"test_1": "cascade", "test_2": "cascade"}, + )