Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Xbus emitter
Manage
Activity
Members
Labels
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 emitter
Commits
20bfe8ca7438
Commit
20bfe8ca7438
authored
5 years ago
by
oury.balde
Browse files
Options
Downloads
Patches
Plain Diff
[add] new field "chunking" used to split big items
parent
7bb74c12ed31
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
models/xbus_emitter.py
+5
-1
5 additions, 1 deletion
models/xbus_emitter.py
models/xbus_emitter_job.py
+13
-0
13 additions, 0 deletions
models/xbus_emitter_job.py
views/xbus_emitter_job.xml
+3
-0
3 additions, 0 deletions
views/xbus_emitter_job.xml
with
21 additions
and
1 deletion
models/xbus_emitter.py
+
5
−
1
View file @
20bfe8ca
...
...
@@ -45,7 +45,7 @@
)
@api.multi
def
send_items
(
self
,
event_type
,
items
):
def
send_items
(
self
,
event_type
,
items
,
chunking
=
"
legacy
"
):
"""
Send the data to Xbus, inside one event with the specified event
type.
...
...
@@ -54,6 +54,9 @@
:type items: Iterable.
:param chunking: a default chunking to use to split big items.
:type chunking: String. Values (
"
auto
"
,
"
legacy
"
,
"
single
"
).
:return: The new job.
:rtype: Odoo
"
xbus.emitter.job
"
record set.
"""
...
...
@@ -65,6 +68,7 @@
"
emitter_id
"
:
self
.
id
,
"
event_type
"
:
event_type
,
"
items
"
:
json
.
dumps
(
items
),
"
chunking
"
:
chunking
,
}
)
...
...
This diff is collapsed.
Click to expand it.
models/xbus_emitter_job.py
+
13
−
0
View file @
20bfe8ca
...
...
@@ -68,3 +68,16 @@
default
=
"
to_send
"
,
index
=
True
,
)
chunking
=
fields
.
Selection
(
selection
=
[
(
"
legacy
"
,
"
Legacy
"
),
(
"
auto
"
,
"
Auto
"
),
(
"
single
"
,
"
Single
"
),
],
string
=
"
Chunking
"
,
required
=
True
,
help
=
"
Specify how the item can or cannot be chunked.
"
,
track_visibility
=
"
onchange
"
,
default
=
"
legacy
"
,
)
This diff is collapsed.
Click to expand it.
views/xbus_emitter_job.xml
+
3
−
0
View file @
20bfe8ca
...
...
@@ -13,6 +13,7 @@
<field
name=
"event_type"
/>
<field
name=
"state"
/>
<field
name=
"log"
/>
<field
name=
"chunking"
/>
</search>
</field>
...
...
@@ -31,6 +32,7 @@
<field
name=
"create_date"
/>
<field
name=
"write_date"
/>
<field
name=
"state"
/>
<field
name=
"chunking"
/>
<field
name=
"log"
/>
</tree>
...
...
@@ -51,6 +53,7 @@
<field
name=
"create_date"
/>
<field
name=
"write_date"
/>
<field
name=
"state"
/>
<field
name=
"chunking"
/>
<field
name=
"log"
/>
</group>
...
...
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