Skip to content
Snippets Groups Projects
Commit 20bfe8ca7438 authored by oury.balde's avatar oury.balde
Browse files

[add] new field "chunking" used to split big items

parent 7bb74c12ed31
No related branches found
No related tags found
No related merge requests found
......@@ -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,
}
)
......
......@@ -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",
)
......@@ -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>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment