diff --git a/sync/doc/changelog.rst b/sync/doc/changelog.rst index df5ebd01..1515164c 100644 --- a/sync/doc/changelog.rst +++ b/sync/doc/changelog.rst @@ -1,3 +1,8 @@ +`7.0.0` +------- + +- **New:** Dramatic improvement on Sync Studio API + `6.2.0` ------- diff --git a/sync/models/sync_project.py b/sync/models/sync_project.py index 53259375..57e76104 100644 --- a/sync/models/sync_project.py +++ b/sync/models/sync_project.py @@ -10,7 +10,7 @@ from pytz import timezone from odoo import api, fields, models -from odoo.exceptions import UserError, ValidationError +from odoo.exceptions import AccessError, UserError, ValidationError from odoo.tools import DEFAULT_SERVER_DATETIME_FORMAT, frozendict, html2plaintext from odoo.tools.misc import get_lang from odoo.tools.safe_eval import ( @@ -64,6 +64,8 @@ class SyncProject(models.Model): ) eval_context_description = fields.Text(compute="_compute_eval_context_description") + core_code = fields.Text(string="Core Code", readonly=True) + common_code = fields.Text( "Common Code", help=""" @@ -152,6 +154,14 @@ def _check_python_code(self): if msg: raise ValidationError(msg) + def write(self, vals): + if "core_code" in vals and not self.env.user.has_group( + "sync.sync_group_manager" + ): + raise AccessError(_("Only Administrator can update the Core Code.")) + + return super().write(vals) + def _get_log_function(self, job, function): self.ensure_one() diff --git a/sync/models/sync_project_demo.py b/sync/models/sync_project_demo.py index 68104c5c..32c853ba 100644 --- a/sync/models/sync_project_demo.py +++ b/sync/models/sync_project_demo.py @@ -1,3 +1,5 @@ +# WARNING: This file is obsolete and will be deleted soon + # Copyright 2020 Ivan Yelizariev # Copyright 2020 Denis Mudarisov # License MIT (https://opensource.org/licenses/MIT). diff --git a/sync/views/sync_project_views.xml b/sync/views/sync_project_views.xml index 71803662..bd80ad38 100644 --- a/sync/views/sync_project_views.xml +++ b/sync/views/sync_project_views.xml @@ -147,27 +147,24 @@ - -

-
- Hint: to add manual triggers navigate to corresponding - Task via "Available Tasks" tab + +

+ + For security reasons, the + Core 🪬 Code + can be updated via gist page only. For any custom + code use the + Private ✨ Library + tab instead. +

- - - - -