Skip to content

Commit 36abfc5

Browse files
committed
⚡ sync: add SECRETS._update_secret
1 parent a95fae8 commit 36abfc5

File tree

2 files changed

+18
-2
lines changed

2 files changed

+18
-2
lines changed

sync/doc/changelog.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
`13.0.1`
1+
`14.0.0`
22
-------
33

44
- **New:** sync.order: attaching multiple records via new line_ids field; automatic link to sync.job record.
55
- **New:** sync.task: save technical_name of the task for a better integration with Odoo UI (e.g. to call task via custom action)
6+
- **New:** Add dynamic Secret update via `SECRETS._update_secret`.
67

78
`13.0.1`
89
-------

sync/models/sync_project.py

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -357,7 +357,22 @@ def gen2csv(generator):
357357
"AttrDict": AttrDict,
358358
},
359359
)
360-
SECRETS = AttrDict()
360+
361+
def _update_secret(key, value):
362+
SECRETS[key] = value
363+
for p in self.secret_ids:
364+
if p.key == key:
365+
p.value = value
366+
return
367+
self.env["sync.project.secret"].create(
368+
{
369+
"project_id": self.id,
370+
"key": key,
371+
"value": value,
372+
}
373+
)
374+
375+
SECRETS = AttrDict(_update_secret)
361376
for p in self.secret_ids:
362377
SECRETS[p.key] = p.value
363378

0 commit comments

Comments
 (0)