diff --git a/NEWS.rst b/NEWS.rst index 94357b1df882aa7c974812af2c934f89d480bbd6_TkVXUy5yc3Q=..48ec25e39dd8df9fae6e34a9689464dadf496142_TkVXUy5yc3Q= 100644 --- a/NEWS.rst +++ b/NEWS.rst @@ -1,6 +1,6 @@ Changelog ========= -18.0.1.1.0 +18.0.1.0.1 ---------- @@ -5,6 +5,5 @@ ---------- -* 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/doc/autotodo.py b/doc/autotodo.py index 94357b1df882aa7c974812af2c934f89d480bbd6_ZG9jL2F1dG90b2RvLnB5..48ec25e39dd8df9fae6e34a9689464dadf496142_ZG9jL2F1dG90b2RvLnB5 100755 --- 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 index 94357b1df882aa7c974812af2c934f89d480bbd6_ZG9jL2luZGV4LnJzdA==..48ec25e39dd8df9fae6e34a9689464dadf496142_ZG9jL2luZGV4LnJzdA== 100644 --- a/doc/index.rst +++ b/doc/index.rst @@ -1,5 +1,5 @@ .. |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 @@ -3,7 +3,7 @@ :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 diff --git a/models/xbus_message.py b/models/xbus_message.py index 94357b1df882aa7c974812af2c934f89d480bbd6_bW9kZWxzL3hidXNfbWVzc2FnZS5weQ==..48ec25e39dd8df9fae6e34a9689464dadf496142_bW9kZWxzL3hidXNfbWVzc2FnZS5weQ== 100644 --- 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 index 94357b1df882aa7c974812af2c934f89d480bbd6_dGVzdHMvbW9kZWxzLnB5..48ec25e39dd8df9fae6e34a9689464dadf496142_dGVzdHMvbW9kZWxzLnB5 100644 --- 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,7 +26,7 @@ _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"), @@ -31,3 +31,5 @@ ("test_1", "Test Message Type 1"), ("test_2", "Test Message Type 2"), - ] + ], + ondelete={"test_1": "cascade", "test_2": "cascade"}, + )