Skip to content
Snippets Groups Projects
Commit 9d0699193efd authored by szeka.wong's avatar szeka.wong
Browse files

Evolve: Allow to skip update process.

parent 2cce78dc03d0
No related branches found
No related tags found
1 merge request!54skip-update-process
Changelog
=========
18.0.2.0.2
----------
Evolve: Allow to skip update process.
18.0.2.0.1
----------
......
......@@ -21,7 +21,7 @@
"name": "Converter",
"license": "AGPL-3",
"summary": "Convert odoo records to/from plain data structures.",
"version": "18.0.2.0.1",
"version": "18.0.2.0.2",
"category": "Hidden",
"author": "XCG Consulting",
"website": "https://orbeet.io/",
......
......@@ -111,7 +111,7 @@
message_value: Any,
instance: models.BaseModel,
value_present: bool = True,
) -> dict:
) -> dict | SkipType:
"""From a message, returns a dict.
Only field whose values are changed are included in the returned dict.
:param odoo_env: odoo environment
......@@ -252,6 +252,9 @@
changes = converter.message_to_odoo(
odoo_env, PHASE_PRECREATE, payload, instance
)
if isinstance(changes, SkipType):
return odoo_env[model_name]
instance = odoo_env[model_name].create(changes)
changes = converter.message_to_odoo(
odoo_env, PHASE_POSTCREATE, payload, instance
......@@ -262,6 +265,9 @@
operation is None and not instance or instance is Newinstance
):
changes = converter.message_to_odoo(odoo_env, PHASE_UPDATE, payload, instance)
if isinstance(changes, SkipType):
return odoo_env[model_name]
if changes:
instance.write(changes)
if hasattr(converter, "post_hook"):
......
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