diff --git a/sync/__manifest__.py b/sync/__manifest__.py index bf40e8c9..e3a5d6ba 100644 --- a/sync/__manifest__.py +++ b/sync/__manifest__.py @@ -7,7 +7,7 @@ "name": "Sync ๐Ÿชฌ Studio", "summary": """Join the Amazing ๐Ÿ˜ Community โคต๏ธ""", "category": "VooDoo โœจ Magic", - "version": "16.0.11.0.1", + "version": "16.0.13.0.0", "application": True, "author": "Ivan Kropotkin", "support": "info@odoomagic.com", diff --git a/sync/doc/changelog.rst b/sync/doc/changelog.rst index 38053cc1..aec84b5b 100644 --- a/sync/doc/changelog.rst +++ b/sync/doc/changelog.rst @@ -1,3 +1,10 @@ +`13.0.0` +------- + +- **Fix:** use `__sync.` for xmlid namespace to avoid data lose on module update +- **New:** add *Sync Order* โ€” advanced manual trigger with blackjack, partners list, text input, etc. +- **New:** support `data.markdown` for custom documentation at the `DATA.๐Ÿซ` tab + `11.0.1` ------- diff --git a/sync/models/base.py b/sync/models/base.py index 788ebc37..27529f14 100644 --- a/sync/models/base.py +++ b/sync/models/base.py @@ -19,7 +19,7 @@ def search_links(self, relation_name, refs=None): ._search_links_odoo(self, relation_name, refs) ) - def _create_or_update_by_xmlid(self, vals, code, namespace="XXX", module="sync"): + def _create_or_update_by_xmlid(self, vals, code, namespace="XXX", module="__sync"): """ Create or update a record by a dynamically generated XML ID. Warning! The field `noupdate` is ignored, i.e. existing records are always updated. diff --git a/sync/models/sync_project.py b/sync/models/sync_project.py index 46b9e7e2..c5b3bb7d 100644 --- a/sync/models/sync_project.py +++ b/sync/models/sync_project.py @@ -110,6 +110,7 @@ class SyncProject(models.Model): link_ids = fields.One2many("sync.link", "project_id") link_count = fields.Integer(compute="_compute_link_count") data_ids = fields.One2many("sync.data", "project_id") + data_description = fields.Html(readonly=True) def copy(self, default=None): default = dict(default or {}) @@ -508,11 +509,15 @@ def magic_upgrade(self): vals[field_name] = gist_files[file_name] # [DATA] + file_content = gist_files.get("data.markdown") + if file_content: + vals["data_description"] = compile_markdown_to_html(file_content) + http = urllib3.PoolManager() for file_info in gist_content["files"].values(): # e.g. "data.emoji.csv" file_name = file_info["filename"] - if not file_name.startswith("data."): + if not (file_name.startswith("data.") and file_name != "data.markdown"): continue raw_url = file_info["raw_url"] response = http.request("GET", raw_url) diff --git a/sync/models/sync_trigger_mixin.py b/sync/models/sync_trigger_mixin.py index 0a675bd9..0422bd12 100644 --- a/sync/models/sync_trigger_mixin.py +++ b/sync/models/sync_trigger_mixin.py @@ -39,10 +39,11 @@ def write(self, vals): self._update_name(vals) return res - @api.model - def create(self, vals): - res = super().create(vals) - res._update_name(vals) + @api.model_create_multi + def create(self, vals_list): + for vals in vals_list: + res = super().create(vals) + res._update_name(vals) return res def default_get(self, fields): diff --git a/sync/views/sync_project_views.xml b/sync/views/sync_project_views.xml index 6a04c9f7..674cb482 100644 --- a/sync/views/sync_project_views.xml +++ b/sync/views/sync_project_views.xml @@ -254,13 +254,6 @@ - - - - - - -

Hint: @@ -272,6 +265,16 @@

+ + + + + + + +
+ +