diff --git a/sync/doc/changelog.rst b/sync/doc/changelog.rst index 624e2890..5ca32cbc 100644 --- a/sync/doc/changelog.rst +++ b/sync/doc/changelog.rst @@ -1,8 +1,9 @@ -`13.0.1` +`14.0.0` ------- - **New:** sync.order: attaching multiple records via new line_ids field; automatic link to sync.job record. - **New:** sync.task: save technical_name of the task for a better integration with Odoo UI (e.g. to call task via custom action) +- **New:** Add dynamic Secret update via `SECRETS._update_secret`. `13.0.1` ------- diff --git a/sync/models/sync_project.py b/sync/models/sync_project.py index c7892371..a19cafaf 100644 --- a/sync/models/sync_project.py +++ b/sync/models/sync_project.py @@ -357,7 +357,22 @@ def gen2csv(generator): "AttrDict": AttrDict, }, ) - SECRETS = AttrDict() + + def _update_secret(key, value): + SECRETS[key] = value + for p in self.secret_ids: + if p.key == key: + p.value = value + return + self.env["sync.project.secret"].create( + { + "project_id": self.id, + "key": key, + "value": value, + } + ) + + SECRETS = AttrDict(_update_secret) for p in self.secret_ids: SECRETS[p.key] = p.value