Skip to content

Commit

Permalink
Merge pull request #477 from itpp-labs/16.0-sync-debug
Browse files Browse the repository at this point in the history
  • Loading branch information
itpp-bot authored May 19, 2024
2 parents 45daa55 + cd03c24 commit da6f707
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 3 deletions.
2 changes: 1 addition & 1 deletion sync/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"name": "Sync 🪬 Studio",
"summary": """Join the Amazing 😍 Community ⤵️""",
"category": "VooDoo ✨ Magic",
"version": "16.0.11.0.0",
"version": "16.0.11.0.1",
"application": True,
"author": "Ivan Kropotkin",
"support": "[email protected]",
Expand Down
6 changes: 6 additions & 0 deletions sync/doc/changelog.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
`11.0.1`
-------

- **Improvement:** add `PARAMS.*` to the core eval context
- **Improvement:** clarify error message when model is not found

`11.0.0`
-------

Expand Down
12 changes: 10 additions & 2 deletions sync/models/sync_project.py
Original file line number Diff line number Diff line change
Expand Up @@ -327,15 +327,16 @@ def record2image(record, fname="image_1920"):
DATA[d.name] = d

core_eval_context = {
"MAGIC": MAGIC,
"SECRETS": SECRETS,
"MAGIC": MAGIC,
"PARAMS": PARAMS,
}
CORE = eval_export(safe_eval__MAGIC, self.core_code, core_eval_context)

lib_eval_context = {
"MAGIC": MAGIC,
"CORE": CORE,
"PARAMS": PARAMS,
"CORE": CORE,
"WEBHOOKS": WEBHOOKS,
"DATA": DATA,
}
Expand Down Expand Up @@ -596,6 +597,13 @@ def create_trigger(model, data):

for data in meta.get("DB_TRIGGERS", []):
model_id = self.env["ir.model"]._get(data["model"]).id
if not model_id:
raise ValidationError(
_(
"Model %s is not available. Check if you need to install an extra module first."
)
% data["model"]
)
create_trigger(
"sync.trigger.automation", dict(data, model_id=model_id, model=None)
)
Expand Down

0 comments on commit da6f707

Please sign in to comment.