Skip to content

Commit

Permalink
⚡ sync: add SECRETS._update_secret
Browse files Browse the repository at this point in the history
  • Loading branch information
yelizariev committed Mar 4, 2025
1 parent a95fae8 commit 36abfc5
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
3 changes: 2 additions & 1 deletion sync/doc/changelog.rst
Original file line number Diff line number Diff line change
@@ -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`
-------
Expand Down
17 changes: 16 additions & 1 deletion sync/models/sync_project.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 36abfc5

Please sign in to comment.