Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Xbus Common
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Package Registry
Operate
Terraform modules
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
XCG
Odoo modules
Xbus Common
Commits
7ad33dea1d2a
Commit
7ad33dea1d2a
authored
2 months ago
by
Vincent Hatakeyama
Browse files
Options
Downloads
Patches
Plain Diff
Provides a way for other modules to define a message type.
parent
486a0d54fc21
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!13
Provides a way for other modules to define a message type.
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
NEWS.rst
+5
-0
5 additions, 0 deletions
NEWS.rst
__manifest__.py
+1
-1
1 addition, 1 deletion
__manifest__.py
models/xbus_message.py
+9
-1
9 additions, 1 deletion
models/xbus_message.py
tests/models.py
+3
-5
3 additions, 5 deletions
tests/models.py
with
18 additions
and
7 deletions
NEWS.rst
+
5
−
0
View file @
7ad33dea
Changelog
Changelog
=========
=========
18.0.2.0.0
----------
* Provide another way for other modules to define a message type.
18.0.1.0.1
18.0.1.0.1
----------
----------
...
...
This diff is collapsed.
Click to expand it.
__manifest__.py
+
1
−
1
View file @
7ad33dea
...
@@ -22,7 +22,7 @@
...
@@ -22,7 +22,7 @@
"
license
"
:
"
AGPL-3
"
,
"
license
"
:
"
AGPL-3
"
,
"
summary
"
:
"
Xbus common elements
"
,
"
summary
"
:
"
Xbus common elements
"
,
"
icon
"
:
"
/xbus_common/static/description/icon.svg
"
,
"
icon
"
:
"
/xbus_common/static/description/icon.svg
"
,
"
version
"
:
"
18.0.
1
.0.
1
"
,
"
version
"
:
"
18.0.
2
.0.
0
"
,
"
category
"
:
"
Technical
"
,
"
category
"
:
"
Technical
"
,
"
author
"
:
"
XCG Consulting
"
,
"
author
"
:
"
XCG Consulting
"
,
"
website
"
:
"
https://orbeet.io/
"
,
"
website
"
:
"
https://orbeet.io/
"
,
...
...
This diff is collapsed.
Click to expand it.
models/xbus_message.py
+
9
−
1
View file @
7ad33dea
...
@@ -46,7 +46,7 @@
...
@@ -46,7 +46,7 @@
# is only used to display information
# is only used to display information
uid
=
fields
.
Char
(
string
=
"
UID
"
,
readonly
=
True
)
uid
=
fields
.
Char
(
string
=
"
UID
"
,
readonly
=
True
)
type
=
fields
.
Selection
(
[]
,
required
=
True
)
type
=
fields
.
Selection
(
selection
=
"
_get_type_selection
"
,
required
=
True
)
header
=
fields
.
Binary
(
attachment
=
False
)
header
=
fields
.
Binary
(
attachment
=
False
)
...
@@ -88,6 +88,14 @@
...
@@ -88,6 +88,14 @@
return
False
return
False
return
False
return
False
def
_get_type_selection
(
self
)
->
list
[
tuple
[
str
,
str
]]:
"""
Provides a list of message type selection values.
When adding elements, remember to clean up the message table when your
module is uninstalled.
"""
return
[]
link_ids
=
fields
.
One2many
(
link_ids
=
fields
.
One2many
(
comodel_name
=
"
xbus.message.link
"
,
comodel_name
=
"
xbus.message.link
"
,
string
=
"
Linked Records
"
,
string
=
"
Linked Records
"
,
...
...
This diff is collapsed.
Click to expand it.
tests/models.py
+
3
−
5
View file @
7ad33dea
...
@@ -26,7 +26,7 @@
...
@@ -26,7 +26,7 @@
_inherit
=
"
xbus.message
"
_inherit
=
"
xbus.message
"
type
=
fields
.
S
election
(
def
_get_type_s
election
(
self
):
selection_add
=
[
return
[
(
"
test_1
"
,
"
Test Message Type 1
"
),
(
"
test_1
"
,
"
Test Message Type 1
"
),
(
"
test_2
"
,
"
Test Message Type 2
"
),
(
"
test_2
"
,
"
Test Message Type 2
"
),
...
@@ -31,5 +31,3 @@
...
@@ -31,5 +31,3 @@
(
"
test_1
"
,
"
Test Message Type 1
"
),
(
"
test_1
"
,
"
Test Message Type 1
"
),
(
"
test_2
"
,
"
Test Message Type 2
"
),
(
"
test_2
"
,
"
Test Message Type 2
"
),
],
]
ondelete
=
{
"
test_1
"
:
"
cascade
"
,
"
test_2
"
:
"
cascade
"
},
)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment